[parisc-linux-cvs] more lasi82596 cleanups

Helge Deller deller at gmx.de
Sun Apr 25 11:48:12 MDT 2004


On Sunday 25 April 2004 19:24, Helge Deller wrote:
> CVSROOT:	/var/cvs
> Module name:	linux-2.6
> Changes by:	deller	04/04/25 11:24:30
> 
> Modified files:
> 	drivers/net    : lasi_82596.c 
> 
> Log message:
> more cleanups (whitespace & __FILE__ usage with "%s") by Joel Soete <soete.joel at tiscali.be>,
> Thanks Joel !

-------------- next part --------------
Index: lasi_82596.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/net/lasi_82596.c,v
retrieving revision 1.9
diff -u -p -r1.9 lasi_82596.c
--- a/lasi_82596.c	24 Apr 2004 22:56:24 -0000	1.9
+++ b/lasi_82596.c	25 Apr 2004 17:22:19 -0000
@@ -124,10 +124,10 @@
 	do { dma_cache_sync((void *)addr, len, DMA_TO_DEVICE); } while (0)
 
 #define  CHECK_INV(addr,len) \
-	do { dma_cache_sync((void *)addr,len, DMA_FROM_DEVICE); } while(0)
+	do { dma_cache_sync((void *)addr, len, DMA_FROM_DEVICE); } while(0)
 
 #define  CHECK_WBACK_INV(addr,len) \
-	do { dma_cache_sync((void *)addr,len, DMA_BIDIRECTIONAL); } while (0)
+	do { dma_cache_sync((void *)addr, len, DMA_BIDIRECTIONAL); } while (0)
 
 
 #define PA_I82596_RESET		0	/* Offsets relative to LASI-LAN-Addr.*/
@@ -506,7 +506,7 @@ static void i596_display_data(struct net
 	rfd = lp->rfd_head;
 	printk("rfd_head = %p\n", rfd);
 	do {
-		printk ("   %p .stat %04x, .cmd %04x, b_next %08x, rbd %08x,"
+		printk("   %p .stat %04x, .cmd %04x, b_next %08x, rbd %08x,"
                         " count %04x\n",
 			rfd, rfd->stat, rfd->cmd, rfd->b_next, rfd->rbd,
 			rfd->count);
@@ -552,7 +552,7 @@ static inline void init_rx_bufs(struct n
 		struct sk_buff *skb = dev_alloc_skb(PKT_BUF_SZ + 4);
 
 		if (skb == NULL)
-			panic(__FILE__ ": alloc_skb() failed");
+			panic("%s: alloc_skb() failed", __FILE__);
 		skb_reserve(skb, 2);
 		dma_addr = dma_map_single(lp->dev, skb->tail,PKT_BUF_SZ,
 					  DMA_FROM_DEVICE);
@@ -658,7 +658,7 @@ static int init_i596_mem(struct net_devi
 	lp->cmd_head = NULL;
         lp->scb.cmd = I596_NULL;
 
-	DEB(DEB_INIT,printk("%s: starting i82596.\n", dev->name));
+	DEB(DEB_INIT, printk("%s: starting i82596.\n", dev->name));
 
 	CHECK_WBACK(&(lp->scp), sizeof(struct i596_scp));
 	CHECK_WBACK(&(lp->iscp), sizeof(struct i596_iscp));
@@ -669,7 +669,7 @@ static int init_i596_mem(struct net_devi
 
 	if (wait_istat(dev, lp, 1000, "initialization timed out"))
 		goto failed;
-	DEB(DEB_INIT,printk("%s: i82596 initialization successful\n", dev->name));
+	DEB(DEB_INIT, printk("%s: i82596 initialization successful\n", dev->name));
 
 	/* Ensure rx frame/buffer descriptors are tidy */
 	rebuild_rx_bufs(dev);
@@ -679,19 +679,19 @@ static int init_i596_mem(struct net_devi
 
 	enable_irq(dev->irq);	/* enable IRQs from LAN */
 
-	DEB(DEB_INIT,printk("%s: queuing CmdConfigure\n", dev->name));
+	DEB(DEB_INIT, printk("%s: queuing CmdConfigure\n", dev->name));
 	memcpy(lp->cf_cmd.i596_config, init_setup, 14);
 	lp->cf_cmd.cmd.command = CmdConfigure;
 	CHECK_WBACK(&(lp->cf_cmd), sizeof(struct cf_cmd));
 	i596_add_cmd(dev, &lp->cf_cmd.cmd);
 
-	DEB(DEB_INIT,printk("%s: queuing CmdSASetup\n", dev->name));
+	DEB(DEB_INIT, printk("%s: queuing CmdSASetup\n", dev->name));
 	memcpy(lp->sa_cmd.eth_addr, dev->dev_addr, 6);
 	lp->sa_cmd.cmd.command = CmdSASetup;
 	CHECK_WBACK(&(lp->sa_cmd), sizeof(struct sa_cmd));
 	i596_add_cmd(dev, &lp->sa_cmd.cmd);
 
-	DEB(DEB_INIT,printk("%s: queuing CmdTDR\n", dev->name));
+	DEB(DEB_INIT, printk("%s: queuing CmdTDR\n", dev->name));
 	lp->tdr_cmd.cmd.command = CmdTDR;
 	CHECK_WBACK(&(lp->tdr_cmd), sizeof(struct tdr_cmd));
 	i596_add_cmd(dev, &lp->tdr_cmd.cmd);
@@ -702,7 +702,7 @@ static int init_i596_mem(struct net_devi
 		spin_unlock_irqrestore (&lp->lock, flags);
 		goto failed;
 	}
-	DEB(DEB_INIT,printk("%s: Issuing RX_START\n", dev->name));
+	DEB(DEB_INIT, printk("%s: Issuing RX_START\n", dev->name));
 	lp->scb.command = RX_START;
 	lp->scb.rfd = WSWAPrfd(virt_to_dma(lp,lp->rfds));
 	CHECK_WBACK(&(lp->scb), sizeof(struct i596_scb));
@@ -713,7 +713,7 @@ static int init_i596_mem(struct net_devi
 
 	if (wait_cmd(dev, lp, 1000, "RX_START not processed"))
 		goto failed;
-	DEB(DEB_INIT,printk("%s: Receive unit started OK\n", dev->name));
+	DEB(DEB_INIT, printk("%s: Receive unit started OK\n", dev->name));
 
 	return 0;
 
@@ -731,7 +731,7 @@ static inline int i596_rx(struct net_dev
 	struct i596_rbd *rbd;
 	int frames = 0;
 
-	DEB(DEB_RXFRAME,printk ("i596_rx(), rfd_head %p, rbd_head %p\n",
+	DEB(DEB_RXFRAME, printk("i596_rx(), rfd_head %p, rbd_head %p\n",
 			lp->rfd_head, lp->rbd_head));
 
 
@@ -794,7 +794,7 @@ static inline int i596_rx(struct net_dev
 memory_squeeze:
 			if (skb == NULL) {
 				/* XXX tulip.c can defer packets here!! */
-				printk ("%s: i596_rx Memory squeeze, dropping packet.\n", dev->name);
+				printk("%s: i596_rx Memory squeeze, dropping packet.\n", dev->name);
 				lp->stats.rx_dropped++;
 			}
 			else {
@@ -863,7 +863,7 @@ memory_squeeze:
 		CHECK_INV(rfd, sizeof(struct i596_rfd));
 	}
 
-	DEB(DEB_RXFRAME,printk ("frames %d\n", frames));
+	DEB(DEB_RXFRAME, printk("frames %d\n", frames));
 
 	return 0;
 }
@@ -912,7 +912,7 @@ static inline void i596_reset(struct net
 {
 	unsigned long flags;
 
-	DEB(DEB_RESET,printk("i596_reset\n"));
+	DEB(DEB_RESET, printk("i596_reset\n"));
 
 	spin_lock_irqsave (&lp->lock, flags);
 
@@ -942,7 +942,7 @@ static void i596_add_cmd(struct net_devi
 	struct i596_private *lp = dev->priv;
 	unsigned long flags;
 
-	DEB(DEB_ADDCMD,printk("i596_add_cmd cmd_head %p\n", lp->cmd_head));
+	DEB(DEB_ADDCMD, printk("i596_add_cmd cmd_head %p\n", lp->cmd_head));
 
 	cmd->status = 0;
 	cmd->command |= (CMD_EOL | CMD_INTR);
@@ -1014,7 +1014,7 @@ static int i596_test(struct net_device *
 
 static int i596_open(struct net_device *dev)
 {
-	DEB(DEB_OPEN,printk("%s: i596_open() irq %d.\n", dev->name, dev->irq));
+	DEB(DEB_OPEN, printk("%s: i596_open() irq %d.\n", dev->name, dev->irq));
 
 	if (request_irq(dev->irq, &i596_interrupt, 0, "i82596", dev)) {
 		printk("%s: IRQ %d not free\n", dev->name, dev->irq);
@@ -1044,19 +1044,19 @@ static void i596_tx_timeout (struct net_
 	struct i596_private *lp = dev->priv;
 
 	/* Transmitter timeout, serious problems. */
-	DEB(DEB_ERRORS,printk("%s: transmit timed out, status resetting.\n",
+	DEB(DEB_ERRORS, printk("%s: transmit timed out, status resetting.\n",
 			dev->name));
 
 	lp->stats.tx_errors++;
 
 	/* Try to restart the adaptor */
 	if (lp->last_restart == lp->stats.tx_packets) {
-		DEB(DEB_ERRORS,printk ("Resetting board.\n"));
+		DEB(DEB_ERRORS, printk("Resetting board.\n"));
 		/* Shutdown and restart */
 		i596_reset (dev, lp);
 	} else {
 		/* Issue a channel attention signal */
-		DEB(DEB_ERRORS,printk ("Kicking board.\n"));
+		DEB(DEB_ERRORS, printk("Kicking board.\n"));
 		lp->scb.command = CUC_START | RX_START;
 		CHECK_WBACK_INV(&(lp->scb), sizeof(struct i596_scb));
 		CA (dev);
@@ -1076,7 +1076,7 @@ static int i596_start_xmit(struct sk_buf
 	short length = skb->len;
 	dev->trans_start = jiffies;
 
-	DEB(DEB_STARTTX,printk("%s: i596_start_xmit(%x,%p) called\n", dev->name,
+	DEB(DEB_STARTTX, printk("%s: i596_start_xmit(%x,%p) called\n", dev->name,
 				skb->len, skb->data));
 
 	if (length < ETH_ZLEN) {
@@ -1092,7 +1092,7 @@ static int i596_start_xmit(struct sk_buf
 	tbd = lp->tbds + lp->next_tx_cmd;
 
 	if (tx_cmd->cmd.command) {
-		DEB(DEB_ERRORS,printk ("%s: xmit ring full, dropping packet.\n",
+		DEB(DEB_ERRORS, printk("%s: xmit ring full, dropping packet.\n",
 				dev->name));
 		lp->stats.tx_dropped++;
 
@@ -1155,28 +1155,28 @@ static int __devinit i82596_probe(struct
 
 	/* This lot is ensure things have been cache line aligned. */
 	if (sizeof(struct i596_rfd) != 32) {
-	    printk(KERN_ERR __FILE__ ": sizeof(struct i596_rfd) = %d\n",
+	    printk(KERN_ERR "%s: sizeof(struct i596_rfd) = %d\n", __FILE__,
 			sizeof(struct i596_rfd));
 	    return -ENODEV;
 	}
 	if ((sizeof(struct i596_rbd) % 32) != 0) {
-	    printk(KERN_ERR __FILE__ ": sizeof(struct i596_rbd) = %d\n",
+	    printk(KERN_ERR "%s: sizeof(struct i596_rbd) = %d\n", __FILE__,
 			sizeof(struct i596_rbd));
 	    return -ENODEV;
 	}
 	if ((sizeof(struct tx_cmd) % 32) != 0) {
-	    printk(KERN_ERR __FILE__ ": sizeof(struct tx_cmd) = %d\n",
+	    printk(KERN_ERR "%s: sizeof(struct tx_cmd) = %d\n", __FILE__,
 			sizeof(struct tx_cmd));
 	    return -ENODEV;
 	}
 	if (sizeof(struct i596_tbd) != 32) {
-	    printk(KERN_ERR __FILE__ ": sizeof(struct i596_tbd) = %d\n",
+	    printk(KERN_ERR "%s: sizeof(struct i596_tbd) = %d\n", __FILE__,
 			sizeof(struct i596_tbd));
 	    return -ENODEV;
 	}
 #ifndef __LP64__
 	if (sizeof(struct i596_private) > 4096) {
-	    printk(KERN_ERR __FILE__ ": sizeof(struct i596_private) = %d\n",
+	    printk(KERN_ERR "%s: sizeof(struct i596_private) = %d\n", __FILE__,
 			sizeof(struct i596_private));
 	    return -ENODEV;
 	}
@@ -1189,13 +1189,13 @@ static int __devinit i82596_probe(struct
 		for (i=0; i < 6; i++) {
 			eth_addr[i] = gsc_readb(LAN_PROM_ADDR + i);
 		}
-		printk(KERN_INFO __FILE__ ": MAC of HP700 LAN read from EEPROM\n");
+		printk(KERN_INFO "%s: MAC of HP700 LAN read from EEPROM\n", __FILE__);
 	}
 
 	dev->mem_start = (unsigned long) dma_alloc_noncoherent(gen_dev, 
 		sizeof(struct i596_private), &dma_addr, GFP_KERNEL);
 	if (!dev->mem_start) {
-		printk(KERN_ERR __FILE__ ": Couldn't get shared memory\n");
+		printk(KERN_ERR "%s: Couldn't get shared memory\n", __FILE__);
 		return -ENOMEM;
 	}
 
@@ -1233,11 +1233,11 @@ static int __devinit i82596_probe(struct
 		return i;
 	};
 
-	DEB(DEB_PROBE,printk(KERN_INFO "%s: 82596 at %#3lx,", dev->name, dev->base_addr));
+	DEB(DEB_PROBE, printk(KERN_INFO "%s: 82596 at %#3lx,", dev->name, dev->base_addr));
 	for (i = 0; i < 6; i++)
-		DEB(DEB_PROBE,printk(" %2.2X", dev->dev_addr[i]));
-	DEB(DEB_PROBE,printk(" IRQ %d.\n", dev->irq));
-	DEB(DEB_INIT,printk(KERN_INFO "%s: lp at 0x%p (%d bytes), lp->scb at 0x%p\n",
+		DEB(DEB_PROBE, printk(" %2.2X", dev->dev_addr[i]));
+	DEB(DEB_PROBE, printk(" IRQ %d.\n", dev->irq));
+	DEB(DEB_INIT, printk(KERN_INFO "%s: lp at 0x%p (%d bytes), lp->scb at 0x%p\n",
 		dev->name, lp, sizeof(struct i596_private), &lp->scb));
 
 	return 0;
@@ -1262,7 +1262,7 @@ static irqreturn_t i596_interrupt(int ir
 	wait_cmd(dev, lp, 100, "i596 interrupt, timeout");
 	status = lp->scb.status;
 
-	DEB(DEB_INTS,printk("%s: i596 interrupt, IRQ %d, status %4.4x.\n",
+	DEB(DEB_INTS, printk("%s: i596 interrupt, IRQ %d, status %4.4x.\n",
 			dev->name, irq, status));
 
 	ack_cmd = status & 0xf000;
@@ -1277,9 +1277,9 @@ static irqreturn_t i596_interrupt(int ir
 		struct i596_cmd *ptr;
 
 		if ((status & 0x8000))
-			DEB(DEB_INTS,printk("%s: i596 interrupt completed command.\n", dev->name));
+			DEB(DEB_INTS, printk("%s: i596 interrupt completed command.\n", dev->name));
 		if ((status & 0x2000))
-			DEB(DEB_INTS,printk("%s: i596 interrupt command unit inactive %x.\n", dev->name, status & 0x0700));
+			DEB(DEB_INTS, printk("%s: i596 interrupt command unit inactive %x.\n", dev->name, status & 0x0700));
 
 		while (lp->cmd_head != NULL) {
 			CHECK_INV(lp->cmd_head, sizeof(struct i596_cmd));
@@ -1288,7 +1288,7 @@ static irqreturn_t i596_interrupt(int ir
 
 			ptr = lp->cmd_head;
 
-			DEB(DEB_STATUS,printk("cmd_head->status = %04x, ->command = %04x\n",
+			DEB(DEB_STATUS, printk("cmd_head->status = %04x, ->command = %04x\n",
 				       lp->cmd_head->status, lp->cmd_head->command));
 			lp->cmd_head = ptr->v_next;
 			lp->cmd_backlog--;
@@ -1300,7 +1300,7 @@ static irqreturn_t i596_interrupt(int ir
 				struct sk_buff *skb = tx_cmd->skb;
 
 				if ((ptr->status) & STAT_OK) {
-					DEB(DEB_TXADDR,print_eth(skb->data, "tx-done"));
+					DEB(DEB_TXADDR, print_eth(skb->data, "tx-done"));
 				} else {
 					lp->stats.tx_errors++;
 					if ((ptr->status) & 0x0020)
@@ -1325,7 +1325,7 @@ static irqreturn_t i596_interrupt(int ir
 				unsigned short status = ((struct tdr_cmd *)ptr)->status;
 
 				if (status & 0x8000) {
-					DEB(DEB_ANY,printk("%s: link ok.\n", dev->name));
+					DEB(DEB_ANY, printk("%s: link ok.\n", dev->name));
 				} else {
 					if (status & 0x4000)
 						printk("%s: Transceiver problem.\n", dev->name);
@@ -1334,7 +1334,7 @@ static irqreturn_t i596_interrupt(int ir
 					if (status & 0x1000)
 						printk("%s: Short circuit.\n", dev->name);
 
-					DEB(DEB_TDR,printk("%s: Time %d.\n", dev->name, status & 0x07ff));
+					DEB(DEB_TDR, printk("%s: Time %d.\n", dev->name, status & 0x07ff));
 				}
 				break;
 			    }
@@ -1369,12 +1369,12 @@ static irqreturn_t i596_interrupt(int ir
 	}
 	if ((status & 0x1000) || (status & 0x4000)) {
 		if ((status & 0x4000))
-			DEB(DEB_INTS,printk("%s: i596 interrupt received a frame.\n", dev->name));
+			DEB(DEB_INTS, printk("%s: i596 interrupt received a frame.\n", dev->name));
 		i596_rx(dev);
 		/* Only RX_START if stopped - RGH 07-07-96 */
 		if (status & 0x1000) {
 			if (netif_running(dev)) {
-				DEB(DEB_ERRORS,printk("%s: i596 interrupt receive unit inactive, status 0x%x\n", dev->name, status));
+				DEB(DEB_ERRORS, printk("%s: i596 interrupt receive unit inactive, status 0x%x\n", dev->name, status));
 				ack_cmd |= RX_START;
 				lp->stats.rx_errors++;
 				lp->stats.rx_fifo_errors++;
@@ -1393,7 +1393,7 @@ static irqreturn_t i596_interrupt(int ir
 	CA(dev);
 
 	wait_cmd(dev, lp, 100, "i596 interrupt, exit timeout");
-	DEB(DEB_INTS,printk("%s: exiting interrupt.\n", dev->name));
+	DEB(DEB_INTS, printk("%s: exiting interrupt.\n", dev->name));
 
 	spin_unlock (&lp->lock);
 	return IRQ_HANDLED;
@@ -1406,7 +1406,7 @@ static int i596_close(struct net_device 
 
 	netif_stop_queue(dev);
 
-	DEB(DEB_INIT,printk("%s: Shutting down ethercard, status was %4.4x.\n",
+	DEB(DEB_INIT, printk("%s: Shutting down ethercard, status was %4.4x.\n",
 		       dev->name, lp->scb.status));
 
 	spin_lock_irqsave(&lp->lock, flags);
@@ -1449,7 +1449,9 @@ static void set_multicast_list(struct ne
 	struct i596_private *lp = dev->priv;
 	int config = 0, cnt;
 
-	DEB(DEB_MULTI,printk("%s: set multicast list, %d entries, promisc %s, allmulti %s\n", dev->name, dev->mc_count, dev->flags & IFF_PROMISC ? "ON" : "OFF", dev->flags & IFF_ALLMULTI ? "ON" : "OFF"));
+	DEB(DEB_MULTI, printk("%s: set multicast list, %d entries, promisc %s, allmulti %s\n",
+		dev->name, dev->mc_count, dev->flags & IFF_PROMISC ? "ON" : "OFF",
+		dev->flags & IFF_ALLMULTI ? "ON" : "OFF"));
 
 	if ((dev->flags & IFF_PROMISC) && !(lp->cf_cmd.i596_config[8] & 0x01)) {
 		lp->cf_cmd.i596_config[8] |= 0x01;
@@ -1498,7 +1500,7 @@ static void set_multicast_list(struct ne
 		for (dmi = dev->mc_list; cnt && dmi != NULL; dmi = dmi->next, cnt--, cp += 6) {
 			memcpy(cp, dmi->dmi_addr, 6);
 			if (i596_debug > 1)
-				DEB(DEB_MULTI,printk("%s: Adding address %02x:%02x:%02x:%02x:%02x:%02x\n",
+				DEB(DEB_MULTI, printk("%s: Adding address %02x:%02x:%02x:%02x:%02x:%02x\n",
 						dev->name, cp[0],cp[1],cp[2],cp[3],cp[4],cp[5]));
 		}
 		CHECK_WBACK_INV(&lp->mc_cmd, sizeof(struct mc_cmd));
@@ -1528,7 +1530,8 @@ lan_init_chip(struct parisc_device *dev)
 		printk(KERN_INFO LASI_82596_DRIVER_VERSION "\n");
 	
 	if (!dev->irq) {
-		printk(KERN_ERR __FILE__ ": IRQ not found for i82596 at 0x%lx\n", dev->hpa);
+		printk(KERN_ERR "%s: IRQ not found for i82596 at 0x%lx\n",
+			__FILE__, dev->hpa);
 		return -ENODEV;
 	}
 


More information about the parisc-linux-cvs mailing list