Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp34962yba; Fri, 12 Apr 2019 16:32:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzgZ7/uj7g2JrSf46cx9r+k0PA4XgSYBJA6JA/S80KJOa1MhwkmmJf+iWc/xaNBqkewOdW X-Received: by 2002:a17:902:be09:: with SMTP id r9mr58210712pls.215.1555111950057; Fri, 12 Apr 2019 16:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555111950; cv=none; d=google.com; s=arc-20160816; b=0wkSJON1Ibty3k8DzNVmgeCxmqOLHR8eW1tlISPdp/nASnoI1aopbl4w7367ASBx6D RGdvk5IyY5MmLC8GRNrxiXbImAa3JP2DWrr9Kg2twgLaTQXgoHwsWIxx6+urRfA4pKir uL4AxpRaC4oYOvx9m9g/8/gZpFYyv2EhV6Oq9F+C8rx93VJLPcln7n1dhL89VWOo3pkR QMzjOJVp8uv0apnrhhE4F/Uee6rkC+moBBjQwZnJAnDFoD51LymD65YCJgDzRiq8rK7G rEHX2+kABVPuIrXPjB3tElw+ZClVyJnnAAGx9sHlF8cMMybpcSsuVVao6X9U+EQVed73 Fsag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:dkim-signature; bh=NL5fx0pRa6q5hzi9saJdSfW6iHEHDPcnE5s0aEdIx6E=; b=m+nO2sP3Q7IwCQHvpYjpo1R8uY6zHxEWp5GBdTPwLQRFxYtTLsuk8+jEOgVCQw0xHM p3hoB8n13pUy8a3BDd6i243/gjW7zWnnkH0UeD6X2tgSr87rRLzO2NNDonwH23fqpg5z zR8rQMmVWSdE0SCLi6fXKoaR49+6u4NuzAJdEzPCdDgJhssaakVvjGyRJgxhxWA4bApF eODol1yYhEaQ4oI46jf50I3a9HUwHtr9ATb09rbEuY32WBA714CrY3NBnD7mo/vBUK/8 yVb5LPZQ6VQU71S4Gmao2s3QD2Pd7lOIV0CAoQ/rtzswcxK6gyhTG3xHktb31dBob8dg /mWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@d-silva.org header.s=201810a header.b=BmHf4XQm; 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 f124si37886878pgc.596.2019.04.12.16.32.13; Fri, 12 Apr 2019 16:32:30 -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; dkim=pass header.i=@d-silva.org header.s=201810a header.b=BmHf4XQm; 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 S1727048AbfDLXbg (ORCPT + 99 others); Fri, 12 Apr 2019 19:31:36 -0400 Received: from ushosting.nmnhosting.com ([167.160.173.127]:53078 "EHLO ushosting.nmnhosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726788AbfDLXbf (ORCPT ); Fri, 12 Apr 2019 19:31:35 -0400 Received: from mail2.nmnhosting.com (unknown [202.169.106.97]) by ushosting.nmnhosting.com (Postfix) with ESMTPS id 3463D2F28FBF; Fri, 12 Apr 2019 19:31:32 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=d-silva.org; s=201810a; t=1555111893; bh=rimSzx0ZYGZZ5jb4ghIWV17gFb2jTDUA34yHd5IGqSw=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=BmHf4XQmvnirJmVQ0BTAgVUqos7dTFY+a+X0qYuhnCF6TK7GyHA0rFJPhAY7uu2a3 x+D5T0I2ra7etPwsRTl2wiCEOF7eOu4FBqo35lQySjhOIuwrcJ0qPf1kDkPxyjK38K 7A5B8NdUOvq1LPjDbNxRSxoEjypurheCaOV8T8Tx+ZYcv6pYZNojmiN/HQ4MH8O5xq 7ro/4yPZGSkS+1M57Ebbs/QvVKeRgp2F8Ztg8Eu2HFvOYIAacxeJ8wTajfclD71z2W +GXQfSGuQv7j4GBAG9/7yEZvhrFIvAWyYc1lYHwgJ93VPzp2e8B0aqMP/zgWA8SYD4 9ayqarDJFUMpz4HvfYhY+dCncyJKmXsIMPmaDTR6ah89MtOlAJ8+eGO8kUQeXtxlXF hFK+3AnQRca77X0oS6wLM3pB719GFPjweWEdjnbAoWlq0vAWoZIQI+ugxbuLJtoYRt kxGIGqLIPgBaQhMRu9lVy8zBH8t034fiZURri3a+LkDTzAJJEezF7XFpxXryFE2//P Jlw0ruVT+OCUm+7EPPtd/4CITmRWlf/PQNtwebTwXpvKJ+Ofw9TKggeON3mUdBHCS+ wUVLn+3Rs0Vz+6CW5zYqoWknEw1uu2PTtPQUXA9HfSyT8jOyvHHt2kIfE2PSi7/O9k QbALBi51LUi9HtlX1EmFRaOw= Received: from Hawking (ntp.lan [10.0.1.1]) (authenticated bits=0) by mail2.nmnhosting.com (8.15.2/8.15.2) with ESMTPSA id x3CNVRg7018852 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 13 Apr 2019 09:31:27 +1000 (AEST) (envelope-from alastair@d-silva.org) From: "Alastair D'Silva" To: "'Petr Mladek'" , "'Alastair D'Silva'" Cc: "'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'" , , , , , , , , , , References: <20190410031720.11067-1-alastair@au1.ibm.com> <20190410031720.11067-4-alastair@au1.ibm.com> <20190412141211.lvnz6wb7mwkykmxf@pathway.suse.cz> In-Reply-To: <20190412141211.lvnz6wb7mwkykmxf@pathway.suse.cz> Subject: RE: [PATCH 3/4] lib/hexdump.c: Replace ascii bool in hex_dump_to_buffer with flags Date: Sat, 13 Apr 2019 09:31:27 +1000 Message-ID: <093301d4f187$da0756a0$8e1603e0$@d-silva.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQMagew30YCVD5mEhyHx4HPts9xr1ALvlgN3AdorRAijh70pcA== Content-Language: en-au X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail2.nmnhosting.com [10.0.1.20]); Sat, 13 Apr 2019 09:31:28 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----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? > > 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 > > > --- > This email has been checked for viruses by AVG. > https://www.avg.com