All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
To: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Cc: Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>,
	"davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org"
	<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	"robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Pawel Moll <Pawel.Moll-5wv7dgnIgG8@public.gmane.org>,
	"ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org"
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	"galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org"
	<galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	"f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"dave.taht-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<dave.taht-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH RFC V2 2/2] net: qualcomm: new Ethernet over SPI driver for QCA7000
Date: Tue, 1 Jul 2014 19:16:01 +0100	[thread overview]
Message-ID: <20140701181601.GA11399@leverpostej> (raw)
In-Reply-To: <1404237465.14624.9.camel@joe-AO725>

On Tue, Jul 01, 2014 at 06:57:45PM +0100, Joe Perches wrote:
> On Tue, 2014-07-01 at 18:46 +0100, Mark Rutland wrote:
> > On Tue, Jul 01, 2014 at 05:36:49PM +0100, Stefan Wahren wrote:
> > > This patch adds the Ethernet over SPI driver for the
> > > Qualcomm QCA7000 HomePlug GreenPHY.
> []
> > > +               memcpy(qca->net_dev->dev_addr, mac, ETH_ALEN);
> > 
> > I believe that it is preferred to write:
> > 
> > 	ether_addr_copy(qca->net_dev->dev_addr, mac);
> > 
> > I believe checkpatch has a warning for this.
> 
> True, but you have to make sure that both args are
> at least __aligned(2) and afaics there's no
> guarantee that's true for mac.

In this case I think there is, though I deleted the context that would
make that clearer. Sorry about that.

We acquired mac with:

	mac = of_get_mac_address(spi_device->dev.of_node);

Where of_get_mac_address returns a property::value pointer.

As far as I can tell, when we unflatten the DT each property::value is
pointed at the original data in the DTB. Each data stream immediately
follows a naturally aligned 32-bit FDT_PROP token in the DTB, so all
value pointers should be aligned to at least 4 bytes.

That all said I'm happy to just use memcpy if we're not happy to rely on
the DTB format, it's not exactly going to be a bottleneck.

Cheers,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-07-01 18:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-01 16:36 [PATCH RFC V2 0/2] add Qualcomm QCA7000 ethernet driver Stefan Wahren
2014-07-01 16:36 ` [PATCH RFC V2 1/2] Documentation: add Device tree bindings for QCA7000 Stefan Wahren
2014-07-01 17:33   ` Sergei Shtylyov
2014-07-02  7:01     ` Stefan Wahren
2014-07-02 11:51       ` Sergei Shtylyov
2014-07-02 15:37         ` Stefan Wahren
2014-07-01 16:36 ` [PATCH RFC V2 2/2] net: qualcomm: new Ethernet over SPI driver " Stefan Wahren
2014-07-01 17:37   ` Joe Perches
2014-07-01 17:46   ` Mark Rutland
2014-07-01 17:57     ` Joe Perches
2014-07-01 18:16       ` Mark Rutland [this message]
2014-07-03  9:49   ` Tobias Klauser

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=20140701181601.GA11399@leverpostej \
    --to=mark.rutland-5wv7dgnigg8@public.gmane.org \
    --cc=Pawel.Moll-5wv7dgnIgG8@public.gmane.org \
    --cc=dave.taht-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=stefan.wahren-eS4NqCHxEME@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.