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: <Ydb40xesTGFftdol@kroah.com>
Date:   Thu, 6 Jan 2022 15:12:35 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Alberto Merciai <alb3rt0.m3rciai@...il.com>
Cc:     linuxfancy@...glegroups.com,
        Larry Finger <Larry.Finger@...inger.net>,
        Phillip Potter <phil@...lpotter.co.uk>,
        Michael Straube <straube.linux@...il.com>,
        Martin Kaiser <martin@...ser.cx>,
        "Fabio M. De Francesco" <fmdefrancesco@...il.com>,
        Nathan Chancellor <nathan@...nel.org>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        Saurav Girepunje <saurav.girepunje@...il.com>,
        Ivan Safonov <insafonov@...il.com>,
        Yang Li <yang.lee@...ux.alibaba.com>,
        Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        Zameer Manji <zmanji@...il.com>, linux-staging@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/56] staging: r8188eu: add parenthesis to macro SetToDs

On Mon, Jan 03, 2022 at 08:01:36PM +0100, Alberto Merciai wrote:
> Enclose in parenthesis complex macro SetToDs

Why?

You are saying what you are doing (which is easy to see by looking at
the patch itself), but not _why_ you are doing this.  Please read the
documentation in the kernel source tree for how to write a good kernel
commit message.  It is in the section entitled "The canonical patch
format" in the kernel file, Documentation/SubmittingPatches.

> Signed-off-by: Alberto Merciai <alb3rt0.m3rciai@...il.com>
> ---
>  drivers/staging/r8188eu/include/wifi.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/r8188eu/include/wifi.h b/drivers/staging/r8188eu/include/wifi.h
> index 7cbc7015e90f..f16e9f44babe 100644
> --- a/drivers/staging/r8188eu/include/wifi.h
> +++ b/drivers/staging/r8188eu/include/wifi.h
> @@ -164,7 +164,7 @@ enum WIFI_REG_DOMAIN {
>  #define _ORDER_		BIT(15)
>  
>  #define SetToDs(pbuf)	\
> -	*(__le16 *)(pbuf) |= cpu_to_le16(_TO_DS_)
> +	(*(__le16 *)(pbuf) |= cpu_to_le16(_TO_DS_))

The cast here should not be happening as odds are it hides other endian
issues.

Also the name is horrid, but really, the lack of () is is fine as-is as
it is used as a "function call" in the driver.  Wrapping it in () does
nothing to it at all from what I can tell so this change isn't even
helping :(

Why not fix this up properly by replacing the places where it is called
with the code here instead?

For example, these lines:
	else if ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE)
		SetToDs(fctrl);
would be:
	else if ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE)
		fctrl |= cpu_to_le16(_TO_DS_);

Isn't that now much more readable and easier to understand what is
happening here?

Then there's the crazyness of a bit field being called "_TO_DS_", but
that can be cleaned up later...

I hate to reject patch 1 of a 50+ patch series, but next time try
sending smaller series so that you don't have to redo a bunch of work
like now has to happen here (the same comments apply to your other ()
patches in this series.)

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ