* [PATCH 1/2] staging: wlan-ng: remove unnecessary kfree statements
@ 2023-03-10 20:59 Archana
2023-03-10 20:59 ` [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
0 siblings, 2 replies; 12+ messages in thread
From: Archana @ 2023-03-10 20:59 UTC (permalink / raw)
To: drv, linux-staging, gregkh; +Cc: Archana
The function uses goto free_result in rest of its implementation.
Signed-off-by: Archana <craechal@gmail.com>
---
drivers/staging/wlan-ng/prism2fw.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
index 02a2191d5c4d..98ed9bb9192c 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -1008,12 +1008,11 @@ static int writeimage(struct wlandevice *wlandev, struct imgchunk *fchunk,
rstmsg = kzalloc(sizeof(*rstmsg), GFP_KERNEL);
rwrmsg = kzalloc(sizeof(*rwrmsg), GFP_KERNEL);
if (!rstmsg || !rwrmsg) {
- kfree(rstmsg);
- kfree(rwrmsg);
netdev_err(wlandev->netdev,
"%s: no memory for firmware download, aborting download\n",
__func__);
- return -ENOMEM;
+ result = -ENOMEM;
+ goto free_result;
}
/* Initialize the messages */
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/2] staging: wlan-ng: remove else statement
2023-03-10 20:59 [PATCH 1/2] staging: wlan-ng: remove unnecessary kfree statements Archana
@ 2023-03-10 20:59 ` Archana
2023-03-11 4:34 ` Dan Carpenter
2023-03-11 7:40 ` [PATCH 1/2] staging: wlan-ng: remove unnecessary kfree statements Greg KH
1 sibling, 1 reply; 12+ messages in thread
From: Archana @ 2023-03-10 20:59 UTC (permalink / raw)
To: drv, linux-staging, gregkh; +Cc: Archana
else block is not needed if j is set to -1
before if block
Signed-off-by: Archana <craechal@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] staging: wlan-ng: remove else statement
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
0 siblings, 1 reply; 12+ messages in thread
From: Dan Carpenter @ 2023-03-11 4:34 UTC (permalink / raw)
To: Archana; +Cc: drv, linux-staging, gregkh
On Fri, Mar 10, 2023 at 08:59:17PM +0000, Archana wrote:
> else block is not needed if j is set to -1
> before if block
>
> Signed-off-by: Archana <craechal@gmail.com>
> ---
Is Archana your full legal name that you would write on a legal document?
I feel like the patch is nice and I like that it's based on reading the
code instead of checkpatch. The commit message isn't great. Here is my
suggestion on that:
Subject: [PATCH 2/2] staging: wlan-ng: small clean up in plugimage()
It's cleaner to set "j = -1;" before the if block and remove the else
statement.
The main differences are:
1: It says that the motivation for the patch is a clean up.
2: Capital letter at the start of the sentence.
3: Period at the end.
I try not to be too picky about commit messages but the issue with your
legal name is important so you were going to have to resend anyway.
Also everyone can use capital letters and periods even if English is not
their first language. We could figure out the motivation for the patch
easily enough but we like to be extra strict with new people so they
develop good habbits.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] staging: wlan-ng: remove else statement
2023-03-11 4:34 ` Dan Carpenter
@ 2023-03-11 4:58 ` Dan Carpenter
2023-03-11 7:39 ` Greg KH
0 siblings, 1 reply; 12+ messages in thread
From: Dan Carpenter @ 2023-03-11 4:58 UTC (permalink / raw)
To: Archana; +Cc: drv, linux-staging, gregkh
On Sat, Mar 11, 2023 at 07:34:25AM +0300, Dan Carpenter wrote:
> On Fri, Mar 10, 2023 at 08:59:17PM +0000, Archana wrote:
> > else block is not needed if j is set to -1
> > before if block
> >
> > Signed-off-by: Archana <craechal@gmail.com>
> > ---
>
> Is Archana your full legal name that you would write on a legal document?
Ah, never mind. Apparently this policy has been updated. Pseudonyms
are allowed for people concerned about privacy but anonymous
contributions are not allowed.
https://lore.kernel.org/all/ZAoMxSPKNLoLg7Wl@aschofie-mobl2/
regards,
dan carpenter
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] staging: wlan-ng: remove else statement
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:45 ` [PATCH 2/2] staging: wlan-ng: remove else statement Archana
0 siblings, 2 replies; 12+ messages in thread
From: Greg KH @ 2023-03-11 7:39 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Archana, drv, linux-staging
On Sat, Mar 11, 2023 at 07:58:51AM +0300, Dan Carpenter wrote:
> On Sat, Mar 11, 2023 at 07:34:25AM +0300, Dan Carpenter wrote:
> > On Fri, Mar 10, 2023 at 08:59:17PM +0000, Archana wrote:
> > > else block is not needed if j is set to -1
> > > before if block
> > >
> > > Signed-off-by: Archana <craechal@gmail.com>
> > > ---
> >
> > Is Archana your full legal name that you would write on a legal document?
>
> Ah, never mind. Apparently this policy has been updated. Pseudonyms
> are allowed for people concerned about privacy but anonymous
> contributions are not allowed.
>
> https://lore.kernel.org/all/ZAoMxSPKNLoLg7Wl@aschofie-mobl2/
That being said, I still have to ask this same question anyway, so it's
ok to ask this.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] staging: wlan-ng: remove unnecessary kfree statements
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 7:40 ` Greg KH
2023-03-16 11:19 ` Archana
2023-03-16 11:27 ` Archana
1 sibling, 2 replies; 12+ messages in thread
From: Greg KH @ 2023-03-11 7:40 UTC (permalink / raw)
To: Archana; +Cc: drv, linux-staging
On Fri, Mar 10, 2023 at 08:59:16PM +0000, Archana wrote:
> The function uses goto free_result in rest of its implementation.
>
> Signed-off-by: Archana <craechal@gmail.com>
> ---
> drivers/staging/wlan-ng/prism2fw.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
> index 02a2191d5c4d..98ed9bb9192c 100644
> --- a/drivers/staging/wlan-ng/prism2fw.c
> +++ b/drivers/staging/wlan-ng/prism2fw.c
> @@ -1008,12 +1008,11 @@ static int writeimage(struct wlandevice *wlandev, struct imgchunk *fchunk,
> rstmsg = kzalloc(sizeof(*rstmsg), GFP_KERNEL);
> rwrmsg = kzalloc(sizeof(*rwrmsg), GFP_KERNEL);
> if (!rstmsg || !rwrmsg) {
> - kfree(rstmsg);
> - kfree(rwrmsg);
> netdev_err(wlandev->netdev,
> "%s: no memory for firmware download, aborting download\n",
> __func__);
> - return -ENOMEM;
> + result = -ENOMEM;
> + goto free_result;
> }
>
> /* Initialize the messages */
> --
> 2.34.1
>
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- You did not specify a description of why the patch is needed, or
possibly, any description at all, in the email body. Please read the
section entitled "The canonical patch format" in the kernel file,
Documentation/process/submitting-patches.rst for what is needed in
order to properly describe the change.
- It looks like you did not use your "real" name for the patch on either
the Signed-off-by: line, or the From: line (both of which have to
match). Please read the kernel file,
Documentation/process/submitting-patches.rst for how to do this
correctly.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 1/2] staging: wlan-ng: small cleanup in writeimage()
2023-03-11 7:39 ` Greg KH
@ 2023-03-11 12:12 ` Archana
2023-03-11 12:12 ` [PATCH v2 2/2] staging: wlan-ng: small cleanup in plugimage() Archana
2023-03-11 12:37 ` [PATCH v2 1/2] staging: wlan-ng: small cleanup in writeimage() Dan Carpenter
2023-03-11 12:45 ` [PATCH 2/2] staging: wlan-ng: remove else statement Archana
1 sibling, 2 replies; 12+ messages in thread
From: Archana @ 2023-03-11 12:12 UTC (permalink / raw)
To: gregkh, drv, linux-staging, error27; +Cc: Archana
It is cleaner to use "goto free_result;" as is being followed
in rest of the implementation of writeimage function, and
remove unnecessary kfree statements.
Signed-off-by: Archana <craechal@gmail.com>
---
Changes in v2:
- Make the commit message more clearer.
drivers/staging/wlan-ng/prism2fw.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wlan-ng/prism2fw.c b/drivers/staging/wlan-ng/prism2fw.c
index 02a2191d5c4d..98ed9bb9192c 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -1008,12 +1008,11 @@ static int writeimage(struct wlandevice *wlandev, struct imgchunk *fchunk,
rstmsg = kzalloc(sizeof(*rstmsg), GFP_KERNEL);
rwrmsg = kzalloc(sizeof(*rwrmsg), GFP_KERNEL);
if (!rstmsg || !rwrmsg) {
- kfree(rstmsg);
- kfree(rwrmsg);
netdev_err(wlandev->netdev,
"%s: no memory for firmware download, aborting download\n",
__func__);
- return -ENOMEM;
+ result = -ENOMEM;
+ goto free_result;
}
/* Initialize the messages */
--
2.34.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 2/2] staging: wlan-ng: small cleanup in plugimage()
2023-03-11 12:12 ` [PATCH v2 1/2] staging: wlan-ng: small cleanup in writeimage() Archana
@ 2023-03-11 12:12 ` Archana
2023-03-11 12:37 ` [PATCH v2 1/2] staging: wlan-ng: small cleanup in writeimage() Dan Carpenter
1 sibling, 0 replies; 12+ messages in thread
From: Archana @ 2023-03-11 12:12 UTC (permalink / raw)
To: gregkh, drv, linux-staging, error27; +Cc: Archana
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
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2 1/2] staging: wlan-ng: small cleanup in writeimage()
2023-03-11 12:12 ` [PATCH v2 1/2] staging: wlan-ng: small cleanup in writeimage() Archana
2023-03-11 12:12 ` [PATCH v2 2/2] staging: wlan-ng: small cleanup in plugimage() Archana
@ 2023-03-11 12:37 ` Dan Carpenter
1 sibling, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2023-03-11 12:37 UTC (permalink / raw)
To: Archana; +Cc: gregkh, drv, linux-staging
On Sat, Mar 11, 2023 at 12:12:52PM +0000, Archana wrote:
> It is cleaner to use "goto free_result;" as is being followed
> in rest of the implementation of writeimage function, and
> remove unnecessary kfree statements.
>
> Signed-off-by: Archana <craechal@gmail.com>
> ---
> Changes in v2:
> - Make the commit message more clearer.
Thanks. Both look good to me now.
Reviewed-by: Dan Carpenter <error27@gmail.com>
regards,
dan carpenter
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] staging: wlan-ng: remove else statement
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:45 ` Archana
1 sibling, 0 replies; 12+ messages in thread
From: Archana @ 2023-03-11 12:45 UTC (permalink / raw)
To: Greg KH; +Cc: Dan Carpenter, drv, linux-staging
On Sat, Mar 11, 2023 at 08:39:50AM +0100, Greg KH wrote:
> On Sat, Mar 11, 2023 at 07:58:51AM +0300, Dan Carpenter wrote:
> > On Sat, Mar 11, 2023 at 07:34:25AM +0300, Dan Carpenter wrote:
> > > On Fri, Mar 10, 2023 at 08:59:17PM +0000, Archana wrote:
> > > > else block is not needed if j is set to -1
> > > > before if block
> > > >
> > > > Signed-off-by: Archana <craechal@gmail.com>
> > > > ---
> > >
> > > Is Archana your full legal name that you would write on a legal document?
Yes, Archana is my full legal name.
Thank you for your feedbacks.
I have sent revised patch.
Regards,
Archana
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] staging: wlan-ng: remove unnecessary kfree statements
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
1 sibling, 0 replies; 12+ messages in thread
From: Archana @ 2023-03-16 11:19 UTC (permalink / raw)
To: Greg KH; +Cc: drv, linux-staging
Hey,
- I am not sure why i am getting the description error. I had
sent a v2 patch version on which i haven't received this review.
- My real name is Archana.
Can you please guide me on what is required from my end to close this patch?
Thanks,
Archana
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] staging: wlan-ng: remove unnecessary kfree statements
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
1 sibling, 0 replies; 12+ messages in thread
From: Archana @ 2023-03-16 11:27 UTC (permalink / raw)
To: Greg KH; +Cc: drv, linux-staging
Please ignore the previous message.
This patch is closed.
Thanks,
Archana
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2023-03-16 11:27 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v2 2/2] staging: wlan-ng: small cleanup in plugimage() Archana
2023-03-11 12:37 ` [PATCH v2 1/2] staging: wlan-ng: small cleanup in writeimage() 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).