All of lore.kernel.org
 help / color / mirror / Atom feed
From: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
To: linux-wireless@vger.kernel.org, kvalo@codeaurora.org,
	johannes.berg@intel.com, hofrat@osadl.org
Cc: prameela.j04cs@gmail.com, prameela.garnepudi@redpinesignals.com
Subject: [PATCH 4/9] rsi: code clean up in file rsi_91x_main.c
Date: Mon, 12 Sep 2016 15:08:19 +0530	[thread overview]
Message-ID: <bce2e61df900a69d6c43ef2594e5c2b3cff949d5.1473669618.git.prameela.j04cs@gmail.com> (raw)
In-Reply-To: <cover.1473669618.git.prameela.j04cs@gmail.com>
In-Reply-To: <cover.1473669618.git.prameela.j04cs@gmail.com>

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
---
 drivers/net/wireless/rsi/rsi_91x_main.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_main.c b/drivers/net/wireless/rsi/rsi_91x_main.c
index 8810862..f82e457 100644
--- a/drivers/net/wireless/rsi/rsi_91x_main.c
+++ b/drivers/net/wireless/rsi/rsi_91x_main.c
@@ -86,7 +86,7 @@ static struct sk_buff *rsi_prepare_skb(struct rsi_common *common,
 
 	pkt_len -= extended_desc;
 	skb = dev_alloc_skb(pkt_len + FRAME_DESC_SZ);
-	if (skb == NULL)
+	if (!skb)
 		return NULL;
 
 	payload_offset = (extended_desc + FRAME_DESC_SZ);
@@ -111,11 +111,10 @@ static struct sk_buff *rsi_prepare_skb(struct rsi_common *common,
 int rsi_read_pkt(struct rsi_common *common, s32 rcv_pkt_len)
 {
 	u8 *frame_desc = NULL, extended_desc = 0;
-	u32 index, length = 0, queueno = 0;
+	u32 index = 0, length = 0, queueno = 0;
 	u16 actual_length = 0, offset;
 	struct sk_buff *skb = NULL;
 
-	index = 0;
 	do {
 		frame_desc = &common->rx_data_pkt[index];
 		actual_length = *(u16 *)&frame_desc[0];
@@ -131,7 +130,7 @@ int rsi_read_pkt(struct rsi_common *common, s32 rcv_pkt_len)
 					      (frame_desc + offset),
 					      length,
 					      extended_desc);
-			if (skb == NULL)
+			if (!skb)
 				goto fail;
 
 			rsi_indicate_pkt_to_os(common, skb);
@@ -198,15 +197,14 @@ struct rsi_hw *rsi_91x_init(void)
 		return NULL;
 
 	adapter->priv = kzalloc(sizeof(*common), GFP_KERNEL);
-	if (adapter->priv == NULL) {
-		rsi_dbg(ERR_ZONE, "%s: Failed in allocation of memory\n",
+	if (!adapter->priv) {
+		rsi_dbg(ERR_ZONE, "%s: Failed in allocation of common cb\n",
 			__func__);
 		kfree(adapter);
 		return NULL;
-	} else {
-		common = adapter->priv;
-		common->priv = adapter;
 	}
+	common = adapter->priv;
+	common->priv = adapter;
 
 	for (ii = 0; ii < NUM_SOFT_QUEUES; ii++)
 		skb_queue_head_init(&common->tx_queue[ii]);
-- 
2.4.11

  parent reply	other threads:[~2016-09-12  9:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12  9:38 [PATCH 0/9] rsi: code clean-up Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 1/9] rsi: cleanup and added debug prints in file rsi_91x_core.c Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 2/9] rsi: Spelling and code format corrections in rsi_91x_debugfs.c Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 3/9] rsi: Added freeing of allocated buffers (sbands and dfsentry) Cleanup (spelling mistakes, code format corrections, empty lines after declaration) Prameela Rani Garnepudi
2016-09-12 12:05   ` kbuild test robot
2016-09-12 12:05   ` [PATCH] rsi: fix ifnullfree.cocci warnings kbuild test robot
2016-09-12  9:38 ` Prameela Rani Garnepudi [this message]
2016-09-12  9:38 ` [PATCH 5/9] rsi: code cleanup in file rsi_91x_mgmt.c Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 6/9] rsi: code cleanup (spelling mistakes and new line after declaration) in file rsi_91x_sdio.c Added developer name Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 7/9] rsi: zone changed for debug message and cleanup in file rsi_91x_sdio_ops.c Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 8/9] rsi: code clean up and replaced ctrl message timeouts with macros in file rsi_91x_usb.c Prameela Rani Garnepudi
2016-09-12  9:38 ` [PATCH 9/9] rsi: code cleanup in file rsi_91x_usb_ops.c Prameela Rani Garnepudi
2016-09-12 12:53 ` [PATCH 0/9] rsi: code clean-up Kalle Valo
2016-09-12 18:50   ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bce2e61df900a69d6c43ef2594e5c2b3cff949d5.1473669618.git.prameela.j04cs@gmail.com \
    --to=prameela.j04cs@gmail.com \
    --cc=hofrat@osadl.org \
    --cc=johannes.berg@intel.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=prameela.garnepudi@redpinesignals.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.