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: <20200323073214.GJ4650@kadam>
Date:   Mon, 23 Mar 2020 10:32:14 +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>,
        devel@...verdev.osuosl.org, Malcolm Priestley <tvboxspy@...il.com>,
        linux-kernel@...r.kernel.org,
        Gabriela Bittencourt <gabrielabittencourt00@...il.com>,
        Colin Ian King <colin.king@...onical.com>
Subject: Re: [PATCH] staging: vt6656: Use BIT() macro in vnt_mac_reg_bits_*
 functions

On Fri, Mar 20, 2020 at 07:13:26PM +0100, Oscar Carter wrote:
> +#include <linux/bits.h>
>  #include "mac.h"
>  #include "baseband.h"
>  #include "rf.h"
> @@ -468,7 +469,7 @@ int vnt_vt3184_init(struct vnt_private *priv)
>  		if (ret)
>  			goto end;
> 
> -		ret = vnt_mac_reg_bits_on(priv, MAC_REG_PAPEDELAY, 0x01);
> +		ret = vnt_mac_reg_bits_on(priv, MAC_REG_PAPEDELAY, BIT(0));

Everyone knows 0x01 is bit(0) already.  This isn't more clear.  It
should be a define instead of a magic number.

> @@ -63,7 +64,8 @@ void vnt_set_channel(struct vnt_private *priv, u32 connection_channel)
>  	vnt_mac_reg_bits_on(priv, MAC_REG_MACCR, MACCR_CLRNAV);
> 
>  	/* Set Channel[7] = 0 to tell H/W channel is changing now. */
> -	vnt_mac_reg_bits_off(priv, MAC_REG_CHANNEL, 0xb0);
> +	vnt_mac_reg_bits_off(priv, MAC_REG_CHANNEL,
> +			     (BIT(7) | BIT(5) | BIT(4)));

This one especially is just a lot longer now but still not clear.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ