lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c2911f68-d1e2-4b45-af95-590926b7a6f1@gmail.com>
Date: Wed, 26 Jun 2024 06:41:50 +0200
From: Philipp Hortmann <philipp.g.hortmann@...il.com>
To: Tom Mounet <tommounet@...il.com>, Marc Dietrich <marvin24@....de>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>, ac100@...ts.launchpad.net,
 linux-tegra@...r.kernel.org, linux-staging@...ts.linux.dev,
 linux-kernel@...r.kernel.org, outreachy@...ts.linux.dev
Subject: Re: [PATCH] staging: nvec: use x instead of x != NULL

On 6/25/24 22:56, Tom Mounet wrote:
> Comply with coding rules defined in checkpatch
> 
> Signed-off-by: Tom Mounet <tommounet@...il.com>
> ---
>   drivers/staging/nvec/nvec.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
> index e5ca78e57..814eb121c 100644
> --- a/drivers/staging/nvec/nvec.c
> +++ b/drivers/staging/nvec/nvec.c
> @@ -300,7 +300,7 @@ int nvec_write_sync(struct nvec_chip *nvec,
>   {
>   	mutex_lock(&nvec->sync_write_mutex);
>   
> -	if (msg != NULL)
> +	if (msg)
>   		*msg = NULL;
>   
>   	nvec->sync_write_pending = (data[1] << 8) + data[0];
> @@ -322,7 +322,7 @@ int nvec_write_sync(struct nvec_chip *nvec,
>   
>   	dev_dbg(nvec->dev, "nvec_sync_write: pong!\n");
>   
> -	if (msg != NULL)
> +	if (msg)
>   		*msg = nvec->last_sync_msg;
>   	else
>   		nvec_msg_free(nvec, nvec->last_sync_msg);


Hi Tom,

what you change in this patch is fine. But the Description is not so 
lucky. Reason is that checkpatch is not defining the coding style. Not 
at all. Sometimes checkpatch is even wrong. The description I like would be:

Use x instead of x != NULL to shorten code.

or

Use x instead of x != NULL to improve readability.

If you send in a second version of this patch please use a change 
history. Description from Dan under:
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

Thanks

Bye Philipp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ