diff mbox series

[1/1] log: remove useless cast

Message ID 20200419084836.14757-1-xypron.glpk@gmx.de
State Accepted
Commit c1f39edc62adc81775e750957aa557bcf994e607
Headers show
Series [1/1] log: remove useless cast | expand

Commit Message

Heinrich Schuchardt April 19, 2020, 8:48 a.m. UTC
There is no need to cast from (void *) before assigning to a pointer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 common/log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.25.1

Comments

Simon Glass April 19, 2020, 11:38 p.m. UTC | #1
On Sun, 19 Apr 2020 at 02:48, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> There is no need to cast from (void *) before assigning to a pointer.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
>  common/log.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Simon Glass <sjg at chromium.org>
Simon Glass April 27, 2020, 3:06 a.m. UTC | #2
On Sun, 19 Apr 2020 at 02:48, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> There is no need to cast from (void *) before assigning to a pointer.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
>  common/log.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Simon Glass <sjg at chromium.org>

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/common/log.c b/common/log.c
index ffb3cd6933..c5b9b489ca 100644
--- a/common/log.c
+++ b/common/log.c
@@ -233,7 +233,7 @@  int log_add_filter(const char *drv_name, enum log_category_t cat_list[],
 	ldev = log_device_find_by_name(drv_name);
 	if (!ldev)
 		return -ENOENT;
-	filt = (struct log_filter *)calloc(1, sizeof(*filt));
+	filt = calloc(1, sizeof(*filt));
 	if (!filt)
 		return -ENOMEM;