[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c4a5e9e8-214a-4ac0-b8ee-01a9e7a1e5f9@moroto.mountain>
Date: Wed, 20 Mar 2024 08:08:15 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Chandra Pratap <chandrapratap3519@...il.com>
Cc: sudipm.mukherjee@...il.com, teddy.wang@...iconmotion.com,
gregkh@...uxfoundation.org, linux-fbdev@...r.kernel.org,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
outreachy@...ts.linux.dev
Subject: Re: [PATCH] staging: sm750fb: Replace comparisons with NULL and 0
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
Powered by blists - more mailing lists