All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP2+: hwmod: Use kzalloc for allocating only one element
@ 2022-08-09  7:20 ` Kenneth Lee
  0 siblings, 0 replies; 4+ messages in thread
From: Kenneth Lee @ 2022-08-09  7:20 UTC (permalink / raw)
  To: bcousson, paul, tony; +Cc: linux-omap, linux-arm-kernel, Kenneth Lee

Use kzalloc(...) rather than kcalloc(1, ...) because the number of
elements we are specifying in this case is 1, so kzalloc would
accomplish the same thing and we can simplify.

Signed-off-by: Kenneth Lee <klee33@uw.edu>
---
 arch/arm/mach-omap2/omap_hwmod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 31d1a21f6041..da0381051207 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -3455,7 +3455,7 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh,
 	}
 
 	if (list_empty(&oh->slave_ports)) {
-		oi = kcalloc(1, sizeof(*oi), GFP_KERNEL);
+		oi = kzalloc(sizeof(*oi), GFP_KERNEL);
 		if (!oi)
 			goto out_free_class;
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ARM: OMAP2+: hwmod: Use kzalloc for allocating only one element
@ 2022-08-09  7:20 ` Kenneth Lee
  0 siblings, 0 replies; 4+ messages in thread
From: Kenneth Lee @ 2022-08-09  7:20 UTC (permalink / raw)
  To: bcousson, paul, tony; +Cc: linux-omap, linux-arm-kernel, Kenneth Lee

Use kzalloc(...) rather than kcalloc(1, ...) because the number of
elements we are specifying in this case is 1, so kzalloc would
accomplish the same thing and we can simplify.

Signed-off-by: Kenneth Lee <klee33@uw.edu>
---
 arch/arm/mach-omap2/omap_hwmod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 31d1a21f6041..da0381051207 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -3455,7 +3455,7 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh,
 	}
 
 	if (list_empty(&oh->slave_ports)) {
-		oi = kcalloc(1, sizeof(*oi), GFP_KERNEL);
+		oi = kzalloc(sizeof(*oi), GFP_KERNEL);
 		if (!oi)
 			goto out_free_class;
 
-- 
2.31.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: OMAP2+: hwmod: Use kzalloc for allocating only one element
  2022-08-09  7:20 ` Kenneth Lee
@ 2023-03-28  5:46   ` Tony Lindgren
  -1 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2023-03-28  5:46 UTC (permalink / raw)
  To: Kenneth Lee; +Cc: bcousson, paul, linux-omap, linux-arm-kernel

* Kenneth Lee <klee33@uw.edu> [220809 10:14]:
> Use kzalloc(...) rather than kcalloc(1, ...) because the number of
> elements we are specifying in this case is 1, so kzalloc would
> accomplish the same thing and we can simplify.

Thanks applying into omap-for-v6.4/cleanup.

Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: OMAP2+: hwmod: Use kzalloc for allocating only one element
@ 2023-03-28  5:46   ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2023-03-28  5:46 UTC (permalink / raw)
  To: Kenneth Lee; +Cc: bcousson, paul, linux-omap, linux-arm-kernel

* Kenneth Lee <klee33@uw.edu> [220809 10:14]:
> Use kzalloc(...) rather than kcalloc(1, ...) because the number of
> elements we are specifying in this case is 1, so kzalloc would
> accomplish the same thing and we can simplify.

Thanks applying into omap-for-v6.4/cleanup.

Tony

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-28  5:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-09  7:20 [PATCH] ARM: OMAP2+: hwmod: Use kzalloc for allocating only one element Kenneth Lee
2022-08-09  7:20 ` Kenneth Lee
2023-03-28  5:46 ` Tony Lindgren
2023-03-28  5:46   ` Tony Lindgren

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.