* [PATCH] platform/mellanox: Use 2-factor allocator calls
@ 2018-07-04 17:29 Kees Cook
2018-07-04 19:39 ` Vadim Pasternak
0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2018-07-04 17:29 UTC (permalink / raw)
To: Darren Hart
Cc: Vadim Pasternak, Andy Shevchenko, platform-driver-x86, linux-kernel
As already done treewide, switch from open-coded multiplication to using
2-factor allocation helpers.
Signed-off-by: Kees Cook <keescook@chromium.org>
---
drivers/platform/mellanox/mlxreg-io.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/mellanox/mlxreg-io.c b/drivers/platform/mellanox/mlxreg-io.c
index c192dfe6bd65..acfaf64ffde6 100644
--- a/drivers/platform/mellanox/mlxreg-io.c
+++ b/drivers/platform/mellanox/mlxreg-io.c
@@ -152,8 +152,8 @@ static int mlxreg_io_attr_init(struct mlxreg_io_priv_data *priv)
{
int i;
- priv->group.attrs = devm_kzalloc(&priv->pdev->dev,
- priv->pdata->counter *
+ priv->group.attrs = devm_kcalloc(&priv->pdev->dev,
+ priv->pdata->counter,
sizeof(struct attribute *),
GFP_KERNEL);
if (!priv->group.attrs)
--
2.17.1
--
Kees Cook
Pixel Security
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [PATCH] platform/mellanox: Use 2-factor allocator calls
2018-07-04 17:29 [PATCH] platform/mellanox: Use 2-factor allocator calls Kees Cook
@ 2018-07-04 19:39 ` Vadim Pasternak
0 siblings, 0 replies; 5+ messages in thread
From: Vadim Pasternak @ 2018-07-04 19:39 UTC (permalink / raw)
To: Kees Cook, Darren Hart; +Cc: Andy Shevchenko, platform-driver-x86, linux-kernel
> -----Original Message-----
> From: Kees Cook [mailto:keescook@chromium.org]
> Sent: Wednesday, July 04, 2018 8:29 PM
> To: Darren Hart <dvhart@infradead.org>
> Cc: Vadim Pasternak <vadimp@mellanox.com>; Andy Shevchenko
> <andy@infradead.org>; platform-driver-x86@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: [PATCH] platform/mellanox: Use 2-factor allocator calls
>
> As already done treewide, switch from open-coded multiplication to using 2-
> factor allocation helpers.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Vadim Pasternak <vadimp@mellanox.com>
> ---
> drivers/platform/mellanox/mlxreg-io.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/mellanox/mlxreg-io.c
> b/drivers/platform/mellanox/mlxreg-io.c
> index c192dfe6bd65..acfaf64ffde6 100644
> --- a/drivers/platform/mellanox/mlxreg-io.c
> +++ b/drivers/platform/mellanox/mlxreg-io.c
> @@ -152,8 +152,8 @@ static int mlxreg_io_attr_init(struct mlxreg_io_priv_data
> *priv) {
> int i;
>
> - priv->group.attrs = devm_kzalloc(&priv->pdev->dev,
> - priv->pdata->counter *
> + priv->group.attrs = devm_kcalloc(&priv->pdev->dev,
> + priv->pdata->counter,
> sizeof(struct attribute *),
> GFP_KERNEL);
> if (!priv->group.attrs)
> --
> 2.17.1
>
>
> --
> Kees Cook
> Pixel Security
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] platform/mellanox: Use 2-factor allocator calls
@ 2018-07-04 19:39 ` Vadim Pasternak
0 siblings, 0 replies; 5+ messages in thread
From: Vadim Pasternak @ 2018-07-04 19:39 UTC (permalink / raw)
To: Kees Cook, Darren Hart; +Cc: Andy Shevchenko, platform-driver-x86, linux-kernel
> -----Original Message-----
> From: Kees Cook [mailto:keescook@chromium.org]
> Sent: Wednesday, July 04, 2018 8:29 PM
> To: Darren Hart <dvhart@infradead.org>
> Cc: Vadim Pasternak <vadimp@mellanox.com>; Andy Shevchenko
> <andy@infradead.org>; platform-driver-x86@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: [PATCH] platform/mellanox: Use 2-factor allocator calls
>
> As already done treewide, switch from open-coded multiplication to using 2-
> factor allocation helpers.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Vadim Pasternak <vadimp@mellanox.com>
> ---
> drivers/platform/mellanox/mlxreg-io.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/mellanox/mlxreg-io.c
> b/drivers/platform/mellanox/mlxreg-io.c
> index c192dfe6bd65..acfaf64ffde6 100644
> --- a/drivers/platform/mellanox/mlxreg-io.c
> +++ b/drivers/platform/mellanox/mlxreg-io.c
> @@ -152,8 +152,8 @@ static int mlxreg_io_attr_init(struct mlxreg_io_priv_data
> *priv) {
> int i;
>
> - priv->group.attrs = devm_kzalloc(&priv->pdev->dev,
> - priv->pdata->counter *
> + priv->group.attrs = devm_kcalloc(&priv->pdev->dev,
> + priv->pdata->counter,
> sizeof(struct attribute *),
> GFP_KERNEL);
> if (!priv->group.attrs)
> --
> 2.17.1
>
>
> --
> Kees Cook
> Pixel Security
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/mellanox: Use 2-factor allocator calls
2018-07-04 19:39 ` Vadim Pasternak
@ 2018-07-13 14:19 ` Andy Shevchenko
-1 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2018-07-13 14:19 UTC (permalink / raw)
To: Vadim Pasternak
Cc: Kees Cook, Darren Hart, Andy Shevchenko, platform-driver-x86,
linux-kernel
On Wed, Jul 4, 2018 at 10:39 PM, Vadim Pasternak <vadimp@mellanox.com> wrote:
>
>
>> -----Original Message-----
>> From: Kees Cook [mailto:keescook@chromium.org]
>> Sent: Wednesday, July 04, 2018 8:29 PM
>> To: Darren Hart <dvhart@infradead.org>
>> Cc: Vadim Pasternak <vadimp@mellanox.com>; Andy Shevchenko
>> <andy@infradead.org>; platform-driver-x86@vger.kernel.org; linux-
>> kernel@vger.kernel.org
>> Subject: [PATCH] platform/mellanox: Use 2-factor allocator calls
>>
>> As already done treewide, switch from open-coded multiplication to using 2-
>> factor allocation helpers.
>>
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>
Pushed to my review and testing queue, thanks!
> Acked-by: Vadim Pasternak <vadimp@mellanox.com>
>
>> ---
>> drivers/platform/mellanox/mlxreg-io.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/platform/mellanox/mlxreg-io.c
>> b/drivers/platform/mellanox/mlxreg-io.c
>> index c192dfe6bd65..acfaf64ffde6 100644
>> --- a/drivers/platform/mellanox/mlxreg-io.c
>> +++ b/drivers/platform/mellanox/mlxreg-io.c
>> @@ -152,8 +152,8 @@ static int mlxreg_io_attr_init(struct mlxreg_io_priv_data
>> *priv) {
>> int i;
>>
>> - priv->group.attrs = devm_kzalloc(&priv->pdev->dev,
>> - priv->pdata->counter *
>> + priv->group.attrs = devm_kcalloc(&priv->pdev->dev,
>> + priv->pdata->counter,
>> sizeof(struct attribute *),
>> GFP_KERNEL);
>> if (!priv->group.attrs)
>> --
>> 2.17.1
>>
>>
>> --
>> Kees Cook
>> Pixel Security
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/mellanox: Use 2-factor allocator calls
@ 2018-07-13 14:19 ` Andy Shevchenko
0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2018-07-13 14:19 UTC (permalink / raw)
To: Vadim Pasternak
Cc: Kees Cook, Darren Hart, Andy Shevchenko, platform-driver-x86,
linux-kernel
On Wed, Jul 4, 2018 at 10:39 PM, Vadim Pasternak <vadimp@mellanox.com> wrote:
>
>
>> -----Original Message-----
>> From: Kees Cook [mailto:keescook@chromium.org]
>> Sent: Wednesday, July 04, 2018 8:29 PM
>> To: Darren Hart <dvhart@infradead.org>
>> Cc: Vadim Pasternak <vadimp@mellanox.com>; Andy Shevchenko
>> <andy@infradead.org>; platform-driver-x86@vger.kernel.org; linux-
>> kernel@vger.kernel.org
>> Subject: [PATCH] platform/mellanox: Use 2-factor allocator calls
>>
>> As already done treewide, switch from open-coded multiplication to using 2-
>> factor allocation helpers.
>>
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>
Pushed to my review and testing queue, thanks!
> Acked-by: Vadim Pasternak <vadimp@mellanox.com>
>
>> ---
>> drivers/platform/mellanox/mlxreg-io.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/platform/mellanox/mlxreg-io.c
>> b/drivers/platform/mellanox/mlxreg-io.c
>> index c192dfe6bd65..acfaf64ffde6 100644
>> --- a/drivers/platform/mellanox/mlxreg-io.c
>> +++ b/drivers/platform/mellanox/mlxreg-io.c
>> @@ -152,8 +152,8 @@ static int mlxreg_io_attr_init(struct mlxreg_io_priv_data
>> *priv) {
>> int i;
>>
>> - priv->group.attrs = devm_kzalloc(&priv->pdev->dev,
>> - priv->pdata->counter *
>> + priv->group.attrs = devm_kcalloc(&priv->pdev->dev,
>> + priv->pdata->counter,
>> sizeof(struct attribute *),
>> GFP_KERNEL);
>> if (!priv->group.attrs)
>> --
>> 2.17.1
>>
>>
>> --
>> Kees Cook
>> Pixel Security
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-07-13 14:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-04 17:29 [PATCH] platform/mellanox: Use 2-factor allocator calls Kees Cook
2018-07-04 19:39 ` Vadim Pasternak
2018-07-04 19:39 ` Vadim Pasternak
2018-07-13 14:19 ` Andy Shevchenko
2018-07-13 14:19 ` Andy Shevchenko
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.