pcnet: code style cleanup

Fix up the code to match Documentation/CodingStyle. This is mostly
removing extraneous spaces.

No functional change is intended.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
This commit is contained in:
Paul Burton 2013-11-08 11:18:43 +00:00 committed by Daniel Schwierzeck
parent fa476f75bf
commit 6011dabd0a

View file

@ -121,7 +121,7 @@ static void pcnet_reset (struct eth_device *dev)
static int pcnet_check(struct eth_device *dev)
{
outw(88, dev->iobase + PCNET_RAP);
return (inw (dev->iobase + PCNET_RAP) == 88);
return inw(dev->iobase + PCNET_RAP) == 88;
}
static int pcnet_init (struct eth_device *dev, bd_t * bis);
@ -153,14 +153,14 @@ int pcnet_initialize (bd_t * bis)
/*
* Find the PCnet PCI device(s).
*/
if ((devbusfn = pci_find_devices (supported, dev_nr)) < 0) {
devbusfn = pci_find_devices(supported, dev_nr);
if (devbusfn < 0)
break;
}
/*
* Allocate and pre-fill the device structure.
*/
dev = (struct eth_device *) malloc (sizeof *dev);
dev = (struct eth_device *)malloc(sizeof(*dev));
if (!dev) {
printf("pcnet: Can not allocate memory\n");
break;
@ -184,7 +184,8 @@ int pcnet_initialize (bd_t * bis)
pci_write_config_word(devbusfn, PCI_COMMAND, command);
pci_read_config_word(devbusfn, PCI_COMMAND, &status);
if ((status & command) != command) {
printf ("%s: Couldn't enable IO access or Bus Mastering\n", dev->name);
printf("%s: Couldn't enable IO access or Bus Mastering\n",
dev->name);
free(dev);
continue;
}
@ -453,13 +454,12 @@ static int pcnet_recv (struct eth_device *dev)
/*
* If we own the next entry, it's a new packet. Send it up.
*/
if (((status = le16_to_cpu (entry->status)) & 0x8000) != 0) {
status = le16_to_cpu(entry->status);
if ((status & 0x8000) != 0)
break;
}
status >>= 8;
if (status != 0x03) { /* There was an error. */
printf("%s: Rx%d", dev->name, lp->cur_rx);
PCNET_DEBUG1(" (status=0x%x)", status);
if (status & 0x20)
@ -474,11 +474,10 @@ static int pcnet_recv (struct eth_device *dev)
entry->status &= le16_to_cpu(0x03ff);
} else {
pkt_len =
(le32_to_cpu (entry->msg_length) & 0xfff) - 4;
pkt_len = (le32_to_cpu(entry->msg_length) & 0xfff) - 4;
if (pkt_len < 60) {
printf ("%s: Rx%d: invalid packet length %d\n", dev->name, lp->cur_rx, pkt_len);
printf("%s: Rx%d: invalid packet length %d\n",
dev->name, lp->cur_rx, pkt_len);
} else {
NetReceive(lp->rx_buf[lp->cur_rx], pkt_len);
PCNET_DEBUG2("Rx%d: %d bytes from 0x%p\n",
@ -509,7 +508,6 @@ static void pcnet_halt (struct eth_device *dev)
break;
udelay(10);
}
if (i <= 0) {
if (i <= 0)
printf("%s: TIMEOUT: controller reset failed\n", dev->name);
}
}