From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH, RFC] byteorder: sanity check toolchain vs kernel endianess Date: Fri, 12 Apr 2019 16:55:38 +0200 Message-ID: <20190412145538.GA24473@lst.de> References: <20190412143538.11780-1-hch@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Arnd Bergmann Cc: Christoph Hellwig , Linus Torvalds , Andrew Morton , linux-arch , mick@ics.forth.gr, Linux Kernel Mailing List List-Id: linux-arch.vger.kernel.org On Fri, Apr 12, 2019 at 04:53:28PM +0200, Arnd Bergmann wrote: > On Fri, Apr 12, 2019 at 4:36 PM Christoph Hellwig wrote: > > > > When removing some dead big endian checks in the RISC-V code Nick > > suggested that we should have some generic sanity checks. I don't think > > we should have thos inside the RISC-V code, but maybe it might make > > sense to have these in the generic byteorder headers. Note that these > > are UAPI headers and some compilers might not actually define > > __BYTE_ORDER__, so we first check that it actually exists. > > > > Suggested-by: Nick Kossifidis > > Signed-off-by: Christoph Hellwig > > Acked-by: Arnd Bergmann > > Extra checking like this is good in general, but I'm not sure I see > exactly what kind of issue one might expect to prevent with this: I'm personally not worried at all. Just trying to respond to Nicks review comment and make it reasonable generic if we have to have these checks at all. I personally would be ok without them, I just don't want them hidden somewhere in the RISC-V code (RISC-V is always little endian at least right now). From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:43089 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726624AbfDLOzv (ORCPT ); Fri, 12 Apr 2019 10:55:51 -0400 Date: Fri, 12 Apr 2019 16:55:38 +0200 From: Christoph Hellwig Subject: Re: [PATCH, RFC] byteorder: sanity check toolchain vs kernel endianess Message-ID: <20190412145538.GA24473@lst.de> References: <20190412143538.11780-1-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Arnd Bergmann Cc: Christoph Hellwig , Linus Torvalds , Andrew Morton , linux-arch , mick@ics.forth.gr, Linux Kernel Mailing List Message-ID: <20190412145538._O0r8vQVBckqG4XWCNp-08WDR2jyawihxgUuNN1CRIY@z> On Fri, Apr 12, 2019 at 04:53:28PM +0200, Arnd Bergmann wrote: > On Fri, Apr 12, 2019 at 4:36 PM Christoph Hellwig wrote: > > > > When removing some dead big endian checks in the RISC-V code Nick > > suggested that we should have some generic sanity checks. I don't think > > we should have thos inside the RISC-V code, but maybe it might make > > sense to have these in the generic byteorder headers. Note that these > > are UAPI headers and some compilers might not actually define > > __BYTE_ORDER__, so we first check that it actually exists. > > > > Suggested-by: Nick Kossifidis > > Signed-off-by: Christoph Hellwig > > Acked-by: Arnd Bergmann > > Extra checking like this is good in general, but I'm not sure I see > exactly what kind of issue one might expect to prevent with this: I'm personally not worried at all. Just trying to respond to Nicks review comment and make it reasonable generic if we have to have these checks at all. I personally would be ok without them, I just don't want them hidden somewhere in the RISC-V code (RISC-V is always little endian at least right now).