From: Jouni Malinen <j@w1.fi>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org,
Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [PATCH] wireless: remove superfluous if statement in regulatory code
Date: Tue, 23 Jun 2015 21:48:16 +0300 [thread overview]
Message-ID: <20150623184816.GA26319@w1.fi> (raw)
In-Reply-To: <1435083066-6750-1-git-send-email-linville@tuxdriver.com>
On Tue, Jun 23, 2015 at 02:11:06PM -0400, John W. Linville wrote:
> In reg_process_hint, the test of "treatment == REG_REQ_IGNORE ||
> treatment == REG_REQ_ALREADY_SET" is superfluous because the code in the
> if-then branch is identical to the code after the if statement.
This was introduced (or well, left behind) by commit
eeca9fce1d71a4955855ceb0c3b13c1eb9db27c1 ('cfg80211: Schedule timeout
for all CRDA calls'). It could be useful to mention that commit in the
commit message since the resulting code from this new patch looks pretty
strange and that triggered me to take a closer look at what happened
here (looked like this is fine now).
> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
> @@ -2080,9 +2080,6 @@ static void reg_process_hint(struct regulatory_request *reg_request)
> return;
> case NL80211_REGDOM_SET_BY_USER:
> treatment = reg_process_hint_user(reg_request);
> - if (treatment == REG_REQ_IGNORE ||
> - treatment == REG_REQ_ALREADY_SET)
> - return;
> return;
That assignment of 'treatment' is now write-only and you might as well
remove that while cleaning this up. This being the only caller of
reg_process_hint_user(), even more cleanup could be done by removing
return value from there, but I'm not sure whether that would be of
sufficient benefit.
--
Jouni Malinen PGP id EFC895FA
prev parent reply other threads:[~2015-06-23 18:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-23 18:11 [PATCH] wireless: remove superfluous if statement in regulatory code John W. Linville
2015-06-23 18:48 ` Jouni Malinen [this message]
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=20150623184816.GA26319@w1.fi \
--to=j@w1.fi \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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 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).