mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH linux-next] speakup/utils: use "!P" instead of "P == 0"
@ 2022-09-12 10:21 cgel.zte
  2022-09-12 11:02 ` Samuel Thibault
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-09-12 10:21 UTC (permalink / raw)
  To: w.d.hubbs
  Cc: chris, kirk, samuel.thibault, Cspeakup, linux-kernel, Xu Panda,
	Zeal Robot

From: Xu Panda <xu.panda@zte.com.cn>

comparing pointer to 0, use !P instead of it.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Xu Panda <xu.panda@zte.com.cn>
---
 drivers/accessibility/speakup/utils.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/accessibility/speakup/utils.h b/drivers/accessibility/speakup/utils.h
index 4bf2ee8ac246..58ca9847637f 100644
--- a/drivers/accessibility/speakup/utils.h
+++ b/drivers/accessibility/speakup/utils.h
@@ -36,7 +36,7 @@ static inline void open_input(const char *dir_name, const char *name)
        else
                snprintf(filename, sizeof(filename), "%s", name);
        infile = fopen(filename, "r");
-       if (infile == 0) {
+       if (!infile) {
                fprintf(stderr, "can't open %s\n", filename);
                exit(1);
        }
-- 
2.15.2


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

* Re: [PATCH linux-next] speakup/utils: use "!P" instead of "P == 0"
  2022-09-12 10:21 [PATCH linux-next] speakup/utils: use "!P" instead of "P == 0" cgel.zte
@ 2022-09-12 11:02 ` Samuel Thibault
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Thibault @ 2022-09-12 11:02 UTC (permalink / raw)
  To: cgel.zte
  Cc: w.d.hubbs, chris, kirk, Cspeakup, linux-kernel, Xu Panda, Zeal Robot

cgel.zte@gmail.com, le lun. 12 sept. 2022 10:21:00 +0000, a ecrit:
> From: Xu Panda <xu.panda@zte.com.cn>
> 
> comparing pointer to 0, use !P instead of it.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Xu Panda <xu.panda@zte.com.cn>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  drivers/accessibility/speakup/utils.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/accessibility/speakup/utils.h b/drivers/accessibility/speakup/utils.h
> index 4bf2ee8ac246..58ca9847637f 100644
> --- a/drivers/accessibility/speakup/utils.h
> +++ b/drivers/accessibility/speakup/utils.h
> @@ -36,7 +36,7 @@ static inline void open_input(const char *dir_name, const char *name)
>         else
>                 snprintf(filename, sizeof(filename), "%s", name);
>         infile = fopen(filename, "r");
> -       if (infile == 0) {
> +       if (!infile) {
>                 fprintf(stderr, "can't open %s\n", filename);
>                 exit(1);
>         }
> -- 
> 2.15.2
> 

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

end of thread, other threads:[~2022-09-12 11:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12 10:21 [PATCH linux-next] speakup/utils: use "!P" instead of "P == 0" cgel.zte
2022-09-12 11:02 ` Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®