linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alastair D'Silva" <alastair@d-silva.org>
To: "'David Laight'" <David.Laight@ACULAB.COM>,
	"'Petr Mladek'" <pmladek@suse.com>
Cc: "'Alastair D'Silva'" <alastair@au1.ibm.com>,
	"'Jani Nikula'" <jani.nikula@linux.intel.com>,
	"'Joonas Lahtinen'" <joonas.lahtinen@linux.intel.com>,
	"'Rodrigo Vivi'" <rodrigo.vivi@intel.com>,
	"'David Airlie'" <airlied@linux.ie>,
	"'Daniel Vetter'" <daniel@ffwll.ch>,
	"'Karsten Keil'" <isdn@linux-pingi.de>,
	"'Jassi Brar'" <jassisinghbrar@gmail.com>,
	"'Tom Lendacky'" <thomas.lendacky@amd.com>,
	"'David S. Miller'" <davem@davemloft.net>,
	"'Jose Abreu'" <Jose.Abreu@synopsys.com>,
	"'Kalle Valo'" <kvalo@codeaurora.org>,
	"'Stanislaw Gruszka'" <sgruszka@redhat.com>,
	"'Benson Leung'" <bleung@chromium.org>,
	"'Enric Balletbo i Serra'" <enric.balletbo@collabora.com>,
	"'James E.J. Bottomley'" <jejb@linux.ibm.com>,
	"'Martin K. Petersen'" <martin.petersen@oracle.com>,
	"'Greg Kroah-Hartman'" <gregkh@linuxfoundation.org>,
	"'Alexander Viro'" <viro@zeniv.linux.org.uk>,
	"'Sergey Senozhatsky'" <sergey.senozhatsky@gmail.com>,
	"'Steven Rostedt'" <rostedt@goodmis.org>,
	"'Andrew Morton'" <akpm@linux-foundation.org>,
	<intel-gfx@lists.freedesktop.org>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	<netdev@vger.kernel.org>, <ath10k@lists.infradead.org>,
	<linux-wireless@vger.kernel.org>, <linux-scsi@vger.kernel.org>,
	<linux-fbdev@vger.kernel.org>, <devel@driverdev.osuosl.org>,
	<linux-fsdevel@vger.kernel.org>
Subject: RE: [PATCH 3/4] lib/hexdump.c: Replace ascii bool in hex_dump_to_buffer with flags
Date: Mon, 15 Apr 2019 20:44:39 +1000	[thread overview]
Message-ID: <0db501d4f378$3bd50bb0$b37f2310$@d-silva.org> (raw)
In-Reply-To: <10c791893f034c26b4fee1a4659133e5@AcuMS.aculab.com>

> -----Original Message-----
> From: David Laight <David.Laight@ACULAB.COM>
> Sent: Monday, 15 April 2019 8:21 PM
> To: 'Alastair D'Silva' <alastair@d-silva.org>; 'Petr Mladek'
> <pmladek@suse.com>
> Cc: 'Alastair D'Silva' <alastair@au1.ibm.com>; 'Jani Nikula'
> <jani.nikula@linux.intel.com>; 'Joonas Lahtinen'
> <joonas.lahtinen@linux.intel.com>; 'Rodrigo Vivi' <rodrigo.vivi@intel.com>;
> 'David Airlie' <airlied@linux.ie>; 'Daniel Vetter' <daniel@ffwll.ch>; 'Karsten
> Keil' <isdn@linux-pingi.de>; 'Jassi Brar' <jassisinghbrar@gmail.com>; 'Tom
> Lendacky' <thomas.lendacky@amd.com>; 'David S. Miller'
> <davem@davemloft.net>; 'Jose Abreu' <Jose.Abreu@synopsys.com>; 'Kalle
> Valo' <kvalo@codeaurora.org>; 'Stanislaw Gruszka' <sgruszka@redhat.com>;
> 'Benson Leung' <bleung@chromium.org>; 'Enric Balletbo i Serra'
> <enric.balletbo@collabora.com>; 'James E.J. Bottomley'
> <jejb@linux.ibm.com>; 'Martin K. Petersen' <martin.petersen@oracle.com>;
> 'Greg Kroah-Hartman' <gregkh@linuxfoundation.org>; 'Alexander Viro'
> <viro@zeniv.linux.org.uk>; 'Sergey Senozhatsky'
> <sergey.senozhatsky@gmail.com>; 'Steven Rostedt'
> <rostedt@goodmis.org>; 'Andrew Morton' <akpm@linux-foundation.org>;
> intel-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-
> kernel@vger.kernel.org; netdev@vger.kernel.org;
> ath10k@lists.infradead.org; linux-wireless@vger.kernel.org; linux-
> scsi@vger.kernel.org; linux-fbdev@vger.kernel.org;
> devel@driverdev.osuosl.org; linux-fsdevel@vger.kernel.org
> Subject: RE: [PATCH 3/4] lib/hexdump.c: Replace ascii bool in
> hex_dump_to_buffer with flags
> 
> From: Alastair D'Silva
> > Sent: 15 April 2019 11:07
> ...
> > In the above example the author only wants the hex output, while in
> > other situations, both hex & ASCII output is desirable. If you just
> > want ASCII output, the caller should just use a printk or one of it's
> wrappers.
> 
> Hexdump will 'sanitise' the ASCII.
> 

This is functionality that doesn't exist in the current hexdump implementation (you always get the hex version).

I think a better option would be to factor out the sanitisation and expose that as a separate function.

> Although I think you'd want a 'no hex' flag to suppress the hex.
> 
> Probably more useful flags are ones to suppress the address column.

This is already supported by the prefix_type parameter - are you proposing that we eliminate the parameter & combine it with flags?

> I've also used flags to enable (or disable) suppression of multiple lines of
> zeros of constant bytes.
> In that case you may want hexdump to return the flags for the next call when
> a large buffer is being dumped in fragments.
 
I'm afraid I don't quite follow here, hex_dump_to_buffer doesn't alter the flags, so the caller already knows it. 

-- 
Alastair D'Silva           mob: 0423 762 819
skype: alastair_dsilva     msn: alastair@d-silva.org
blog: http://alastair.d-silva.org    Twitter: @EvilDeece





  reply	other threads:[~2019-04-15 10:44 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-10  3:17 [PATCH 0/4] Hexdump enhancements Alastair D'Silva
2019-04-10  3:17 ` [PATCH 1/4] lib/hexdump.c: Allow 64 bytes per line Alastair D'Silva
2019-04-12 13:48   ` Petr Mladek
2019-04-12 23:22     ` Alastair D'Silva
2019-04-15  9:02       ` Petr Mladek
2019-04-15 10:29         ` Alastair D'Silva
2019-04-15 10:56           ` David Laight
2019-04-15 10:59             ` Alastair D'Silva
2019-04-10  3:17 ` [PATCH 2/4] lib/hexdump.c: Optionally suppress lines of filler bytes Alastair D'Silva
2019-04-10  3:32   ` Alastair D'Silva
2019-04-12 14:03   ` Petr Mladek
2019-04-12 23:28     ` Alastair D'Silva
2019-04-15  9:18       ` Petr Mladek
2019-04-15 10:33         ` Alastair D'Silva
2019-04-10  3:17 ` [PATCH 3/4] lib/hexdump.c: Replace ascii bool in hex_dump_to_buffer with flags Alastair D'Silva
2019-04-10  6:56   ` Dan Carpenter
2019-04-12 14:12   ` Petr Mladek
2019-04-12 23:31     ` Alastair D'Silva
2019-04-15  9:24       ` Petr Mladek
2019-04-15 10:07         ` Alastair D'Silva
2019-04-15 10:20           ` David Laight
2019-04-15 10:44             ` Alastair D'Silva [this message]
2019-04-15 11:03               ` David Laight
2019-04-15 11:12                 ` Alastair D'Silva
2019-04-12 14:47   ` [Intel-gfx] " Tvrtko Ursulin
2019-04-10  3:17 ` [PATCH 4/4] lib/hexdump.c: Allow multiple groups to be separated by lines '|' Alastair D'Silva
2019-04-10  8:45   ` David Laight
2019-04-10  9:52     ` Alastair D'Silva
2019-04-10  8:53   ` Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='0db501d4f378$3bd50bb0$b37f2310$@d-silva.org' \
    --to=alastair@d-silva.org \
    --cc=David.Laight@ACULAB.COM \
    --cc=Jose.Abreu@synopsys.com \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=alastair@au1.ibm.com \
    --cc=ath10k@lists.infradead.org \
    --cc=bleung@chromium.org \
    --cc=daniel@ffwll.ch \
    --cc=davem@davemloft.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=enric.balletbo@collabora.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=isdn@linux-pingi.de \
    --cc=jani.nikula@linux.intel.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=jejb@linux.ibm.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=sgruszka@redhat.com \
    --cc=thomas.lendacky@amd.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).