[linux-yocto] [PATCH 16/57] LSI AXM55xx: Code syntax - checkpatch updates to Update RIO interfaces

Charlie Paul cpaul.windriver at gmail.com
Mon Mar 17 21:56:16 PDT 2014


---
 drivers/net/rionet.c |   61 +++++++++++++++++++++++---------------------------
 1 file changed, 28 insertions(+), 33 deletions(-)

diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
index bf79034..fbea401 100644
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -104,10 +104,9 @@ static int rionet_rx_clean(struct net_device *ndev)
 
 		if (!rnet->rx_skb[i])
 			continue;
-
-		if (!(data = rio_get_inb_message(rnet->mport, RIONET_MAILBOX,
-						 RIONET_LETTER, &sz, &slot,
-						 &destid)))
+		data = rio_get_inb_message(rnet->mport, RIONET_MAILBOX,
+				RIONET_LETTER, &sz, &slot, &destid);
+		if (!data)
 			break;
 
 		rnet->rx_skb[i]->data = data;
@@ -170,7 +169,7 @@ static int rionet_queue_tx_msg(struct sk_buff *skb, struct net_device *ndev,
 	rnet->tx_slot &= (RIONET_TX_RING_SIZE - 1);
 
 	if (netif_msg_tx_queued(rnet))
-		printk(KERN_INFO "%s: queued skb len %8.8x\n", DRV_NAME,
+		pr_info("%s: queued skb len %8.8x\n", DRV_NAME,
 		       skb->len);
 
 	return 0;
@@ -193,7 +192,7 @@ static int rionet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 	if ((rnet->tx_cnt + add_num) > RIONET_TX_RING_SIZE) {
 		netif_stop_queue(ndev);
 		spin_unlock_irqrestore(&rnet->tx_lock, flags);
-		printk(KERN_ERR "%s: BUG! Tx Ring full when queue awake!\n",
+		pr_err("%s: BUG! Tx Ring full when queue awake!\n",
 		       ndev->name);
 		return NETDEV_TX_BUSY;
 	}
@@ -235,7 +234,7 @@ static void rionet_dbell_event(struct rio_mport *mport, void *dev_id, u16 sid, u
 	rnet = netdev_priv(ndev);
 
 	if (netif_msg_intr(rnet))
-		printk(KERN_INFO "%s: doorbell sid %4.4x tid %4.4x info %4.4x",
+		pr_info("%s: doorbell sid %4.4x tid %4.4x info %4.4x",
 		       DRV_NAME, sid, tid, info);
 	if (info == RIONET_DOORBELL_JOIN) {
 		if (!nets[rnet->mport->id].active[sid]) {
@@ -255,8 +254,7 @@ static void rionet_dbell_event(struct rio_mport *mport, void *dev_id, u16 sid, u
 		nets[rnet->mport->id].nact--;
 	} else {
 		if (netif_msg_intr(rnet))
-			printk(KERN_WARNING "%s: unhandled doorbell\n",
-			       DRV_NAME);
+			pr_warn("%s: unhandled doorbell\n", DRV_NAME);
 	}
 }
 
@@ -272,7 +270,7 @@ static void rionet_inb_msg_event(struct rio_mport *mport, void *dev_id, int mbox
 	rnet = netdev_priv(ndev);
 
 	if (netif_msg_intr(rnet))
-		printk(KERN_INFO "%s: inbound message event, mbox %d slot %d\n",
+		pr_info("%s: inbound message event, mbox %d slot %d\n",
 		       DRV_NAME, mbox, slot);
 
 	spin_lock(&rnet->lock);
@@ -295,9 +293,9 @@ static void rionet_outb_msg_event(struct rio_mport *mport, void *dev_id, int mbo
 	spin_lock(&rnet->lock);
 
 	if (netif_msg_intr(rnet))
-		printk(KERN_INFO
-		       "%s: outbound message event, mbox %d slot %d\n",
-		       DRV_NAME, mbox, slot);
+		pr_info(
+		"%s: outbound message event, mbox %d slot %d\n",
+		DRV_NAME, mbox, slot);
 
 	while (rnet->tx_cnt && (rnet->ack_slot != slot)) {
 		/* dma unmap single */
@@ -321,7 +319,7 @@ static int rionet_open(struct net_device *ndev)
 	struct rionet_private *rnet = netdev_priv(ndev);
 
 	if (netif_msg_ifup(rnet))
-		printk(KERN_INFO "%s: open\n", DRV_NAME);
+		pr_info("%s: open\n", DRV_NAME);
 
 	rc = rio_request_inb_dbell(rnet->mport,
 				   (void *)ndev,
@@ -332,10 +330,10 @@ static int rionet_open(struct net_device *ndev)
 		goto out;
 
 	rc = rio_request_inb_mbox(rnet->mport,
-			          (void *)ndev,
-			          RIONET_MAILBOX,
-			          RIONET_RX_RING_SIZE,
-			          rionet_inb_msg_event);
+			(void *)ndev,
+			RIONET_MAILBOX,
+			RIONET_RX_RING_SIZE,
+			rionet_inb_msg_event);
 	if (rc < 0)
 		goto out;
 
@@ -366,9 +364,8 @@ static int rionet_open(struct net_device *ndev)
 		peer->res = rio_request_outb_dbell(peer->rdev,
 						 RIONET_DOORBELL_JOIN,
 						 RIONET_DOORBELL_LEAVE);
-		if (!peer || !peer->res)
-		{
-			printk(KERN_ERR "%s: error requesting doorbells\n",
+		if (!peer || !peer->res) {
+			pr_err("%s: error requesting doorbells\n",
 			       DRV_NAME);
 			continue;
 		}
@@ -388,7 +385,7 @@ static int rionet_close(struct net_device *ndev)
 	int i;
 
 	if (netif_msg_ifup(rnet))
-		printk(KERN_INFO "%s: close %s\n", DRV_NAME, ndev->name);
+		pr_info("%s: close %s\n", DRV_NAME, ndev->name);
 
 	netif_stop_queue(ndev);
 	netif_carrier_off(ndev);
@@ -517,7 +514,7 @@ static int rionet_setup_netdev(struct rio_mport *mport, struct net_device *ndev)
 	if (rc != 0)
 		goto out;
 
-	printk(KERN_INFO "%s: %s %s Version %s, MAC %pM, %s\n",
+	pr_info("%s: %s %s Version %s, MAC %pM, %s\n",
 	       ndev->name,
 	       DRV_NAME,
 	       DRV_DESC,
@@ -545,8 +542,7 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
 
 	oldnet = test_and_set_bit(netid, net_table);
 
-	/*
-	 * First time through, make sure local device is rionet
+	/* First time through, make sure local device is rionet
 	 * capable, setup netdev (will be skipped on later probes)
 	 */
 	if (!oldnet) {
@@ -555,16 +551,15 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
 		rio_local_read_config_32(rdev->hport, RIO_DST_OPS_CAR,
 					 &ldst_ops);
 		if (!is_rionet_capable(lsrc_ops, ldst_ops)) {
-			printk(KERN_ERR
-			       "%s: local device %s is not network capable\n",
-			       DRV_NAME, rdev->hport->name);
+			pr_err("%s: local device %s is not network capable\n",
+					DRV_NAME, rdev->hport->name);
 			goto out;
 		}
 
 		/* Allocate our net_device structure */
 		ndev = alloc_etherdev(sizeof(struct rionet_private));
 		if (ndev == NULL) {
-			printk(KERN_INFO "%s: could not allocate ethernet device.\n",
+			pr_info("%s: could not allocate ethernet device.\n",
 				DRV_NAME);
 			rc = -ENOMEM;
 			goto out;
@@ -576,12 +571,12 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
 	} else if (nets[netid].ndev == NULL)
 		goto out;
 
-	/*
-	 * If the remote device has mailbox/doorbell capabilities,
+	/* If the remote device has mailbox/doorbell capabilities,
 	 * add it to the peer list.
 	 */
 	if (dev_rionet_capable(rdev)) {
-		if (!(peer = kmalloc(sizeof(struct rionet_peer), GFP_KERNEL))) {
+		peer = kmalloc(sizeof(struct rionet_peer), GFP_KERNEL);
+		if (!peer) {
 			rc = -ENOMEM;
 			goto out;
 		}
@@ -591,7 +586,7 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
 
 	rio_set_drvdata(rdev, nets[netid].ndev);
 
-      out:
+out:
 	return rc;
 }
 
-- 
1.7.9.5



More information about the linux-yocto mailing list