lkml.org 
[lkml]   [2015]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] net: emac: emac gigabit ethernet controller driver
On Tue, 8 Dec 2015 00:33:04 +0100
Felix Fietkau <nbd@openwrt.org> wrote:


> On 2015-12-07 23:58, Gilad Avidov wrote:
> > +/* RRD (Receive Return Descriptor) */
> > +union emac_rrd {
> > + struct {
> > + /* 32bit word 0 */
> > + u32 xsum:16;
> > + u32 nor:4; /* number of RFD */
> > + u32 si:12; /* start index of rfd-ring */
> > + /* 32bit word 1 */
> > + u32 hash;
> > + /* 32bit word 2 */
> You should never use bitfields for hardware structs.
> I think in general, kernel code should be made endian safe, even if
> you only care about one particular endian type for your platform.
>
> - Felix

Thank you Felix,
I will change the bit fields to bitwise operations and macros.

Gilad


\
 
 \ /
  Last update: 2015-12-08 01:01    [W:1.601 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site