Re: [PATCH] drivers/net/wireless/iwlwifi/iwl-3945.c

Previous thread: [resend][PATCH] fix lru_cache_add_active_or_unevictable by KOSAKI Motohiro on Wednesday, July 2, 2008 - 6:19 am. (1 message)

Next thread: [PATCH] KVM: SVM: fix suspend/resume support by Joerg Roedel on Wednesday, July 2, 2008 - 7:02 am. (2 messages)
From: Darren Jenkins\
Date: Tuesday, July 1, 2008 - 6:37 pm

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


--

From: Filippo Zangheri
Date: Wednesday, July 2, 2008 - 7:25 am

(Cc'ing linux-wireless)


-- 
Filippo Zangheri

GPG key ID: 0x6C1F2F2F

--

From: John W. Linville
Date: Wednesday, July 2, 2008 - 12:24 pm

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


-- 
John W. Linville
linville@tuxdriver.com
--

From: Zhu Yi
Date: Wednesday, July 2, 2008 - 6:51 pm

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

--

Previous thread: [resend][PATCH] fix lru_cache_add_active_or_unevictable by KOSAKI Motohiro on Wednesday, July 2, 2008 - 6:19 am. (1 message)

Next thread: [PATCH] KVM: SVM: fix suspend/resume support by Joerg Roedel on Wednesday, July 2, 2008 - 7:02 am. (2 messages)