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: <20200331102906.GA2066@kadam>
Date:   Tue, 31 Mar 2020 13:29:06 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Oscar Carter <oscar.carter@....com>
Cc:     Forest Bond <forest@...ttletooquiet.net>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Malcolm Priestley <tvboxspy@...il.com>,
        Quentin Deslandes <quentin.deslandes@...ev.co.uk>,
        Amir Mahdi Ghorbanian <indigoomega021@...il.com>,
        Colin Ian King <colin.king@...onical.com>,
        Gabriela Bittencourt <gabrielabittencourt00@...il.com>,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: vt6656: Use defines in vnt_mac_reg_bits_*
 functions

On Sat, Mar 28, 2020 at 10:54:33AM +0100, Oscar Carter wrote:
> Define the necessary bits in the CHANNEL, PAPEDELAY and GPIOCTL0
> registers to can use them in the calls to vnt_mac_reg_bits_on and
> vnt_mac_reg_bits_off functions. In this way, avoid the use of BIT()
> macros and clarify the code.
> 
> Fixes: 3017e587e368 ("staging: vt6656: Use BIT() macro in vnt_mac_reg_bits_* functions")
> Suggested-by: Dan Carpenter <dan.carpenter@...cle.com>
> Signed-off-by: Oscar Carter <oscar.carter@....com>
> ---
>  drivers/staging/vt6656/baseband.c |  6 ++++--
>  drivers/staging/vt6656/card.c     |  3 +--
>  drivers/staging/vt6656/mac.h      | 12 ++++++++++++
>  drivers/staging/vt6656/main_usb.c |  2 +-
>  4 files changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
> index a19a563d8bcc..dd3c3bf5e8b5 100644
> --- a/drivers/staging/vt6656/baseband.c
> +++ b/drivers/staging/vt6656/baseband.c
> @@ -442,7 +442,8 @@ int vnt_vt3184_init(struct vnt_private *priv)
>  		if (ret)
>  			goto end;
> 
> -		ret = vnt_mac_reg_bits_on(priv, MAC_REG_PAPEDELAY, BIT(0));
> +		ret = vnt_mac_reg_bits_on(priv, MAC_REG_PAPEDELAY,
> +					  PAPEDELAY_B0);

This doesn't clarify anything.  It makes it less clear because someone
would assume B0 means something but it's just hiding a magic number
behind a meaningless define.  B0 means BIT(0) which means nothing.  So
now we have to jump through two hoops to find out that we don't know
anything.

Just leave it as-is.  Same for the rest.

There problem is a hardware spec which explains what this stuff is.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ