From: Raag Jadav <raag.jadav@intel.com>
To: gregkh@linuxfoundation.org, linus.walleij@linaro.org,
mika.westerberg@linux.intel.com,
andriy.shevchenko@linux.intel.com, dmitry.torokhov@gmail.com,
broonie@kernel.org, pierre-louis.bossart@linux.dev
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-input@vger.kernel.org, linux-sound@vger.kernel.org,
Raag Jadav <raag.jadav@intel.com>
Subject: [PATCH v2 4/6] pinctrl: pxa2xx: use devm_kmemdup_array()
Date: Tue, 26 Nov 2024 22:52:38 +0530 [thread overview]
Message-ID: <20241126172240.6044-5-raag.jadav@intel.com> (raw)
In-Reply-To: <20241126172240.6044-1-raag.jadav@intel.com>
Convert to use devm_kmemdup_array() which is more robust.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
drivers/pinctrl/pxa/pinctrl-pxa2xx.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/pxa/pinctrl-pxa2xx.c b/drivers/pinctrl/pxa/pinctrl-pxa2xx.c
index 9e34b92ff5f2..9fd7a8fb2bc4 100644
--- a/drivers/pinctrl/pxa/pinctrl-pxa2xx.c
+++ b/drivers/pinctrl/pxa/pinctrl-pxa2xx.c
@@ -281,9 +281,8 @@ static int pxa2xx_build_functions(struct pxa_pinctrl *pctl)
for (df = pctl->ppins[i].functions; df->name; df++)
if (!pxa2xx_find_function(pctl, df->name, functions))
(functions + pctl->nfuncs++)->name = df->name;
- pctl->functions = devm_kmemdup(pctl->dev, functions,
- pctl->nfuncs * sizeof(*functions),
- GFP_KERNEL);
+ pctl->functions = devm_kmemdup_array(pctl->dev, functions, pctl->nfuncs,
+ sizeof(*functions), GFP_KERNEL);
if (!pctl->functions)
return -ENOMEM;
@@ -314,7 +313,8 @@ static int pxa2xx_build_groups(struct pxa_pinctrl *pctl)
pctl->ppins[j].pin.name;
func = pctl->functions + i;
func->ngroups = ngroups;
- func->groups = devm_kmemdup(pctl->dev, gtmp, ngroups * sizeof(*gtmp), GFP_KERNEL);
+ func->groups = devm_kmemdup_array(pctl->dev, gtmp, ngroups,
+ sizeof(*gtmp), GFP_KERNEL);
if (!func->groups)
return -ENOMEM;
}
--
2.35.3
next prev parent reply other threads:[~2024-11-26 17:22 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-26 17:22 [PATCH v2 0/6] Introduce devm_kmemdup_array() helper Raag Jadav
2024-11-26 17:22 ` [PATCH v2 1/6] devres: Introduce devm_kmemdup_array() Raag Jadav
2024-11-27 1:36 ` Dmitry Torokhov
2024-11-26 17:22 ` [PATCH v2 2/6] pinctrl: intel: copy communities using devm_kmemdup_array() Raag Jadav
2024-11-26 22:37 ` Andy Shevchenko
2024-11-26 17:22 ` [PATCH v2 3/6] pinctrl: tangier: use devm_kmemdup_array() Raag Jadav
2024-11-26 22:38 ` Andy Shevchenko
2024-11-26 17:22 ` Raag Jadav [this message]
2024-11-26 17:22 ` [PATCH v2 5/6] input: sparse-keymap: " Raag Jadav
2024-11-27 1:36 ` Dmitry Torokhov
2024-11-26 17:22 ` [PATCH v2 6/6] ASoC: Intel: avs: " Raag Jadav
2024-11-27 8:30 ` Amadeusz Sławiński
2024-11-26 22:40 ` [PATCH v2 0/6] Introduce devm_kmemdup_array() helper Andy Shevchenko
2024-11-27 1:37 ` Dmitry Torokhov
2024-11-29 10:17 ` Linus Walleij
2024-11-29 14:20 ` Andy Shevchenko
2024-12-07 14:46 ` Raag Jadav
2024-12-12 14:32 ` Andy Shevchenko
2024-12-12 14:39 ` Greg KH
2024-12-12 16:25 ` Andy Shevchenko
2025-01-16 14:50 ` Andy Shevchenko
2025-01-17 15:00 ` Raag Jadav
2025-01-20 17:07 ` Andy Shevchenko
2025-01-20 17:11 ` Andy Shevchenko
2025-01-21 6:05 ` Raag Jadav
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=20241126172240.6044-5-raag.jadav@intel.com \
--to=raag.jadav@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
/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