linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: joe@perches.com (Joe Perches)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 3/3] ethernet: Convert mac address uses of 6 to ETH_ALEN
Date: Thu, 01 Aug 2013 13:55:28 -0700	[thread overview]
Message-ID: <1375390528.2034.77.camel@joe-AO722> (raw)
In-Reply-To: <20130801203343.GG23006@n2100.arm.linux.org.uk>

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:
> > Hi,

Hi all.

> > 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

  reply	other threads:[~2013-08-01 20:55 UTC|newest]

Thread overview: 15+ 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 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 [this message]
2013-08-01 20:58         ` Russell King - ARM Linux
2013-08-01 21:04           ` Joe Perches
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-02 19:34                       ` David Miller
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

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=1375390528.2034.77.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).