From: <pkshih@realtek.com>
To: <kvalo@codeaurora.org>
Cc: <yhchuang@realtek.com>, <Larry.Finger@lwfinger.net>,
<johannes.berg@intel.com>, <linux-wireless@vger.kernel.org>
Subject: [PATCH 04/11] rtlwifi: use kcalloc instead of multiply
Date: Fri, 29 Dec 2017 16:31:05 +0800 [thread overview]
Message-ID: <20171229083112.31540-5-pkshih@realtek.com> (raw)
In-Reply-To: <20171229083112.31540-1-pkshih@realtek.com>
From: "Tobin C. Harding" <me@tobin.cc>
This is merged by Ping-Ke Shih from commit 85d309d53f7a ("staging:
rtlwifi: use kcalloc instead of multiply"), and original commit log
is reserved below.
checkpatch emits multiple warnings of type
WARNING:ALLOC_WITH_MULTIPLY: Prefer kcalloc over kzalloc with multiply
Replace two calls to kzalloc() with calls to kcalloc().
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtlwifi/efuse.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/efuse.c b/drivers/net/wireless/realtek/rtlwifi/efuse.c
index ef9acd466cca..35b50be633f1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/efuse.c
+++ b/drivers/net/wireless/realtek/rtlwifi/efuse.c
@@ -257,11 +257,11 @@ void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf)
sizeof(u8), GFP_ATOMIC);
if (!efuse_tbl)
return;
- efuse_word = kzalloc(EFUSE_MAX_WORD_UNIT * sizeof(u16 *), GFP_ATOMIC);
+ efuse_word = kcalloc(EFUSE_MAX_WORD_UNIT, sizeof(u16 *), GFP_ATOMIC);
if (!efuse_word)
goto out;
for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) {
- efuse_word[i] = kzalloc(efuse_max_section * sizeof(u16),
+ efuse_word[i] = kcalloc(efuse_max_section, sizeof(u16),
GFP_ATOMIC);
if (!efuse_word[i])
goto done;
--
2.14.1
next prev parent reply other threads:[~2017-12-29 8:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-29 8:31 [PATCH 00/11] rtlwifi: change rtlwifi maintainer and merge commits from staging pkshih
2017-12-29 8:31 ` [PATCH 01/11] MAINTAINERS: Change maintainer for rtlwifi pkshih
2018-01-08 17:14 ` [01/11] " Kalle Valo
2017-12-29 8:31 ` [PATCH 02/11] rtlwifi: check for array overflow pkshih
2017-12-29 8:31 ` [PATCH 03/11] rtlwifi: fix parenthesis alignment pkshih
2017-12-29 8:31 ` pkshih [this message]
2017-12-29 8:31 ` [PATCH 05/11] rtlwifi: Remove unnecessary 'out of memory' message pkshih
2017-12-29 8:31 ` [PATCH 06/11] rtlwifi: mark expected switch fall-through in rtl_make_smps_action pkshih
2017-12-29 8:31 ` [PATCH 07/11] rtlwifi: Remove unnecessary parentheses pkshih
2017-12-29 8:31 ` [PATCH 08/11] rtlwifi: rtl8723: Add error handling to no existing firmware pkshih
2017-12-29 8:31 ` [PATCH 09/11] rtlwifi: Improve debugging by using debugfs pkshih
2017-12-29 8:31 ` [PATCH 10/11] rtlwifi: btcoex: Use seq_file to dump btcoex status pkshih
2017-12-29 8:31 ` [PATCH 11/11] rtlwifi: fill FW version and subversion pkshih
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=20171229083112.31540-5-pkshih@realtek.com \
--to=pkshih@realtek.com \
--cc=Larry.Finger@lwfinger.net \
--cc=johannes.berg@intel.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=yhchuang@realtek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.