From: Joe Perches <joe@perches.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>,
David Miller <davem@davemloft.net>
Cc: Sam Creasey <sammy@sammy.net>,
Grant Grundler <grundler@parisc-linux.org>,
Wan ZongShun <mcuos.com@gmail.com>,
Network Development <netdev@vger.kernel.org>,
Don Fry <pcnet32@frontier.com>,
Sony Chacko <sony.chacko@qlogic.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Manish Chopra <manish.chopra@qlogic.com>,
linux-driver@qlogic.com,
Rajesh Borundia <rajesh.borundia@qlogic.com>,
Ron Mercer <ron.mercer@qlogic.com>,
Andrew Gallatin <gallatin@myri.com>,
Olof Johansson <olof@lixom.net>,
Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Shahed Shaikh <shahed.shaikh@qlogic.com>
Subject: Re: [PATCH V2 3/3] ethernet: Convert mac address uses of 6 to ETH_ALEN
Date: Thu, 01 Aug 2013 14:04:47 -0700 [thread overview]
Message-ID: <1375391087.2034.82.camel@joe-AO722> (raw)
In-Reply-To: <20130801205817.GJ23006@n2100.arm.linux.org.uk>
On Thu, 2013-08-01 at 21:58 +0100, Russell King - ARM Linux wrote:
> On Thu, Aug 01, 2013 at 01:55:28PM -0700, Joe Perches wrote:
> > On Thu, 2013-08-01 at 21:33 +0100, Russell King - ARM Linux wrote:
> > > On Thu, Aug 01, 2013 at 01:31:09PM -0700, Olof Johansson wrote:
> > > > On Thu, Aug 1, 2013 at 1:14 PM, Joe Perches <joe@perches.com> wrote:
> > > > > diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.h b/drivers/net/ethernet/pasemi/pasemi_mac.h
> > []
> > > > > @@ -79,11 +79,11 @@ struct pasemi_mac {
> > > > > int last_cs;
> > > > > int num_cs;
> > > > > u32 dma_if;
> > > > > - u8 type;
> > > > > #define MAC_TYPE_GMAC 1
> > > > > #define MAC_TYPE_XAUI 2
> > > > >
> > > > > - u8 mac_addr[6];
> > > > > + u8 mac_addr[ETH_ALEN];
> > > > > + u8 type;
> > > >
> > > > Just promote 'type' to u32 instead, saves you from moving the #defines
> > > > down, etc, etc.
> >
> > type is already u8, why change it?
> > That would also change struct size.
> >
> > > There's a more fundamental question which has to be asked: what is the
> > > point of moving that in the first place?
> >
> > Some is_<foo>_ether_addr tests assume __aligned(2)
> > by a casting char * to u16/be16 * and dereferencing.
> >
> > see patch 0/3 and include/linux/etherdevice.h
>
> This seems rather obscure - I mean, it's not obvious to driver authors
> that should be the case. Would it not be better to make this a little
> more obvious somehow? Maybe __aligned(2) against mac_addr? Or
> maybe have a debugging check for it?
That'd be for David Miller (cc'd).
I believe he's argued in the past that any alignment check
for mac addresses was unnecessary.
For all I know it really might not matter because pasemi
can successfully dereference a ushort against an odd char
pointer.
I just noticed it and thought it'd be better moved.
next prev parent reply other threads:[~2013-08-01 21:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-01 20:14 [PATCH V2 0/3] networking: Use ETH_ALEN where appropriate Joe Perches
2013-08-01 20:14 ` [PATCH V2 1/3] uapi: Convert some uses of 6 to ETH_ALEN Joe Perches
2013-08-01 20:14 ` [PATCH V2 2/3] include: Convert ethernet mac address declarations to use ETH_ALEN Joe Perches
2013-08-01 20:14 ` [PATCH V2 3/3] ethernet: Convert mac address uses of 6 to ETH_ALEN Joe Perches
2013-08-01 20:31 ` Olof Johansson
2013-08-01 20:33 ` Russell King - ARM Linux
2013-08-01 20:55 ` Joe Perches
2013-08-01 20:58 ` Russell King - ARM Linux
2013-08-01 21:04 ` Joe Perches [this message]
2013-08-01 21:06 ` Russell King - ARM Linux
2013-08-01 21:10 ` David Miller
2013-08-01 21:24 ` Olof Johansson
2013-08-01 21:31 ` David Miller
2013-08-01 23:17 ` [PATCH V3 0/3] networking: Use ETH_ALEN where appropriate Joe Perches
2013-08-01 23:17 ` [PATCH V3 1/3] uapi: Convert some uses of 6 to ETH_ALEN Joe Perches
2013-08-01 23:17 ` [PATCH V3 2/3] include: Convert ethernet mac address declarations to use ETH_ALEN Joe Perches
2013-08-01 23:17 ` [PATCH V3 3/3] ethernet: Convert mac address uses of 6 to ETH_ALEN Joe Perches
2013-08-01 23:30 ` Olof Johansson
2013-08-02 19:34 ` [PATCH V3 0/3] networking: Use ETH_ALEN where appropriate David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375391087.2034.82.camel@joe-AO722 \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=gallatin@myri.com \
--cc=grundler@parisc-linux.org \
--cc=jitendra.kalsaria@qlogic.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-driver@qlogic.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=manish.chopra@qlogic.com \
--cc=mcuos.com@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olof@lixom.net \
--cc=pcnet32@frontier.com \
--cc=rajesh.borundia@qlogic.com \
--cc=ron.mercer@qlogic.com \
--cc=sammy@sammy.net \
--cc=shahed.shaikh@qlogic.com \
--cc=sony.chacko@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).