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]
Date:	Tue, 16 Jun 2015 10:43:46 +0200
From:	Ivan Vecera <ivecera@...hat.com>
To:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:	"joe@...ches.com" <joe@...ches.com>
Subject: Re: [PATCH net-next v2 05/19] bna: use BIT(x) instead of (1 << x)

On 06/12/2015 03:30 PM, David Laight wrote:
> From: Ivan Vecera
> ...
>> diff --git a/drivers/net/ethernet/brocade/bna/bfa_defs_mfg_comm.h
>> b/drivers/net/ethernet/brocade/bna/bfa_defs_mfg_comm.h
>> index 679a503..16090fd 100644
>> --- a/drivers/net/ethernet/brocade/bna/bfa_defs_mfg_comm.h
>> +++ b/drivers/net/ethernet/brocade/bna/bfa_defs_mfg_comm.h
>> @@ -75,7 +75,7 @@ enum {
>>   	CB_GPIO_FC4P2   = (4),		/*!< 4G 2port FC card		*/
>>   	CB_GPIO_FC4P1   = (5),		/*!< 4G 1port FC card		*/
>>   	CB_GPIO_DFLY    = (6),		/*!< 8G 2port FC mezzanine card	*/
>> -	CB_GPIO_PROTO   = (1 << 7)	/*!< 8G 2port FC prototypes	*/
>> +	CB_GPIO_PROTO   = BIT(7)	/*!< 8G 2port FC prototypes	*/
>
> That doesn't look like a BIT() value to me, just a large number.
> Should the release driver even have support for the prototype hardware?
Why not? Does prototype HW need special driver?
The CB_GPIO_PROTO is an indication and you can have e.g. (CB_GPIO_FC4P1 
| CB_GPIO_PROTO) as 4G 1 port FC prototype card.

>
> ...
>> -		if (rx_enet_mask & ((u32)(1 << i))) {
>> +		if (rx_enet_mask & ((u32)BIT(i))) {
>
> The (u32) cast looks superfluous.
> There are also too many ().
Will fix.

>
> ...
>> -	int bit = (1 << (vlan_id & BFI_VLAN_WORD_MASK));
>> +	int bit = BIT((vlan_id & BFI_VLAN_WORD_MASK));
>
> Too many ()
The same...

>
> 	David
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ