From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Subject: Re: [TRIVIAL PATCH] block: Correct misuses of 0x% Date: Mon, 03 Aug 2015 19:27:45 -0700 Message-ID: <1438655265.10829.0.camel@perches.com> References: <1438547113.29569.5.camel@perches.com> <9547AF94-2168-4987-AD89-B7F111084CC2@gmail.com> <1438589026.30149.15.camel@perches.com> <67B9124A-73E8-4AA1-81E5-18FAC69D3962@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: yalin wang Cc: Don Brace , open list , iss_storagedev@hp.com, storagedev@pmcs.com, linux-scsi List-Id: linux-scsi@vger.kernel.org On Tue, 2015-08-04 at 10:19 +0800, yalin wang wrote: > Ping ?=20 > > On Aug 3, 2015, at 16:56, yalin wang wro= te: > >=20 > >=20 > >> On Aug 3, 2015, at 16:03, Joe Perches wrote: > >>=20 > >> On Mon, 2015-08-03 at 15:25 +0800, yalin wang wrote: > >>>> On Aug 3, 2015, at 04:25, Joe Perches wrote: > >>>>=20 > >>>> Correct misuse of 0x%d in logging messages. > >>>>=20 > >> [] > >>> why not use like this : dev_dbg(&h->pdev->dev, " Max outstandin= g=20 > >>> commands =3D %#x\n=E2=80=9D ?=20 > >>> %#x will add 0x prefix automatically . > >>=20 > >> It's generally a consistency thing. > >> A 0 value would be emitted as 0 and not 0x0. > >>=20 > > i try on my ubuntu ,=20 > >=20 > > static int __init throtl_init(void) = = =20 > > { = =20 > > printk("module init test: %#x %p\n", 0, (void *)0x123); = =20 > > return 0; = =20 > >=20 > > } = =20 > >=20 > > module_init(throtl_init);=20 > >=20 > > #uname -a > > Linux ubuntu 3.16.0-38-generic #52~14.04.1-Ubuntu SMP Fri May 8 09:= 43:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux > >=20 > > #dmesg > > [259356.375586] module init test: 0x0 0000000000000123 > >=20 > > it seems don=E2=80=99t need 0x%x for 0, just need %#x for all numbe= rs. > > there are lots of use like this, i can change them if needed: > >=20 > > # egrep -r -i '0x%\d*x' . | wc -l=20 > > 11776 I suggest not, it's not a standard usage and the 0 may be unexpected.