Skip to contentSkip to conversation

drivers/net/wireless/iwlwifi/iwl-3945.c

PATCH In review Darren Jenkins\ 4 participants 4 messages Jul 2, 2008 – Jul 3, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/net/wireless/iwlwifi/iwl-3945.c

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>

drivers/net/wireless/iwlwifi/iwl-3945.c +1 -1
index 62a3d8f..31d38cd 100644
@@ -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 kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw

(Cc'ing linux-wireless)

Quoted 24 lines · Darren Jenkins\

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>

drivers/net/wireless/iwlwifi/iwl-3945.c +1 -1
index 62a3d8f..31d38cd 100644
@@ -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";
Signature · 8 lines
Filippo Zangheri

GPG key ID: 0x6C1F2F2F

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to Darren Jenkins\

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

Quoted 31 lines · Darren Jenkins

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>

drivers/net/wireless/iwlwifi/iwl-3945.c +1 -2
index 62a3d8f..31d38cd 100644
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 6 lines
John W. Linville
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
Quoted 4 lines · John W. Linville

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.

Quoted 18 lines · Darren Jenkins
Quoted 17 lines

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>

drivers/net/wireless/iwlwifi/iwl-3945.c +0 -0
index 62a3d8f..31d38cd 100644
@@ -449,7 +449,7 @@ static void iwl3945_dbg_report_frame(struct iwl3945_priv *priv,
 
Quoted 7 lines

drivers/net/wireless/iwlwifi/iwl-3945.c static void iwl3945_dbg_report_frame(struct iwl3945_priv *priv, · line 455

Quoted 7 lines
drivers/net/wireless/iwlwifi/iwl-3945.c +1 -1
 	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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html