From: SF Markus Elfring <elfring@users.sourceforge.net>
To: patches@opensource.wolfsonmicro.com,
Chanwoo Choi <cw00.choi@samsung.com>,
Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/3] extcon: Use devm_kcalloc() in extcon_dev_register()
Date: Mon, 24 Apr 2017 12:40:07 +0000 [thread overview]
Message-ID: <309234f0-ce27-0db7-dc70-802b59b1cc88@users.sourceforge.net> (raw)
In-Reply-To: <b650292b-4f5f-c50d-f0a3-604ba26bcbef@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 23 Apr 2017 20:54:11 +0200
A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "devm_kcalloc".
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/extcon/extcon.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
index f422a78ba342..acb847bc1619 100644
--- a/drivers/extcon/extcon.c
+++ b/drivers/extcon/extcon.c
@@ -1252,9 +1252,8 @@ int extcon_dev_register(struct extcon_dev *edev)
}
spin_lock_init(&edev->lock);
-
- edev->nh = devm_kzalloc(&edev->dev,
- sizeof(*edev->nh) * edev->max_supported, GFP_KERNEL);
+ edev->nh = devm_kcalloc(&edev->dev, edev->max_supported,
+ sizeof(*edev->nh), GFP_KERNEL);
if (!edev->nh) {
ret = -ENOMEM;
goto err_dev;
--
2.12.2
next prev parent reply other threads:[~2017-04-24 12:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170424123857epcas2p24390d04885c9fc4c1980838ed8a4db06@epcas2p2.samsung.com>
2017-04-24 12:38 ` [PATCH 0/3] Extcon: Fine-tuning for three functions SF Markus Elfring
2017-04-24 12:40 ` SF Markus Elfring [this message]
2017-04-24 12:41 ` [PATCH 2/3] extcon: Fix a typo in three comment lines SF Markus Elfring
2017-04-24 12:43 ` [PATCH 3/3] extcon: arizona: Use devm_kcalloc() in arizona_extcon_get_micd_configs() SF Markus Elfring
2017-04-24 12:59 ` Charles Keepax
2017-04-24 13:34 ` SF Markus Elfring
2017-04-26 8:01 ` Charles Keepax
2017-05-23 9:34 ` [PATCH 0/3] Extcon: Fine-tuning for three functions Chanwoo Choi
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=309234f0-ce27-0db7-dc70-802b59b1cc88@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=cw00.choi@samsung.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=patches@opensource.wolfsonmicro.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