Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2021330yba; Mon, 15 Apr 2019 03:21:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4QrqUCaYrqvEb3f/Ch8v/Y/L6VTYDQfvUkjkFfeYd/CJ8KzmbUeJ9YHw8vccVWQ6dQnwn X-Received: by 2002:a05:6a00:c1:: with SMTP id e1mr68145187pfj.143.1555323670779; Mon, 15 Apr 2019 03:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555323670; cv=none; d=google.com; s=arc-20160816; b=0rV4fCdNDcAGzU0/w1tOzMfMgI4kcWs6ra9eJ/aozt0/2sYHJ4ZQHy3JOtgUmvWqOv rcRSpoXoHQZXB9fjcxaCxaM+xvh8pThDnISCr44JbwfHJGsFL6pTQOV811AdrKPZi28c 9diAsxQ2x3CXXW0ar9PSSkxwYAnZBoZDTsZ6gDYN1qq97AGYI7UkpsKAtY9m5AG5af6M mITn7EFyYFfzJYHSF/vVLLtILQoETk+YnEYAMfDJgYrv3bZDjFyGHPPdL0OUYEG1r0wC X7XIgrYg8mchV+FlZ14lgVZWa4wAH60sIh2mV/cJEvRTAZQmi0YHZyregaqyVhywNFzH 3TQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=hIfw4r1T4qWRJ2acnT+gAx2kgeD2ZWFFRCpJ+01Qh8s=; b=krBZYe7Bnn1qyF6pBYPfVwUHfYeZ7NITwuULkG+UqgPD0wa8RV1qEy1v0oVRXaTzCH /suM89Et3RdR+AFwOe88uPbpd4pTzFXeXiV0043HAnMvGF+++HUgp4IvU1Qbgw5Ji4eB GY/fCJtzpJGs74O+SdCxL2ZoEt+8qdG51EdIXA+EyqE/7jt7MUM6F9RojiGzC/Cjgvjn 63vbWA5hU/eLAyZIV8SRMGdItc5IxpZKNjBNjHDdrQ3BtzTQ2W0PTH7cMFv6v3dM+mVq sQUeQK1Vt8bK/z/me7BTzGkT29wCvJb9Psnjx8eogXk5OcQZaPH3clp8qBLnUZuY6iaR dUcg== 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 m8si41989815pgp.68.2019.04.15.03.20.54; Mon, 15 Apr 2019 03:21:10 -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 S1727156AbfDOKTy convert rfc822-to-8bit (ORCPT + 99 others); Mon, 15 Apr 2019 06:19:54 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:31665 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726469AbfDOKTy (ORCPT ); Mon, 15 Apr 2019 06:19:54 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-144-yjSabL5nPTGzMfo5zyKITA-1; Mon, 15 Apr 2019 11:19:47 +0100 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 15 Apr 2019 11:20:57 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Mon, 15 Apr 2019 11:20:57 +0100 From: David Laight 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 Thread-Topic: [PATCH 3/4] lib/hexdump.c: Replace ascii bool in hex_dump_to_buffer with flags Thread-Index: AQMagew30YCVD5mEhyHx4HPts9xr1ALvlgN3AdorRAgCCza9VAHVj+h+o2yMYSCAAAOL8A== Date: Mon, 15 Apr 2019 10:20:56 +0000 Message-ID: <10c791893f034c26b4fee1a4659133e5@AcuMS.aculab.com> 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> In-Reply-To: <0da301d4f373$01d5bb80$05813280$@d-silva.org> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: yjSabL5nPTGzMfo5zyKITA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. 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. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)