* [PATCH] sparc: Compare pointers to NULL instead of 0
@ 2024-04-04 19:29 Thorsten Blum
2024-04-22 14:43 ` Andreas Larsson
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2024-04-04 19:29 UTC (permalink / raw
To: David S. Miller, Andreas Larsson; +Cc: sparclinux, linux-kernel, Thorsten Blum
Fixes the following two Coccinelle/coccicheck warnings reported by
badzero.cocci:
WARNING comparing pointer to 0
WARNING comparing pointer to 0
Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
---
arch/sparc/prom/tree_64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/sparc/prom/tree_64.c b/arch/sparc/prom/tree_64.c
index 989e7992d629..88793e5b0ab5 100644
--- a/arch/sparc/prom/tree_64.c
+++ b/arch/sparc/prom/tree_64.c
@@ -332,7 +332,7 @@ prom_setprop(phandle node, const char *pname, char *value, int size)
if (size == 0)
return 0;
- if ((pname == 0) || (value == 0))
+ if ((pname == NULL) || (value == NULL))
return 0;
#ifdef CONFIG_SUN_LDOMS
--
2.44.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sparc: Compare pointers to NULL instead of 0
2024-04-04 19:29 [PATCH] sparc: Compare pointers to NULL instead of 0 Thorsten Blum
@ 2024-04-22 14:43 ` Andreas Larsson
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Larsson @ 2024-04-22 14:43 UTC (permalink / raw
To: Thorsten Blum, David S. Miller; +Cc: sparclinux, linux-kernel
On 2024-04-04 21:29, Thorsten Blum wrote:
> Fixes the following two Coccinelle/coccicheck warnings reported by
> badzero.cocci:
>
> WARNING comparing pointer to 0
> WARNING comparing pointer to 0
>
> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
> ---
> arch/sparc/prom/tree_64.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/sparc/prom/tree_64.c b/arch/sparc/prom/tree_64.c
> index 989e7992d629..88793e5b0ab5 100644
> --- a/arch/sparc/prom/tree_64.c
> +++ b/arch/sparc/prom/tree_64.c
> @@ -332,7 +332,7 @@ prom_setprop(phandle node, const char *pname, char *value, int size)
>
> if (size == 0)
> return 0;
> - if ((pname == 0) || (value == 0))
> + if ((pname == NULL) || (value == NULL))
> return 0;
>
> #ifdef CONFIG_SUN_LDOMS
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Picking this up to my for-next
Thanks,
Andreas
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-22 14:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-04 19:29 [PATCH] sparc: Compare pointers to NULL instead of 0 Thorsten Blum
2024-04-22 14:43 ` Andreas Larsson
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 read-only IMAP folder(s) and NNTP newsgroup(s).