Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964920AbbLGXr4 (ORCPT ); Mon, 7 Dec 2015 18:47:56 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:35637 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932433AbbLGXry (ORCPT ); Mon, 7 Dec 2015 18:47:54 -0500 Date: Mon, 7 Dec 2015 16:47:50 -0700 From: Gilad Avidov To: Felix Fietkau Cc: gregkh@linuxfoundation.org, netdev@vger.kernel.org, sdharia@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, vikrams@codeaurora.org, shankerd@codeaurora.org Subject: Re: [PATCH] net: emac: emac gigabit ethernet controller driver Message-ID: <20151207164750.62992b54@gavidov-lnx.qualcomm.com> In-Reply-To: <56661730.4050801@openwrt.org> References: <1449529094-10922-1-git-send-email-gavidov@codeaurora.org> <56661730.4050801@openwrt.org> Organization: Qualcomm Innovation Center, Inc. X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 954 Lines: 30 On Tue, 8 Dec 2015 00:33:04 +0100 Felix Fietkau 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/