public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]  drivers/net/wireless/iwlwifi/iwl-3945.c
@ 2008-07-02  1:37 Darren Jenkins\
  2008-07-02 14:25 ` Filippo Zangheri
  2008-07-02 19:24 ` John W. Linville
  0 siblings, 2 replies; 4+ messages in thread
From: Darren Jenkins\ @ 2008-07-02  1:37 UTC (permalink / raw)
  To: kernel Janitors, LKML; +Cc: ipw2100-admin, yi.zhu, reinette.chatre

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



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

* Re: [PATCH]  drivers/net/wireless/iwlwifi/iwl-3945.c
  2008-07-02  1:37 [PATCH] drivers/net/wireless/iwlwifi/iwl-3945.c Darren Jenkins\
@ 2008-07-02 14:25 ` Filippo Zangheri
  2008-07-02 19:24 ` John W. Linville
  1 sibling, 0 replies; 4+ messages in thread
From: Filippo Zangheri @ 2008-07-02 14:25 UTC (permalink / raw)
  To: Darren Jenkins
  Cc: kernel Janitors, LKML, ipw2100-admin, yi.zhu, reinette.chatre,
	linux-wireless

(Cc'ing linux-wireless)

On 02/07/2008 03:37, 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";

-- 
Filippo Zangheri

GPG key ID: 0x6C1F2F2F


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

* Re: [PATCH]  drivers/net/wireless/iwlwifi/iwl-3945.c
  2008-07-02  1:37 [PATCH] drivers/net/wireless/iwlwifi/iwl-3945.c Darren Jenkins\
  2008-07-02 14:25 ` Filippo Zangheri
@ 2008-07-02 19:24 ` John W. Linville
  2008-07-03  1:51   ` Zhu Yi
  1 sibling, 1 reply; 4+ messages in thread
From: John W. Linville @ 2008-07-02 19:24 UTC (permalink / raw)
  To: Darren Jenkins
  Cc: kernel Janitors, LKML, ipw2100-admin, yi.zhu, reinette.chatre

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.

Thanks!

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";
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
John W. Linville
linville@tuxdriver.com

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

* Re: [PATCH]  drivers/net/wireless/iwlwifi/iwl-3945.c
  2008-07-02 19:24 ` John W. Linville
@ 2008-07-03  1:51   ` Zhu Yi
  0 siblings, 0 replies; 4+ messages in thread
From: Zhu Yi @ 2008-07-03  1:51 UTC (permalink / raw)
  To: John W. Linville
  Cc: Darren Jenkins, kernel Janitors, LKML, ipw2100-admin,
	reinette.chatre

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


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

end of thread, other threads:[~2008-07-03  7:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-02  1:37 [PATCH] drivers/net/wireless/iwlwifi/iwl-3945.c Darren Jenkins\
2008-07-02 14:25 ` Filippo Zangheri
2008-07-02 19:24 ` John W. Linville
2008-07-03  1:51   ` Zhu Yi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox