All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: Darren Jenkins <darrenrjenkins@gmail.com>,
	kernel Janitors <kernel-janitors@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	ipw2100-admin@linux.intel.com, reinette.chatre@intel.com
Subject: Re: [PATCH]  drivers/net/wireless/iwlwifi/iwl-3945.c
Date: Thu, 03 Jul 2008 01:51:52 +0000	[thread overview]
Message-ID: <1215049912.14590.525.camel@debian.sh.intel.com> (raw)
In-Reply-To: <20080702192457.GB31288@tuxdriver.com>

On Wed, 2008-07-02 at 15:24 -0400, John W. Linville wrote:
> What about the format line in the IWL_DEBUG_RX that uses rate?
> 
> Also, please use an email subject that is more descriptive than just
> the filename.  You should probably drop the "G'day..." line as well.

Side with John.

> On Wed, Jul 02, 2008 at 11:37:27AM +1000, Darren Jenkins" wrote:
> > G'day people
> > 
> > Coverity CID: 2265 NEGATIVE_RETURNS
> > 
> > "rate" is of an unsigned type, and the code requires a signed type.
> > The following patch makes it so.
> > 
> > Only compile tested.
> > 
> > Signed-off-by: Darren Jenkins <darrenrjenkins@gmailcom>
> > 
> > diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
> > index 62a3d8f..31d38cd 100644
> > --- a/drivers/net/wireless/iwlwifi/iwl-3945.c
> > +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
> > @@ -449,7 +449,7 @@ static void iwl3945_dbg_report_frame(struct iwl3945_priv *priv,
> >  
> >  	if (print_summary) {
> >  		char *title;
> > -		u32 rate;
> > +		int rate;
> >  
> >  		if (hundred)
> >  			title = "100Frames";

The rate variable here takes two roles: one for calculate the index
(singed) and the other for the actual rate (unsigned). I think if you do
want to fix this, create another local variable int idx to hold the
index result.

Thanks,
-yi

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Zhu Yi <yi.zhu@intel.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: Darren Jenkins <darrenrjenkins@gmail.com>,
	kernel Janitors <kernel-janitors@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	ipw2100-admin@linux.intel.com, reinette.chatre@intel.com
Subject: Re: [PATCH]  drivers/net/wireless/iwlwifi/iwl-3945.c
Date: Thu, 03 Jul 2008 09:51:52 +0800	[thread overview]
Message-ID: <1215049912.14590.525.camel@debian.sh.intel.com> (raw)
In-Reply-To: <20080702192457.GB31288@tuxdriver.com>

On Wed, 2008-07-02 at 15:24 -0400, John W. Linville wrote:
> What about the format line in the IWL_DEBUG_RX that uses rate?
> 
> Also, please use an email subject that is more descriptive than just
> the filename.  You should probably drop the "G'day..." line as well.

Side with John.

> On Wed, Jul 02, 2008 at 11:37:27AM +1000, Darren Jenkins" wrote:
> > G'day people
> > 
> > Coverity CID: 2265 NEGATIVE_RETURNS
> > 
> > "rate" is of an unsigned type, and the code requires a signed type.
> > The following patch makes it so.
> > 
> > Only compile tested.
> > 
> > Signed-off-by: Darren Jenkins <darrenrjenkins@gmailcom>
> > 
> > diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
> > index 62a3d8f..31d38cd 100644
> > --- a/drivers/net/wireless/iwlwifi/iwl-3945.c
> > +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
> > @@ -449,7 +449,7 @@ static void iwl3945_dbg_report_frame(struct iwl3945_priv *priv,
> >  
> >  	if (print_summary) {
> >  		char *title;
> > -		u32 rate;
> > +		int rate;
> >  
> >  		if (hundred)
> >  			title = "100Frames";

The rate variable here takes two roles: one for calculate the index
(singed) and the other for the actual rate (unsigned). I think if you do
want to fix this, create another local variable int idx to hold the
index result.

Thanks,
-yi


  reply	other threads:[~2008-07-03  1:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-02  1:37 [PATCH] drivers/net/wireless/iwlwifi/iwl-3945.c Darren Jenkins\
2008-07-02  1:37 ` Darren Jenkins\
2008-07-02 14:25 ` Filippo Zangheri
2008-07-02 14:25   ` Filippo Zangheri
2008-07-02 14:25   ` Filippo Zangheri
2008-07-02 19:24 ` John W. Linville
2008-07-02 19:24   ` John W. Linville
2008-07-03  1:51   ` Zhu Yi [this message]
2008-07-03  1:51     ` Zhu Yi

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=1215049912.14590.525.camel@debian.sh.intel.com \
    --to=yi.zhu@intel.com \
    --cc=darrenrjenkins@gmail.com \
    --cc=ipw2100-admin@linux.intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=reinette.chatre@intel.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.