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>] [day] [month] [year] [list]
Message-id: <1652907052.50321435651311854.JavaMail.weblogic@ep2mlwas04a>
Date:	Tue, 30 Jun 2015 08:01:57 +0000 (GMT)
From:	Maninder Singh <maninder1.s@...sung.com>
To:	Joe Perches <joe@...ches.com>
Cc:	"jeffrey.t.kirsher@...el.com" <jeffrey.t.kirsher@...el.com>,
	"jesse.brandeburg@...el.com" <jesse.brandeburg@...el.com>,
	"shannon.nelson@...el.com" <shannon.nelson@...el.com>,
	"carolyn.wyborny@...el.com" <carolyn.wyborny@...el.com>,
	"donald.c.skidmore@...el.com" <donald.c.skidmore@...el.com>,
	"matthew.vick@...el.com" <matthew.vick@...el.com>,
	"john.ronciak@...el.com" <john.ronciak@...el.com>,
	"mitch.a.williams@...el.com" <mitch.a.williams@...el.com>,
	"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	PANKAJ MISHRA <pankaj.m@...sung.com>
Subject: Re: [PATCH 1/1] igb: Use ARRAY_SIZE instead fo sizeof(a)/sizeof(a[0])

Hi Joe,

>> Use ARRAY_SIZE instead fo sizeof(a)/sizeof(a[0])
>
>I think all of these #defines should be removed instead
>as they are all used only once.

If we replcase only ARRAY_SIZE then cood will look alike
to drivers/net/ethernet/intel/e1000e/phy.c

And if we have to remove these #defines , then we can also remove it from 
drivers/net/ethernet/intel/e1000e/phy.c 

Because same operations and same usage is there in both files.
what say?

>> diff --git a/drivers/net/ethernet/intel/igb/e1000_phy.c b/drivers/net/ethernet/intel/igb/e1000_phy.c
>[]
>> @@ -37,8 +37,7 @@ static s32  igb_set_master_slave_mode(struct e1000_hw *hw);
>>  static const u16 e1000_m88_cable_length_table[] = {
>>  	0, 50, 80, 110, 140, 140, E1000_CABLE_LENGTH_UNDEFINED };
>>  #define M88E1000_CABLE_LENGTH_TABLE_SIZE \
>> -	(sizeof(e1000_m88_cable_length_table) / \
>> -	sizeof(e1000_m88_cable_length_table[0]))
>> +	ARRAY_SIZE(e1000_m88_cable_length_table)
>>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ