[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20140304.172025.2034977449200344617.davem@davemloft.net>
Date: Tue, 04 Mar 2014 17:20:25 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: phoebe.buckheister@...m.fraunhofer.de
Cc: netdev@...r.kernel.org, linux-zigbee-devel@...ts.sourceforge.net
Subject: Re: [PATCH net-next v4 1/4] ieee802154: add generic header
handling routines
From: "Phoebe Buckheister" <phoebe.buckheister@...m.fraunhofer.de>
Date: Tue, 4 Mar 2014 23:16:31 +0100
> I see some value in being able to memcpy() to/from those fields directly
> when building/reading headers, but I also think that not having to do
> endianness conversion everywhere for a struct that cannot ever be a valid
> header as is outweighs this.
Why have an intermediate copy when that's not necessary at all? It
seems like pure overhead to be.
Furthermore, cpu's have byte-shifting load and store instructions
which will be used if you make use of the 'p' versions of the endian
swap functions, such as cpu_to_le16p().
So it's going to cost basically nothing.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists