Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752369AbbF3ICc (ORCPT ); Tue, 30 Jun 2015 04:02:32 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:57197 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752801AbbF3ICT (ORCPT ); Tue, 30 Jun 2015 04:02:19 -0400 X-AuditID: cbfee68f-f793b6d000005f66-65-55924d09df70 Date: Tue, 30 Jun 2015 08:01:57 +0000 (GMT) From: Maninder Singh Subject: Re: [PATCH 1/1] igb: Use ARRAY_SIZE instead fo sizeof(a)/sizeof(a[0]) To: Joe Perches Cc: "jeffrey.t.kirsher@intel.com" , "jesse.brandeburg@intel.com" , "shannon.nelson@intel.com" , "carolyn.wyborny@intel.com" , "donald.c.skidmore@intel.com" , "matthew.vick@intel.com" , "john.ronciak@intel.com" , "mitch.a.williams@intel.com" , "intel-wired-lan@lists.osuosl.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , PANKAJ MISHRA Reply-to: maninder1.s@samsung.com MIME-version: 1.0 X-MTR: 20150630075358640@maninder1.s Msgkey: 20150630075358640@maninder1.s X-EPLocale: en_US.windows-1252 X-Priority: 3 X-EPWebmail-Msg-Type: personal X-EPWebmail-Reply-Demand: 0 X-EPApproval-Locale: X-EPHeader: ML X-MLAttribute: X-RootMTR: 20150630075358640@maninder1.s X-ParentMTR: X-ArchiveUser: X-CPGSPASS: N X-ConfirmMail: N,general Content-type: text/plain; charset=windows-1252 MIME-version: 1.0 Message-id: <1652907052.50321435651311854.JavaMail.weblogic@ep2mlwas04a> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGIsWRmVeSWpSXmKPExsWyRsSkVpfTd1KowZE9chaXd81hc2D0+LxJ LoAxissmJTUnsyy1SN8ugSvjxNVPjAWbuCrWzHnH1MDYw9XFyMkhJKAmsWjvYzYQW0LARGL/ sXNQtpjEhXvrgWwuoJqljBLHJswHcjjAik4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6288AbN5BQQlTs58wgKxTUViz4fdUHFViR/z3jBBxOUklky9DGXzAg19ygIT n/Z1DTOELS1xftYGRpirF39/DBXnlzh2ewdUr4DE1DMHoWo0JbauOgJVwyexZuFbFpj6XaeW M8Psur9lLlSvhMTWlidgzzMD3T+l+yE7hG0gcWTRHFZ0v/AKeEi09W1im8AoOwtJahaS9llI 2pHVLGBkWcUomlqQXFCclF5hpFecmFtcmpeul5yfu4kRnIieLdrB+O+89SFGAQ5GJR7eBmCC EmJNLCuuzD3EKMHBrCTCWycJFOJNSaysSi3Kjy8qzUktPsRoCoy2icxSosn5wCSZVxJvaGxi bmpsamFgaG5upiTO+/9cboiQQHpiSWp2ampBahFMHxMHp1QDY7dL1EYFV6WX9v9bYt4EXtxq Vv9gucEy8aUWZs2v3FSXX+0IaW1ojFm3ckff6j7HClu72c8649SfPDg+Y3e9yP70stX9jJEx sz4FyLyQf/Hq4x1W3S2nPpV2Rhl4s99TOZ1xN7H3+XKHhv3TVn5b5/lvQ/XRVQy7uR7OT3D5 fXbSZaHYWLaDAUosxRmJhlrMRcWJAEmPJ2JaAwAA DLP-Filter: Pass X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t5U82bRU010346 Content-Length: 1104 Lines: 26 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) >> ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?