linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] watchdog: machzwd : fix warning Using plain integer as NULL pointer
@ 2019-04-06 13:14 Hariprasad Kelam
  2019-04-06 18:47 ` Mukesh Ojha
  2019-04-06 19:32 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Hariprasad Kelam @ 2019-04-06 13:14 UTC (permalink / raw)
  To: Wim Van Sebroeck, Guenter Roeck, linux-watchdog, linux-kernel

Changes passing function argument 0 to NULL to avoid below sparse
warning

 CHECK   drivers/watchdog//machzwd.c
drivers/watchdog//machzwd.c:321:25: warning: Using plain integer as NULL
pointer

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
 drivers/watchdog/machzwd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
index 88d823d..c3926d0 100644
--- a/drivers/watchdog/machzwd.c
+++ b/drivers/watchdog/machzwd.c
@@ -318,7 +318,7 @@ static long zf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 	case WDIOC_GETBOOTSTATUS:
 		return put_user(0, p);
 	case WDIOC_KEEPALIVE:
-		zf_ping(0);
+		zf_ping(NULL);
 		break;
 	default:
 		return -ENOTTY;
-- 
2.7.4


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

* Re: [PATCH] watchdog: machzwd : fix warning Using plain integer as NULL pointer
  2019-04-06 13:14 [PATCH] watchdog: machzwd : fix warning Using plain integer as NULL pointer Hariprasad Kelam
@ 2019-04-06 18:47 ` Mukesh Ojha
  2019-04-06 19:32 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Mukesh Ojha @ 2019-04-06 18:47 UTC (permalink / raw)
  To: Hariprasad Kelam, Wim Van Sebroeck, Guenter Roeck,
	linux-watchdog, linux-kernel


On 4/6/2019 6:44 PM, Hariprasad Kelam wrote:
> Changes passing function argument 0 to NULL to avoid below sparse
> warning
>
>   CHECK   drivers/watchdog//machzwd.c
> drivers/watchdog//machzwd.c:321:25: warning: Using plain integer as NULL
> pointer
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

Cheers,
-Mukesh

> ---
>   drivers/watchdog/machzwd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
> index 88d823d..c3926d0 100644
> --- a/drivers/watchdog/machzwd.c
> +++ b/drivers/watchdog/machzwd.c
> @@ -318,7 +318,7 @@ static long zf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>   	case WDIOC_GETBOOTSTATUS:
>   		return put_user(0, p);
>   	case WDIOC_KEEPALIVE:
> -		zf_ping(0);
> +		zf_ping(NULL);
>   		break;
>   	default:
>   		return -ENOTTY;

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

* Re: [PATCH] watchdog: machzwd : fix warning Using plain integer as NULL pointer
  2019-04-06 13:14 [PATCH] watchdog: machzwd : fix warning Using plain integer as NULL pointer Hariprasad Kelam
  2019-04-06 18:47 ` Mukesh Ojha
@ 2019-04-06 19:32 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2019-04-06 19:32 UTC (permalink / raw)
  To: Hariprasad Kelam, Wim Van Sebroeck, linux-watchdog, linux-kernel

On 4/6/19 6:14 AM, Hariprasad Kelam wrote:
> Changes passing function argument 0 to NULL to avoid below sparse
> warning
> 
>   CHECK   drivers/watchdog//machzwd.c
> drivers/watchdog//machzwd.c:321:25: warning: Using plain integer as NULL
> pointer
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>

[reluctantly]

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

If anyone is still using the HW supported by this driver, it would
be a prime target for conversion to use the watchdog subsystem.
This would reduce code size and improve driver stability.
_That_ would be useful.

The only reason for replacing 0 with NULL is to make a static checker
happy. This kind of change adds zero value to the code. Instead, it
takes time from those who have to review the patches and apply them.

If we ignore such patches, we'll get them again and again, taking
away even more time. If we don't ignore them, we encourage submitters
and get even more useless patches. If we try to discourage them, we
risk being accused of being unfriendly. This is a perfect lose-lose
situation for maintainers.

Guenter

> ---
>   drivers/watchdog/machzwd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
> index 88d823d..c3926d0 100644
> --- a/drivers/watchdog/machzwd.c
> +++ b/drivers/watchdog/machzwd.c
> @@ -318,7 +318,7 @@ static long zf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>   	case WDIOC_GETBOOTSTATUS:
>   		return put_user(0, p);
>   	case WDIOC_KEEPALIVE:
> -		zf_ping(0);
> +		zf_ping(NULL);
>   		break;
>   	default:
>   		return -ENOTTY;
> 


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

end of thread, other threads:[~2019-04-06 19:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-06 13:14 [PATCH] watchdog: machzwd : fix warning Using plain integer as NULL pointer Hariprasad Kelam
2019-04-06 18:47 ` Mukesh Ojha
2019-04-06 19:32 ` Guenter Roeck

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).