Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_NEOMUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B78F3C10F0E for ; Fri, 12 Apr 2019 14:12:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D48020850 for ; Fri, 12 Apr 2019 14:12:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727032AbfDLOMS (ORCPT ); Fri, 12 Apr 2019 10:12:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:53600 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726327AbfDLOMP (ORCPT ); Fri, 12 Apr 2019 10:12:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7290BAD72; Fri, 12 Apr 2019 14:12:12 +0000 (UTC) Date: Fri, 12 Apr 2019 16:12:11 +0200 From: Petr Mladek To: Alastair D'Silva Cc: alastair@d-silva.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Karsten Keil , Jassi Brar , Tom Lendacky , "David S. Miller" , Jose Abreu , Kalle Valo , Stanislaw Gruszka , Benson Leung , Enric Balletbo i Serra , "James E.J. Bottomley" , "Martin K. Petersen" , Greg Kroah-Hartman , Alexander Viro , Sergey Senozhatsky , Steven Rostedt , Andrew Morton , 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 Message-ID: <20190412141211.lvnz6wb7mwkykmxf@pathway.suse.cz> References: <20190410031720.11067-1-alastair@au1.ibm.com> <20190410031720.11067-4-alastair@au1.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190410031720.11067-4-alastair@au1.ibm.com> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed 2019-04-10 13:17:19, Alastair D'Silva wrote: > From: Alastair D'Silva > > In order to support additional features in hex_dump_to_buffer, replace > the ascii bool parameter with flags. > > Signed-off-by: Alastair D'Silva > --- > drivers/gpu/drm/i915/intel_engine_cs.c | 2 +- > drivers/isdn/hardware/mISDN/mISDNisar.c | 6 ++++-- > drivers/mailbox/mailbox-test.c | 2 +- > drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 2 +- > drivers/net/ethernet/synopsys/dwc-xlgmac-common.c | 2 +- > drivers/net/wireless/ath/ath10k/debug.c | 3 ++- > drivers/net/wireless/intel/iwlegacy/3945-mac.c | 2 +- > drivers/platform/chrome/wilco_ec/debugfs.c | 3 ++- > drivers/scsi/scsi_logging.c | 8 +++----- > drivers/staging/fbtft/fbtft-core.c | 2 +- > fs/seq_file.c | 3 ++- > include/linux/printk.h | 2 +- > lib/hexdump.c | 15 ++++++++------- > lib/test_hexdump.c | 5 +++-- > 14 files changed, 31 insertions(+), 26 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c > index 49fa43ff02ba..fb133e729f9a 100644 > --- a/drivers/gpu/drm/i915/intel_engine_cs.c > +++ b/drivers/gpu/drm/i915/intel_engine_cs.c > @@ -1318,7 +1318,7 @@ static void hexdump(struct drm_printer *m, const void *buf, size_t len) > WARN_ON_ONCE(hex_dump_to_buffer(buf + pos, len - pos, > rowsize, sizeof(u32), > line, sizeof(line), > - false) >= sizeof(line)); > + 0) >= sizeof(line)); It might be more clear when we define: #define HEXDUMP_BINARY 0 > drm_printf(m, "[%04zx] %s\n", pos, line); > > prev = buf + pos; > diff --git a/include/linux/printk.h b/include/linux/printk.h > index c014e5573665..82975853c400 100644 > --- a/include/linux/printk.h > +++ b/include/linux/printk.h > @@ -493,7 +493,7 @@ enum { > > extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, > int groupsize, char *linebuf, size_t linebuflen, > - bool ascii); > + u64 flags); I wonder how fancy hex_dump could be. IMHO, u32 should be enough. The last famous words ;-) Best Regards, Petr