Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932684AbbELTxi (ORCPT ); Tue, 12 May 2015 15:53:38 -0400 Received: from smtprelay0200.hostedemail.com ([216.40.44.200]:42884 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753771AbbELTxh (ORCPT ); Tue, 12 May 2015 15:53:37 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2693:2828:3138:3139:3140:3141:3142:3353:3622:3867:3868:3870:3871:3872:3873:4321:5007:6261:7903:10004:10400:10848:11026:11232:11473:11657:11658:11914:12043:12296:12438:12517:12519:12663:12740:13069:13255:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: level73_3c6d8c2206519 X-Filterd-Recvd-Size: 2285 Message-ID: <1431460414.2884.89.camel@perches.com> Subject: Re: [PATCH v3 01/33] staging: rtl8192e: Declare ethernet addresses as __aligned(2) From: Joe Perches To: Mateusz Kulikowski Cc: gregkh@linuxfoundation.org, dan.carpenter@oracle.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Tue, 12 May 2015 12:53:34 -0700 In-Reply-To: <55525805.50807@gmail.com> References: <1431206361-13736-1-git-send-email-mateusz.kulikowski@gmail.com> <1431206361-13736-2-git-send-email-mateusz.kulikowski@gmail.com> <1431210572.22450.78.camel@perches.com> <55525805.50807@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1480 Lines: 37 On Tue, 2015-05-12 at 21:44 +0200, Mateusz Kulikowski wrote: > On 10.05.2015 00:29, Joe Perches wrote: > > On Sat, 2015-05-09 at 23:18 +0200, Mateusz Kulikowski wrote: > >> Add __aligned(2) into ethernet addresses allocated on stack or in non-packed > >> structures. Use ETH_ALEN as array length in places where it was hardcoded to 6. > > [] > >> diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c > > [] > >> @@ -321,7 +321,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev) > >> u8 ICVer8192, ICVer8256; > >> u16 i, usValue, IC_Version; > >> u16 EEPROMId; > >> - u8 bMac_Tmp_Addr[6] = {0x00, 0xe0, 0x4c, 0x00, 0x00, 0x01}; > >> + u8 bMac_Tmp_Addr[ETH_ALEN] __aligned(2) = {0x00, 0xe0, 0x4c, > >> + 0x00, 0x00, 0x01}; > > > > While this is safe, as this follows a u16, it's unnecessary. > > > > Also, ideally, this would be > > u8 foo[ETH_ALEN] = { > > 1, 2, 3, 4, 5, 6 > > }; > > or just left on a single line. > > I put __aligned to most places to show authors intention and to prevent someone from breaking it by > (for example) removing u16 above due some refactoring. > > If you insist - I will remove it. I'm not very insistent. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/