Thread (9 messages) 9 messages, 4 authors, 2024-03-23

Re: [PATCH] staging: sm750fb: Replace comparisons with NULL and 0

flat view

From: Dan Carpenter <hidden>
Date: 2024-03-20 05:08:20
Also in: linux-staging, lkml

On Tue, Mar 19, 2024 at 11:47:35PM +0530, Chandra Pratap wrote:
Replace '(foo != NULL)' with '(foo)' and 'x != 0'
with 'x' to adhere to the coding standards.
In your commit message use "opt" and "*opt" instead of "foo" and "x".

Removing the != NULL is fine, but the *opt != 0 should be changed to
(*opt != '\0').  There are times where comparing against zero helps
readability.  I wrote a blog about this, but I had forgotten the case
with the NUL terminator...

https://staticthinking.wordpress.com/2024/02/20/when-to-use-0/

regards,
dan carpenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help