* [PATCH] video: of: display_timing: Remove a redundant zeroing of memory
@ 2022-03-22 20:33 Christophe JAILLET
2022-03-24 6:38 ` Helge Deller
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2022-03-22 20:33 UTC (permalink / raw)
To: Helge Deller
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-fbdev,
dri-devel
of_parse_display_timing() already call memset(0) on its 2nd argument, so
there is no need to clear it explicitly before calling this function.
Use kmalloc() instead of kzalloc() to save a few cycles.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/video/of_display_timing.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
index f93b6abbe258..bebd371c6b93 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -199,7 +199,7 @@ struct display_timings *of_get_display_timings(const struct device_node *np)
struct display_timing *dt;
int r;
- dt = kzalloc(sizeof(*dt), GFP_KERNEL);
+ dt = kmalloc(sizeof(*dt), GFP_KERNEL);
if (!dt) {
pr_err("%pOF: could not allocate display_timing struct\n",
np);
--
2.32.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] video: of: display_timing: Remove a redundant zeroing of memory
2022-03-22 20:33 [PATCH] video: of: display_timing: Remove a redundant zeroing of memory Christophe JAILLET
@ 2022-03-24 6:38 ` Helge Deller
0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2022-03-24 6:38 UTC (permalink / raw)
To: Christophe JAILLET; +Cc: linux-kernel, kernel-janitors, linux-fbdev, dri-devel
On 3/22/22 21:33, Christophe JAILLET wrote:
> of_parse_display_timing() already call memset(0) on its 2nd argument, so
> there is no need to clear it explicitly before calling this function.
>
> Use kmalloc() instead of kzalloc() to save a few cycles.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
applied.
Thanks!
Helge
> ---
> drivers/video/of_display_timing.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
> index f93b6abbe258..bebd371c6b93 100644
> --- a/drivers/video/of_display_timing.c
> +++ b/drivers/video/of_display_timing.c
> @@ -199,7 +199,7 @@ struct display_timings *of_get_display_timings(const struct device_node *np)
> struct display_timing *dt;
> int r;
>
> - dt = kzalloc(sizeof(*dt), GFP_KERNEL);
> + dt = kmalloc(sizeof(*dt), GFP_KERNEL);
> if (!dt) {
> pr_err("%pOF: could not allocate display_timing struct\n",
> np);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-24 6:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-22 20:33 [PATCH] video: of: display_timing: Remove a redundant zeroing of memory Christophe JAILLET
2022-03-24 6:38 ` Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).