From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-gpio@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Gary Bisson <gary.bisson@boundarydevices.com>,
Laxman Dewangan <ldewangan@nvidia.com>,
Linus Walleij <linus.walleij@linaro.org>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
Peng Fan <van.freenix@gmail.com>, Shawn Guo <shawnguo@kernel.org>,
Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 04/10] pinctrl: imx: Improve another size determination in imx_pinctrl_parse_functions()
Date: Fri, 14 Apr 2017 11:14:13 +0200 [thread overview]
Message-ID: <d9923862-efac-949d-9915-de19d3f13fa5@users.sourceforge.net> (raw)
In-Reply-To: <59fae4ac-9e07-232a-4843-92dd9e0cf2ef@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 13 Apr 2017 15:20:43 +0200
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/pinctrl/freescale/pinctrl-imx.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index f835e8210ace..44dbf6e38d79 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -590,9 +590,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
for_each_child_of_node(np, child) {
func->group_names[i] = child->name;
-
- grp = devm_kzalloc(info->dev, sizeof(struct group_desc),
- GFP_KERNEL);
+ grp = devm_kzalloc(info->dev, sizeof(*grp), GFP_KERNEL);
if (!grp)
return -ENOMEM;
--
2.12.2
next prev parent reply other threads:[~2017-04-14 9:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-14 9:00 [PATCH 00/10] pinctrl: freescale: Fine-tuning for ten function implementations SF Markus Elfring
2017-04-14 9:03 ` [PATCH 1/10] pinctrl: imx: Use kmalloc_array() in imx_dt_node_to_map() SF Markus Elfring
2017-04-14 9:07 ` [PATCH 02/10] pinctrl: imx: Use devm_kcalloc() in two functions SF Markus Elfring
2017-04-14 9:11 ` [PATCH 03/10] pinctrl: imx: Return directly after a failed devm_kcalloc() in imx_pinctrl_parse_functions() SF Markus Elfring
2017-04-14 9:14 ` SF Markus Elfring [this message]
2017-04-14 9:15 ` [PATCH 05/10] pinctrl: imx: Use devm_kmalloc_array() in imx_pinctrl_probe() SF Markus Elfring
2017-04-14 9:17 ` [PATCH 06/10] pinctrl: imx: Use seq_putc() in imx_pinconf_group_dbg_show() SF Markus Elfring
2017-04-14 9:19 ` [PATCH 07/10] pinctrl: imx: Use seq_puts() in imx_pinconf_dbg_show() SF Markus Elfring
2017-04-14 9:20 ` [PATCH 08/10] pinctrl: imx1-core: Use kmalloc_array() in imx_dt_node_to_map() SF Markus Elfring
2017-04-14 9:22 ` [PATCH 09/10] pinctrl: mxs: Use devm_kcalloc() in two functions SF Markus Elfring
2017-04-14 9:23 ` [PATCH 10/10] pinctrl: mxs: Use kcalloc() in mxs_dt_node_to_map() SF Markus Elfring
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=d9923862-efac-949d-9915-de19d3f13fa5@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=arnd@arndb.de \
--cc=gary.bisson@boundarydevices.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=ldewangan@nvidia.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=shawnguo@kernel.org \
--cc=van.freenix@gmail.com \
--cc=vladimir_zapolskiy@mentor.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;
as well as URLs for NNTP newsgroup(s).