public inbox for [email protected]
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <[email protected]>
To: Dan Carpenter <[email protected]>
Cc: [email protected], [email protected],
	[email protected],
	Ammar Faizi <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>
Subject: Re: [ammarfaizi2-block:paulmck/linux-rcu/dev.2023.01.19a 55/61] kernel/rcu/rcutorture.c:3548 rcu_torture_init_srcu_lockdep() warn: for statement not indented
Date: Wed, 25 Jan 2023 06:56:55 -0800	[thread overview]
Message-ID: <20230125145655.GF2948950@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <Y9DpFTItKK8NkFR0@kadam>

On Wed, Jan 25, 2023 at 11:32:21AM +0300, Dan Carpenter wrote:
> On Wed, Jan 25, 2023 at 11:10:58AM +0300, Dan Carpenter wrote:
> > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c:1265 rtl8188fu_phy_iq_calibrate() warn: re-using outside iterator: 'i'
> > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c:1168 rtl8723bu_phy_iq_calibrate() warn: re-using outside iterator: 'i'
> > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c:3298 rtl8xxxu_gen1_phy_iq_calibrate() warn: re-using outside iterator: 'i'
> > drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c:1989 rtl88e_phy_iq_calibrate() warn: re-using outside iterator: 'i'
> > drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c:1429 rtl92c_phy_iq_calibrate() warn: re-using outside iterator: 'i'
> > drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c:2294 rtl92d_phy_iq_calibrate() warn: re-using outside iterator: 'i'
> > drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c:1393 rtl8723e_phy_iq_calibrate() warn: re-using outside iterator: 'i'
> > drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c:2321 rtl8723be_phy_iq_calibrate() warn: re-using outside iterator: 'i'
> 
> These are all "false positives" (kind of).  It's 8 copies of code which
> does:
> 
> 	for (i = 0; i < 3; i++) {
> 		...
> 		if (i == 2) {
> 			for (i = 0; i < 8; i++)
> 				foo = bar[i];
> 		}
> 	}
> 
> So the loop exits with i == 8 instead of i == 3 but that doesn't matter.
> Ugh...  Did the original author do this deliberately or did it just work
> by chance?  I really prefer buggy code to code to ugly code.  With buggy
> code it's a technical matter and easy to fix, but with ugly code that's
> like a big debate and a social problem...
> 
> On the other hand, in this case, I don't think anyone is going to defend
> the original style from these drivers so I may as well patch it.

Looks suspicious to me!  ;-)

							Thanx, Paul

  parent reply	other threads:[~2023-01-25 14:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-24  9:32 [ammarfaizi2-block:paulmck/linux-rcu/dev.2023.01.19a 55/61] kernel/rcu/rcutorture.c:3548 rcu_torture_init_srcu_lockdep() warn: for statement not indented Dan Carpenter
2023-01-24 10:05 ` Dan Carpenter
2023-01-25  8:10   ` Dan Carpenter
2023-01-25  8:32     ` Dan Carpenter
2023-01-25  8:45       ` Ammar Faizi
2023-01-25 14:56       ` Paul E. McKenney [this message]
2023-01-24 14:51 ` Paul E. McKenney

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=20230125145655.GF2948950@paulmck-ThinkPad-P17-Gen-1 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox