Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933105AbbLGXdY (ORCPT ); Mon, 7 Dec 2015 18:33:24 -0500 Received: from arrakis.dune.hu ([78.24.191.176]:36758 "EHLO arrakis.dune.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932730AbbLGXdW (ORCPT ); Mon, 7 Dec 2015 18:33:22 -0500 Subject: Re: [PATCH] net: emac: emac gigabit ethernet controller driver To: Gilad Avidov , gregkh@linuxfoundation.org, netdev@vger.kernel.org References: <1449529094-10922-1-git-send-email-gavidov@codeaurora.org> Cc: sdharia@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, vikrams@codeaurora.org, shankerd@codeaurora.org From: Felix Fietkau Message-ID: <56661730.4050801@openwrt.org> Date: Tue, 8 Dec 2015 00:33:04 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1449529094-10922-1-git-send-email-gavidov@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 759 Lines: 21 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 -- 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/