All of lore.kernel.org
 help / color / mirror / Atom feed
From: Archana <craechal@gmail.com>
To: gregkh@linuxfoundation.org, drv@mailo.com,
	linux-staging@lists.linux.dev, error27@gmail.com
Cc: Archana <craechal@gmail.com>
Subject: [PATCH v2 2/2] staging: wlan-ng: small cleanup in plugimage()
Date: Sat, 11 Mar 2023 12:12:53 +0000	[thread overview]
Message-ID: <20230311121253.10225-2-craechal@gmail.com> (raw)
In-Reply-To: <20230311121253.10225-1-craechal@gmail.com>

It's cleaner to set "j = -1;" before the if block and remove the else
statement.

Signed-off-by: Archana <craechal@gmail.com>
---
Changes in v2:
  - Make the commit message more clearer.

 drivers/staging/wlan-ng/prism2fw.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
index 98ed9bb9192c..11658865ca50 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -689,6 +689,7 @@ static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks,
 	for (i = 0; i < ns3plug; i++) {
 		pstart = s3plug[i].addr;
 		pend = s3plug[i].addr + s3plug[i].len;
+		j = -1;
 		/* find the matching PDR (or filename) */
 		if (s3plug[i].itemcode != 0xffffffffUL) { /* not filename */
 			for (j = 0; j < pda->nrec; j++) {
@@ -696,8 +697,6 @@ static int plugimage(struct imgchunk *fchunk, unsigned int nfchunks,
 				    le16_to_cpu(pda->rec[j]->code))
 					break;
 			}
-		} else {
-			j = -1;
 		}
 		if (j >= pda->nrec && j != -1) { /*  if no matching PDR, fail */
 			pr_warn("warning: Failed to find PDR for plugrec 0x%04x.\n",
-- 
2.34.1


  reply	other threads:[~2023-03-11 12:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 20:59 [PATCH 1/2] staging: wlan-ng: remove unnecessary kfree statements Archana
2023-03-10 20:59 ` [PATCH 2/2] staging: wlan-ng: remove else statement Archana
2023-03-11  4:34   ` Dan Carpenter
2023-03-11  4:58     ` Dan Carpenter
2023-03-11  7:39       ` Greg KH
2023-03-11 12:12         ` [PATCH v2 1/2] staging: wlan-ng: small cleanup in writeimage() Archana
2023-03-11 12:12           ` Archana [this message]
2023-03-11 12:37           ` Dan Carpenter
2023-03-11 12:45         ` [PATCH 2/2] staging: wlan-ng: remove else statement Archana
2023-03-11  7:40 ` [PATCH 1/2] staging: wlan-ng: remove unnecessary kfree statements Greg KH
2023-03-16 11:19   ` Archana
2023-03-16 11:27   ` Archana

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=20230311121253.10225-2-craechal@gmail.com \
    --to=craechal@gmail.com \
    --cc=drv@mailo.com \
    --cc=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-staging@lists.linux.dev \
    /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.