Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2060081yba; Mon, 15 Apr 2019 04:13:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzF8MAJlbV5IR3J1wXcCAJzwITmR70cB3oqZbJeE0sjMwcGgiPh2E61c+de8OO/7hj9eTQB X-Received: by 2002:aa7:91c8:: with SMTP id z8mr75039977pfa.110.1555326807997; Mon, 15 Apr 2019 04:13:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555326807; cv=none; d=google.com; s=arc-20160816; b=kgMlAZ5l0SrKU34VKwm5ZyQMWi+ekig1E0/L1HRElNGfCX7pHuIGAyLP5i/1h4SJTF 1HRyZVL7tmupz7ecwgv1vEHvChEs3CPSn9+Jc3JbVJT74+bKKSvGtk+p0qkmNFiIbnwW Zl1qZmwi44rv+mfG+hTyMcFx+XYwCjLGfpt81r0HSP5pTI93WwATNkeuLP2L/UfsOE0s WtnAZeBhdfM8OP+Lz18pDZxzq0Wi1X3+Pm3kuarYYTL9ErrgeHLNKR0cYX84fwcVL6Wu pXCq5bAK+LDRTnPvpV3GZixKirAp9G9QUBQjZMxj9RYxSIWoRmh4U1Sf5o90oROnT2Bu MpHw== 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=g+7F8HBxk7k+gobr+MNYnyYXHlSL/BhPp/MpZuufMzM=; b=MhtD0vw7Qk/gx3fyVmsjQMnQqCD2iixjOVTjGNdfOgs5TJA1QlGXJhV+c/dyrbmDpU fabS0omhsMn1hGWqkBGMbk9rVjONLhR8WzW+e7XjGbOblNp3Y3kwEtj6CzMqObeC7fu1 5bo+Nv+76Li7rHwHv1/rzGBqJw2NAFA/X5ozn1Y1Se0diy2o13wFYvl0kyVMLJfCb+uy M0XcchwffevfIkkLcplcqBmjSRgXUDfV3G5HNHkdQEdey5WevGLfyGCaVJup174i45xO gDfp8U0mPgV/xOCFfVagI6iW04sf2654XU1ZZ4l2dZdTr9hk0KT/Vlq35W0kjtRuvcov cahA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@d-silva.org header.s=201810a header.b=bu4LN6BX; 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 y22si24443573pfo.49.2019.04.15.04.13.12; Mon, 15 Apr 2019 04:13:27 -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=bu4LN6BX; 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 S1727239AbfDOLMc (ORCPT + 99 others); Mon, 15 Apr 2019 07:12:32 -0400 Received: from ushosting.nmnhosting.com ([167.160.173.127]:52756 "EHLO ushosting.nmnhosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbfDOLMb (ORCPT ); Mon, 15 Apr 2019 07:12:31 -0400 Received: from mail2.nmnhosting.com (unknown [202.169.106.97]) by ushosting.nmnhosting.com (Postfix) with ESMTPS id B516F2F28FBB; Mon, 15 Apr 2019 07:12:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=d-silva.org; s=201810a; t=1555326747; bh=pxHNsAg7SxpGj3csbFKxz6IpHouP15X+N2zxz8nYFr0=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=bu4LN6BXYnOK96pfhAiJT7p9sabHfQPnof/WoBf6YOLvwQ0ex8liOKH5DYx5pgVSd BaMFL3KS2j7DcTKl+/yJGm9ek6q36PxkTTkJvQbPFU4gUaHtTYh9T/VYnzwKKNEXI/ WC2pWIcNZskjCX+E4T/4/fAHEUmQYhklT0O5HtLgwZ69OaU//z73msNJRF8dUUslAL /K3QIuBPNw24vk/z83DOssjqhm+h7RQsdQ1gagDDyPlZpOwxKQi+l4+FUK4hZu6Ood 1837DQkuCOdIgA3UC8VdaEM42fMQwWMMmJq4HgotdSKWXiqZ+xY+3gEoOt4RrJFEXK JAjO0QM+2eFuCn33r5LmhRW69yOVdDOGtOrciBf1vIgIW987FuU5pWJlqS1SkFqG5r DgaaS1Qcn+aTeh/ZjmNKh6SkM9+oxUh8L4eaUJgC/v6TQ8ybBzLCkCktyUBhyqfuvR V+e6NBR81FPe2jNqR80z/ko9KeLzTzj0cr1EognpJJdG/loKiMeyjgMwtgpTHdNBA5 023OIhFeMhIuqryfXFld9VO6Q4dUItUqsKP096XNrJ60TdsKJQRlCb3OtTdstWmTSj q0a22vO/sjRBWEmk6rDYtathLCdmI63yv2HHGgcHcwtla6prE/ANw8MZJvGzL2tODV 8Fa18rPT//scJtxx7+QjzOL4= 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 x3FBCHoT038851 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Apr 2019 21:12:18 +1000 (AEST) (envelope-from alastair@d-silva.org) From: "Alastair D'Silva" To: "'David Laight'" , "'Petr Mladek'" 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'" , , , , , , , , , , 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> <20190415092424.qos7d54nbyr5hphu@pathway.suse.cz> <0da301d4f373$01d5bb80$05813280$@d-silva.org> <10c791893f034c26b4fee1a4659133e5@AcuMS.aculab.com> <0db501d4f378$3bd50bb0$b37f2310$@d-silva.org> <42fb90eb9c8f4ede8a56a09be90218e3@AcuMS.aculab.com> In-Reply-To: <42fb90eb9c8f4ede8a56a09be90218e3@AcuMS.aculab.com> Subject: RE: [PATCH 3/4] lib/hexdump.c: Replace ascii bool in hex_dump_to_buffer with flags Date: Mon, 15 Apr 2019 21:12:15 +1000 Message-ID: <0dcb01d4f37c$17b948a0$472bd9e0$@d-silva.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQMagew30YCVD5mEhyHx4HPts9xr1ALvlgN3AdorRAgCCza9VAHVj+h+AtHj3ewBiV+EcAHzvSSDAcOaqPmjLAoDcA== 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]); Mon, 15 Apr 2019 21:12:21 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: David Laight > Sent: Monday, 15 April 2019 9:04 PM > To: 'Alastair D'Silva' ; 'Petr Mladek' > > 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 >=20 > From: Alastair D'Silva > > Sent: 15 April 2019 11:45 > ... > > > 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? >=20 > I was looking at the flags on one of my hexdump() functions... >=20 > > > 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. >=20 > If you are suppressing lines of zeros and dumping a buffer in several = blocks > then subsequent calls need to know that the last line of the previous = call was > suppressed zeros - and carry on with the same suppressed block. Why wouldn't you do this with a single call to print_hex_dump? (that is = where the repeated lines are suppressed) That will already take chunks of the buffer until the whole thing is = output, in what situation do you see a caller chunking the access = themselves? --=20 Alastair D'Silva mob: 0423 762 819 skype: alastair_dsilva msn: alastair@d-silva.org blog: http://alastair.d-silva.org Twitter: @EvilDeece