Thread (3 messages) 3 messages, 2 authors, 2024-08-26

Re: [PATCH v1] pinctrl: nomadik: Use kmemdup_array instead of kmemdup for multiple allocation

From: 于佼良 <hidden>
Date: 2024-08-26 07:42:21
Also in: linux-gpio, lkml

在 2024/8/23 23:27, Andy Shevchenko 写道:
[Some people who received this message don't often get email from andriy.shevchenko@intel.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

On Wed, Aug 21, 2024 at 02:49:58PM +0800, Yu Jiaoliang wrote:
quoted
Let the kememdup_array() take care about multiplication and possible
kmemdup_array()
quoted
overflows.
...
quoted
+     dup_configs = kmemdup_array(configs, num_configs, sizeof(*dup_configs),
+                                 GFP_KERNEL);
I would even make this a single line.

...
quoted
+     dup_configs = kmemdup_array(configs, num_configs, sizeof(*dup_configs),
+                                 GFP_KERNEL);
Ditto.

--
With Best Regards,
Andy Shevchenko
Hi Andy,

I have reformatted the code and submitted patch v2. Thank you.

Best Regards,

Yu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help