From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aserp1040.oracle.com ([141.146.126.69]:48478 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753168AbdERGV3 (ORCPT ); Thu, 18 May 2017 02:21:29 -0400 Date: Wed, 17 May 2017 23:21:20 -0700 From: "Darrick J. Wong" Subject: Re: [PATCH 1/3] xfs: remove double-underscore integer types Message-ID: <20170518062120.GX4519@birch.djwong.org> References: <20170518012618.GT4519@birch.djwong.org> <20170518013043.GU4519@birch.djwong.org> <20170518060158.GP17542@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170518060158.GP17542@dastard> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Dave Chinner Cc: xfs , Eric Sandeen On Thu, May 18, 2017 at 04:01:58PM +1000, Dave Chinner wrote: > On Wed, May 17, 2017 at 06:30:43PM -0700, Darrick J. Wong wrote: > > This is a purely mechanical patch that removes the private > > __{u,}int{8,16,32,64}_t typedefs in favor of using the system > > {u,}int{8,16,32,64}_t typedefs. This is the sed script used to perform > > the transformation and fix the resulting whitespace and indentation > > errors: > > > > s/typedef\t__uint8_t/typedef __uint8_t\t/g > > s/typedef\t__uint/typedef __uint/g > > s/typedef\t__int\([0-9]*\)_t/typedef int\1_t\t/g > > s/__uint8_t\t/__uint8_t\t\t/g > > s/__uint/uint/g > > s/__int\([0-9]*\)_t\t/__int\1_t\t\t/g > > s/__int/int/g > > /^typedef.*int[0-9]*_t;$/d > > I'm not sure that this is entirely correct when it comes to sparse > endian notations or the way the __ types were intended to be used. > ISTR we used the __ types were originally for the in-memory endian > converted variable definitions that shadowed the on-disk structures. > The cleanup plan I was planning to do was to convert these all to > the linux kernel definitions of __[s,u][8,16,32,64] so it was clear > they shadow on disk structures of specific sizes. I do see the appeal of __be/__le -> __u in source code, though I also see that include/linux/types.h typedefs them together (uint16_t is __u16), though in my head the signedness and size are encode in the name so they're interchangeable. :) > Once that was done, everything else could be converted to c99 types > (like you've done above) and then we'd be free of all the old > __[u]int*_t types.... Well I /did/ leave the existing __[ui]{8,16,32,64} declarations alone since /most/ of them looked like incore versions of ondisk structures. Though truth be told there was a lot of code to look at! (Though I also wonder why you'd want to have mixed __u32 and uint32_t...) Anyway, let's see if anyone else bites. :) --D > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com > -- > To unsubscribe from this list: send the line "unsubscribe linux-xfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html