public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
* [PATCH linux-next] macintosh:adb:recordmcount:use !E in conditional statements
@ 2022-08-01  2:25 cgel.zte
  2022-08-01  6:36 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-08-01  2:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: ye xingchen, Zeal Robot, linuxppc-dev

From: ye xingchen <ye.xingchen@zte•com.cn>

Use !E to replace the type of x == 0. This change is just to 
simplify the code, no actual functional changes.

Reported-by: Zeal Robot <zealci@zte•com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte•com.cn>
---
 drivers/macintosh/adb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 1bbb9ca08d40..368ab25db234 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -673,7 +673,7 @@ static int adb_open(struct inode *inode, struct file *file)
 		goto out;
 	}
 	state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL);
-	if (state == 0) {
+	if (!state) {
 		ret = -ENOMEM;
 		goto out;
 	}
-- 
2.25.1

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

* Re: [PATCH linux-next] macintosh:adb:recordmcount:use !E in conditional statements
  2022-08-01  2:25 [PATCH linux-next] macintosh:adb:recordmcount:use !E in conditional statements cgel.zte
@ 2022-08-01  6:36 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2022-08-01  6:36 UTC (permalink / raw)
  To: cgel.zte, linux-kernel; +Cc: ye xingchen, Zeal Robot, linuxppc-dev

cgel.zte@gmail•com writes:
> From: ye xingchen <ye.xingchen@zte•com.cn>
>
> Use !E to replace the type of x == 0. This change is just to 
> simplify the code, no actual functional changes.
>
> Reported-by: Zeal Robot <zealci@zte•com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@zte•com.cn>
> ---
>  drivers/macintosh/adb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

The subject is wrong, why does it mention recordmcount?

But in general this is very old code which is best left alone unless
there's an actual bug, it doesn't need these sort of style refactorings
done to it IMO.

cheers

> diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
> index 1bbb9ca08d40..368ab25db234 100644
> --- a/drivers/macintosh/adb.c
> +++ b/drivers/macintosh/adb.c
> @@ -673,7 +673,7 @@ static int adb_open(struct inode *inode, struct file *file)
>  		goto out;
>  	}
>  	state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL);
> -	if (state == 0) {
> +	if (!state) {
>  		ret = -ENOMEM;
>  		goto out;
>  	}
> -- 
> 2.25.1

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

end of thread, other threads:[~2022-08-01  6:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-01  2:25 [PATCH linux-next] macintosh:adb:recordmcount:use !E in conditional statements cgel.zte
2022-08-01  6:36 ` Michael Ellerman

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