Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1981952yba; Mon, 15 Apr 2019 02:26:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYtoBVh21f8oAGhoJz2uqva5oRXddXT2CQV7RUS56xbkWNe9fUCCQ2StsY/lLNIu940rBw X-Received: by 2002:a62:209c:: with SMTP id m28mr72575166pfj.233.1555320371974; Mon, 15 Apr 2019 02:26:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555320371; cv=none; d=google.com; s=arc-20160816; b=w77LE5e3Og7aOmmqTSuGEYCMBT+fH9aYTKUV6D0h/RF8Ty40qIuYziW973mKUbJrxd lZWurUZua9M8Sr3fDEOfAG2A6F++EtDqS1MSJQRMy8iUQ/BgsZz5trICnGZuGAHntban qnG340SkMOykoei1EICW55TAnqY13XTbYkvrqPID4+BWN2Y94oZOlfCxVeKpY7GVpzVu IQE8ALx6mloNoOZtAHIJcCWT0kQcl/SI4IFD2FHCWa1GOuDOCTqwB3VSCVzt88DKVdqn 7dSHFzs37/YMHS3rsW0xRnEDetfhjBY5pw8WeVU8+/YT05mqaLoGl9CzurIwsx06J93Q wDAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/fU+MLZGAHZ7ihNKzjeBeBpuc+dNQJX7upZW610KXvE=; b=MTNPvCOCOtpubzdnevVfQslSyx/tocVo/QU/JGg7WNDJs97oZgkKZgZhNGysRDwPMc Yhrr6POKDInVJIHYdGNEcVf7bo3E7EXpDTlkWwE1jMhxKGak6cK3ox9Qtkhiw9Gk3LxR EtOQrzXfYjK0GGYV742k7ozY3nqeZVmDVKsdDbIcyZOwNLI4HPTGU5ObQClljJnB4vxp 7HlVCYenW5iSvK3dOFvN/NWBgfvZExeCaVEH/Q4kVDvDbVq4XcwIl3Y1KACIMXdv8KKp t8Uv6P659ypoTymgNuztHSA0R7yxEBreSB0hSLFjS+xtYVegaKqpPyudzKZH3NCOgn5Y dWvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o82si36134271pfi.114.2019.04.15.02.25.55; Mon, 15 Apr 2019 02:26:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726751AbfDOJYd (ORCPT + 99 others); Mon, 15 Apr 2019 05:24:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:53656 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725798AbfDOJYc (ORCPT ); Mon, 15 Apr 2019 05:24:32 -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 697AEAFE8; Mon, 15 Apr 2019 09:24:29 +0000 (UTC) Date: Mon, 15 Apr 2019 11:24:24 +0200 From: Petr Mladek To: Alastair D'Silva Cc: 'Alastair D'Silva' , '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: <20190415092424.qos7d54nbyr5hphu@pathway.suse.cz> References: <20190410031720.11067-1-alastair@au1.ibm.com> <20190410031720.11067-4-alastair@au1.ibm.com> <20190412141211.lvnz6wb7mwkykmxf@pathway.suse.cz> <093301d4f187$da0756a0$8e1603e0$@d-silva.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <093301d4f187$da0756a0$8e1603e0$@d-silva.org> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 2019-04-13 09:31:27, Alastair D'Silva wrote: > > -----Original Message----- > > From: Petr Mladek > > Sent: Saturday, 13 April 2019 12:12 AM > > 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 > > > > 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 > > This feels unnecessary, and weird. Omitting the flag won't disable the hex > output (as expected), and if you don't want hex output why call hexdump in > the first place? Why do we have HEXDUMP_ASCII then? Why is the above funtion not using HEXDUMP_ASCII? Who would call it with (HEXDUMP_ASCII | HEXDUMP_BINARY)? Best Regards, Petr