From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Dan Carpenter <error27@gmail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
Matthieu CASTET <castet.matthieu@free.fr>,
linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] airo: remove pointless check
Date: Fri, 10 Sep 2010 15:34:03 +0200 [thread overview]
Message-ID: <20100910133401.GF2398@redhat.com> (raw)
In-Reply-To: <20100910115714.GE5959@bicker>
On Fri, Sep 10, 2010 at 01:57:14PM +0200, Dan Carpenter wrote:
> It doesn't make sense to check "!ai->config.rates" here.
> "ai->config.rates" is the address of an eight bytes array and it
> can't ever be null here. Also if it were NULL then trying to set:
> ai->config.rates[i] = basic_rate | 0x80;
> would cause an oops.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
> index 1d05445..d806497 100644
> --- a/drivers/net/wireless/airo.c
> +++ b/drivers/net/wireless/airo.c
> @@ -3886,8 +3886,7 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
> }
> if ( basic_rate > 0 ) {
> for( i = 0; i < 8; i++ ) {
> - if ( ai->config.rates[i] == basic_rate ||
> - !ai->config.rates ) {
> + if (ai->config.rates[i] == basic_rate) {
> ai->config.rates[i] = basic_rate | 0x80;
> break;
> }
I think code author wonted to do "!ai->config.rates[i], what mean "if
rate is invalid use basic rate".
I'm not sure if basic_rate module parameter is used by anyone. It's not
described, seems it was created for development purpose. I think we can
remove it ...
Stanislaw
next prev parent reply other threads:[~2010-09-10 13:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-10 11:57 [patch] airo: remove pointless check Dan Carpenter
2010-09-10 13:34 ` Stanislaw Gruszka [this message]
2010-09-11 23:48 ` [patch v2] airo: remove "basic_rate" module option Dan Carpenter
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=20100910133401.GF2398@redhat.com \
--to=sgruszka@redhat.com \
--cc=castet.matthieu@free.fr \
--cc=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--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).