public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: "Darren Jenkins\\" <darrenrjenkins@gmail.com>
Cc: linville@tuxdriver.com, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org, ipw2100-admin@linux.intel.com
Subject: Re: [PATCH] drivers/net/wireless/iwlwifi/iwl-3945.c Fix type issue on 64bit
Date: Fri, 04 Jul 2008 08:47:25 +0800	[thread overview]
Message-ID: <1215132445.14590.586.camel@debian.sh.intel.com> (raw)
In-Reply-To: <1215042098.8635.14.camel@localhost.localdomain>

On Thu, 2008-07-03 at 09:41 +1000, Darren Jenkins\ wrote:
> >> What about the format line in the IWL_DEBUG_RX that uses rate?
> 
> I had figured that as rate was only positive it would work as is.
> However you are dead right, there is no point in a patch removing one
> example of bad programming only to introduce another.
> 
> Here is the updated patch:
> 
> 
> Coverity CID: 2265 NEGATIVE_RETURNS
> 
> "rate" is of an unsigned type, and the code requires a signed type.
> The following patch makes it so.
> 
> Signed-off-by: Darren Jenkins <darrenrjenkins@gmailcom>

NACK. See my early post. "rate" should be u8. You just need another int
index here.

Thanks,
-yi

> diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
> index 62a3d8f..d97c025 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";
> @@ -487,7 +487,7 @@ static void iwl3945_dbg_report_frame(struct iwl3945_priv *priv,
>  		 *    but you can hack it to show more, if you'd like to. */
>  		if (dataframe)
>  			IWL_DEBUG_RX("%s: mhd=0x%04x, dst=0x%02x, "
> -				     "len=%u, rssi=%d, chnl=%d, rate=%u, \n",
> +				     "len=%u, rssi=%d, chnl=%d, rate=%d, \n",
>  				     title, fc, header->addr1[5],
>  				     length, rssi, channel, rate);
>  		else {
> 


      reply	other threads:[~2008-07-04  0:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-02 23:41 [PATCH] drivers/net/wireless/iwlwifi/iwl-3945.c Fix type issue on 64bit Darren Jenkins\
2008-07-04  0:47 ` Zhu Yi [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=1215132445.14590.586.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 \
    /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