From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Subject: Re: [PATCH] vsprintf: Remove SPECIAL from pointer types Date: Mon, 07 Jul 2014 06:26:17 -0700 Message-ID: <1404739577.27043.65.camel@joe-AO725> References: <20140702.182807.1245632778216212860.davem@davemloft.net> <1404356734.14741.18.camel@joe-AO725> <1404364565.14741.26.camel@joe-AO725> <1404368746.14741.36.camel@joe-AO725> <1404576420.6384.41.camel@joe-AO725> <1404583739.6384.51.camel@joe-AO725> <1404585099.6384.53.camel@joe-AO725> <1404593114.6384.72.camel@joe-AO725> <063D6719AE5E284EB5DD2968C1650D6D1726D4E1@AcuExch.aculab.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Cc: "Maciej W. Rozycki" , Andrew Morton , Grant Likely , David Miller , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" To: David Laight Return-path: In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1726D4E1@AcuExch.aculab.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Mon, 2014-07-07 at 08:26 +0000, David Laight wrote: > From: Joe Perches > > Because gcc issues a complaint about any pointer format with %#p, > > remove the use of SPECIAL to prefix 0x to various pointer types. > > > > There are no uses in the kernel tree of %#p. > > I know you guys don't really care about them, but there might > be uses in out of tree drivers. > > With the change what is output for %#p ? Linux's output of %#p for normal, non %p extension use, continues to be prefixed with 0x and zero filled. Prior to this proposed change: %#p uses a fixed width of sizeof(void *) * 2 + 2. %p uses a fixed with of sizeof(void *) * 2 Post: %#p uses a variable width of the minimum of sizeof(void *) * 2 to sizeof(void *) * 2 + 2 depending on the high order 2 bytes of the pointer value. There is no in-kernel tree code that uses %#p so it has no net effect. Personally, I prefer %#p uses the "+ 2" fixed width. The real benefit is removing the auto-prefixing of 0x when using the %pa extension to be consistent with other naked pointer output types.