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] [day] [month] [year] [list]
Message-ID: <2025010738-gong-rewind-2583@gregkh>
Date: Tue, 7 Jan 2025 15:26:25 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Sandeep Salwan <salwansandeep5@...il.com>
Cc: linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: fbtft: Remove unnecessary parentheses in
 fbtft-core.c

On Sun, Jan 05, 2025 at 12:49:37PM -0500, Sandeep Salwan wrote:
> This patch removes unnecessary parentheses around the conditional checks (!txbuflen) and (bpp > 8) in fbtft-core.c. According to the kernel coding style, reducing superfluous parentheses makes the code more readable and straightforward. There are no functional changes; it’s purely a cleanup to align the code with kernel style guidelines.

Please wrap your changelog at 72 columns like your editor asked you to.

> 
> Signed-off-by: Sandeep Salwan <salwansandeep5@...il.com>
> ---
>  drivers/staging/fbtft/fbtft-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
> index 4cfa494243b9..b4e9d6000b9a 100644
> --- a/drivers/staging/fbtft/fbtft-core.c
> +++ b/drivers/staging/fbtft/fbtft-core.c
> @@ -664,7 +664,7 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
>  		txbuflen = 0;
>  
>  #ifdef __LITTLE_ENDIAN
> -	if ((!txbuflen) && (bpp > 8))
> +	if (!txbuflen && bpp > 8)

No, please see the zillions of times I have rejected changes like this
in the past on the mailing list.  checkpatch.pl is wrong here.

We write code for people first, compilers second.  With your change, now
you need to look up the order of operations (quick, which is comes first
in order, '&&' or '!' or '>')?

With the () there, you know what the intent is, and what the order is,
without having to always know what comes before what.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ