public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darren Jenkins\\" <darrenrjenkins@gmail.com>
To: linville@tuxdriver.com
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	ipw2100-admin@linux.intel.com, yi.zhu@intel.com
Subject: [PATCH] drivers/net/wireless/iwlwifi/iwl-3945.c Fix type issue on 64bit
Date: Thu, 03 Jul 2008 09:41:38 +1000	[thread overview]
Message-ID: <1215042098.8635.14.camel@localhost.localdomain> (raw)

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



             reply	other threads:[~2008-07-03 11:58 UTC|newest]

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

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=1215042098.8635.14.camel@localhost.localdomain \
    --to=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 \
    --cc=yi.zhu@intel.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