diff mbox series

PM / QOS: Use kcalloc() instead of kzalloc()

Message ID 20240105181118.116292-1-erick.archer@gmx.com (mailing list archive)
State Mainlined, archived
Headers show
Series PM / QOS: Use kcalloc() instead of kzalloc() | expand

Commit Message

Erick Archer Jan. 5, 2024, 6:11 p.m. UTC
Use 2-factor multiplication argument form kcalloc() instead
of kzalloc().

Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Erick Archer <erick.archer@gmx.com>
---
 drivers/base/power/qos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.42.0

Comments

Gustavo A. R. Silva Jan. 5, 2024, 6:17 p.m. UTC | #1
On 1/5/24 12:11, Erick Archer wrote:
> Use 2-factor multiplication argument form kcalloc() instead
> of kzalloc().
> 
> Link: https://github.com/KSPP/linux/issues/162
> Signed-off-by: Erick Archer <erick.archer@gmx.com>

Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Thanks!
Rafael J. Wysocki Jan. 9, 2024, 1:57 p.m. UTC | #2
On Fri, Jan 5, 2024 at 7:17 PM Gustavo A. R. Silva
<gustavo@embeddedor.com> wrote:
>
>
>
> On 1/5/24 12:11, Erick Archer wrote:
> > Use 2-factor multiplication argument form kcalloc() instead
> > of kzalloc().
> >
> > Link: https://github.com/KSPP/linux/issues/162
> > Signed-off-by: Erick Archer <erick.archer@gmx.com>
>
> Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Applied as 6.8-rc1 material, thanks!

> > ---
> >   drivers/base/power/qos.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
> > index 8e93167f1783..bd77f6734f14 100644
> > --- a/drivers/base/power/qos.c
> > +++ b/drivers/base/power/qos.c
> > @@ -201,7 +201,7 @@ static int dev_pm_qos_constraints_allocate(struct device *dev)
> >       if (!qos)
> >               return -ENOMEM;
> >
> > -     n = kzalloc(3 * sizeof(*n), GFP_KERNEL);
> > +     n = kcalloc(3, sizeof(*n), GFP_KERNEL);
> >       if (!n) {
> >               kfree(qos);
> >               return -ENOMEM;
> > --
> > 2.42.0
> >
> >
diff mbox series

Patch

diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
index 8e93167f1783..bd77f6734f14 100644
--- a/drivers/base/power/qos.c
+++ b/drivers/base/power/qos.c
@@ -201,7 +201,7 @@  static int dev_pm_qos_constraints_allocate(struct device *dev)
 	if (!qos)
 		return -ENOMEM;

-	n = kzalloc(3 * sizeof(*n), GFP_KERNEL);
+	n = kcalloc(3, sizeof(*n), GFP_KERNEL);
 	if (!n) {
 		kfree(qos);
 		return -ENOMEM;