public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/net/wireless/iwlwifi/iwl-3945.c Fix type issue on 64bit
@ 2008-07-02 23:41 Darren Jenkins\
  2008-07-04  0:47 ` Zhu Yi
  0 siblings, 1 reply; 2+ messages in thread
From: Darren Jenkins\ @ 2008-07-02 23:41 UTC (permalink / raw)
  To: linville; +Cc: kernel-janitors, linux-kernel, ipw2100-admin, yi.zhu

>> 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>

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 {



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers/net/wireless/iwlwifi/iwl-3945.c Fix type issue on 64bit
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Zhu Yi @ 2008-07-04  0:47 UTC (permalink / raw)
  To: Darren Jenkins\; +Cc: linville, kernel-janitors, linux-kernel, ipw2100-admin

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 {
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-04  0:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox