From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOIk2-0005Ps-M9 for ath10k@lists.infradead.org; Wed, 08 May 2019 09:20:00 +0000 From: David Laight Subject: RE: [PATCH v2 4/7] lib/hexdump.c: Replace ascii bool in hex_dump_to_buffer with flags Date: Wed, 8 May 2019 09:19:51 +0000 Message-ID: References: <20190508070148.23130-1-alastair@au1.ibm.com> <20190508070148.23130-5-alastair@au1.ibm.com> In-Reply-To: <20190508070148.23130-5-alastair@au1.ibm.com> Content-Language: en-US MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ath10k" Errors-To: ath10k-bounces+kvalo=adurom.com@lists.infradead.org To: 'Alastair D'Silva' , "alastair@d-silva.org" Cc: "linux-fbdev@vger.kernel.org" , Stanislaw Gruszka , Petr Mladek , David Airlie , Joonas Lahtinen , "dri-devel@lists.freedesktop.org" , "devel@driverdev.osuosl.org" , "linux-scsi@vger.kernel.org" , Jassi Brar , "ath10k@lists.infradead.org" , "intel-gfx@lists.freedesktop.org" , Dan Carpenter , Jose Abreu , Tom Lendacky , "James E.J. Bottomley" , Jani Nikula , "linux-fsdevel@vger.kernel.org" , Steven Rostedt , Rodrigo Vivi , Benson Leung , Kalle Valo , Karsten Keil , "Martin K. Petersen" , Greg Kroah-Hartman , "linux-wireless@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Sergey Senozhatsky , Daniel Vetter , "netdev@vger.kernel.org" , Enric Balletbo i Serra , Andrew Morton , "David S. Miller" , Alexander Viro From: Alastair D'Silva > Sent: 08 May 2019 08:02 > To: alastair@d-silva.org ... > --- a/include/linux/printk.h > +++ b/include/linux/printk.h > @@ -480,13 +480,13 @@ enum { > DUMP_PREFIX_OFFSET > }; > > -extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, > - int groupsize, char *linebuf, size_t linebuflen, > - bool ascii); > - > #define HEXDUMP_ASCII (1 << 0) > #define HEXDUMP_SUPPRESS_REPEATED (1 << 1) These ought to be BIT(0) and BIT(1) > +extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, > + int groupsize, char *linebuf, size_t linebuflen, > + u64 flags); Why 'u64 flags' ? How many flags do you envisage ?? Your HEXDUMP_ASCII (etc) flags are currently signed values and might get sign extended causing grief. 'unsigned int flags' is probably sufficient. I've not really looked at the code, it seems OTT in places though. If someone copies it somewhere where the performance matters (I've user space code which is dominated by its tracing!) then you don't want all the function calls and conditionals even if you want some of the functionality. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k