From: Luca Coelho <luca@coelho.fi>
To: linux-wireless@vger.kernel.org
Cc: kvalo@codeaurora.org, Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 2/7] iwlwifi: mvm: use ssize_t for len in iwl_debugfs_mem_read()
Date: Wed, 19 Oct 2016 10:27:21 +0300 [thread overview]
Message-ID: <20161019072726.22018-3-luca@coelho.fi> (raw)
In-Reply-To: <20161019072726.22018-1-luca@coelho.fi>
From: Luca Coelho <luciano.coelho@intel.com>
In iwl_dbgfs_mem_read(), the len variable may become negative and is
compared to < 0 (an error case). Comparing size_t (which is unsigned)
to < 0 causes a warning on certain platforms (like i386):
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c:1561:5-8: WARNING: Unsigned expression compared with zero: len < 0
To prevent that, use ssize_t for len instead.
Fixes: commit 2b55f43f8e47 ("iwlwifi: mvm: Add mem debugfs entry")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 539d718..06805a6 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -1529,8 +1529,8 @@ static ssize_t iwl_dbgfs_mem_read(struct file *file, char __user *user_buf,
.data = { &cmd, },
.len = { sizeof(cmd) },
};
- size_t delta, len;
- ssize_t ret;
+ size_t delta;
+ ssize_t ret, len;
hcmd.id = iwl_cmd_id(*ppos >> 24 ? UMAC_RD_WR : LMAC_RD_WR,
DEBUG_GROUP, 0);
--
2.9.3
next prev parent reply other threads:[~2016-10-19 14:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-19 7:27 [PATCH 0/7] iwlwifi: updates intended for v4.9 2016-10-19 Luca Coelho
2016-10-19 7:27 ` [PATCH 1/7] iwlwifi: pcie: mark command queue lock with separate lockdep class Luca Coelho
2016-10-19 7:27 ` Luca Coelho [this message]
2016-10-19 7:27 ` [PATCH 3/7] iwlwifi: mvm: fix d3_test with unified D0/D3 images Luca Coelho
2016-10-19 7:27 ` [PATCH 4/7] iwlwifi: mvm: comply with fw_restart mod param on suspend Luca Coelho
2016-10-19 7:27 ` [PATCH 5/7] iwlwifi: mvm: wake the wait queue when the RX sync counter is zero Luca Coelho
2016-10-19 7:27 ` [PATCH 6/7] iwlwifi: pcie: fix SPLC structure parsing Luca Coelho
2016-10-19 7:27 ` [PATCH 7/7] iwlwifi: mvm: fix netdetect starting/stopping for unified images Luca Coelho
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=20161019072726.22018-3-luca@coelho.fi \
--to=luca@coelho.fi \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luciano.coelho@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