From: Supriya Karanth <iskaranth@gmail.com>
To: Larry Finger <Larry.Finger@lwfinger.net>, julia.lawall@lip6.fr
Cc: outreachy-kernel@googlegroups.com, Jes.Sorensen@redhat.com
Subject: Re: [PATCH] staging: rtl8723au: Remove dead code
Date: Fri, 13 Mar 2015 12:57:30 +0900 [thread overview]
Message-ID: <20150313035724.GA6885@gmail.com> (raw)
In-Reply-To: <5501C474.4010905@lwfinger.net>
On Thu, Mar 12, 2015 at 11:53:08AM -0500, Larry Finger wrote:
> On 03/12/2015 06:10 AM, Supriya Karanth wrote:
> >This dead code was detected by coccinelle while using --debug
> >option
> >diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
> >index 0e0f73c..db4f235 100644
> >--- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
> >+++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
> >@@ -1619,7 +1619,6 @@ OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
> > } else {
> > break;
> > }
> >- p = p + p[1] + 2;
> > }
> > }
> >
>
> Like most of this driver, the code is ugly, but I think this is a coccinelle
> bug, not dead code.
I checked it myself and thought coccinelle was right
>
> The statement that you are removing is at the end of a for loop. On the next
> pass through the loop, and there will be a next pass, the first statement is
> "left = end - p;"; therefore, the incrementation of p is not useless code.
>
I was under the impression that the line "p = p + p[1] + 2;" will never
execute.
The for loop is in this form:
for (;;) {
if (p) {
if (...) {
...
}
break;
} else {
break;
}
p = p ....
}
There is a "break" in both the if and else condition which will break out
of the for loop. I think the line "p = p + p[1] + 2;" is important but,
I think it never gets executed. Perhaps I am wrong and I am missing something.
> Have you tested your change? I would guess not. I think it would lead to an
> infinite loop.
I am sorry but no I haven't tested it as I do not have the Hardware. I have
tested the code format though and the line doesn't get executed.
>
> The recent spate of untested patches generated by uncritical usage of
> various tools is quite tiresome!!
I understand. I am very sorry to have wasted your time.
>
> NACK
>
> Larry
>
>
next prev parent reply other threads:[~2015-03-13 3:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-12 11:10 [PATCH] staging: rtl8723au: Remove dead code Supriya Karanth
[not found] ` <5501C474.4010905@lwfinger.net>
2015-03-13 3:57 ` Supriya Karanth [this message]
2015-03-13 7:07 ` [Outreachy kernel] " Julia Lawall
2015-03-13 7:43 ` Julia Lawall
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=20150313035724.GA6885@gmail.com \
--to=iskaranth@gmail.com \
--cc=Jes.Sorensen@redhat.com \
--cc=Larry.Finger@lwfinger.net \
--cc=julia.lawall@lip6.fr \
--cc=outreachy-kernel@googlegroups.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.