From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 983A8C31E54 for ; Mon, 17 Jun 2019 04:07:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C1DC21873 for ; Mon, 17 Jun 2019 04:07:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (4096-bit key) header.d=d-silva.org header.i=@d-silva.org header.b="WCFaSA53" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726498AbfFQEHp (ORCPT ); Mon, 17 Jun 2019 00:07:45 -0400 Received: from ushosting.nmnhosting.com ([66.55.73.32]:44232 "EHLO ushosting.nmnhosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725440AbfFQEHo (ORCPT ); Mon, 17 Jun 2019 00:07:44 -0400 Received: from mail2.nmnhosting.com (unknown [202.169.106.97]) by ushosting.nmnhosting.com (Postfix) with ESMTPS id E75102DC007F; Mon, 17 Jun 2019 00:07:39 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=d-silva.org; s=201810a; t=1560744460; bh=fcIJWb9zFrSz2UB8a7mxef1I4k9iDutEwQyvrCEDLlQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=WCFaSA53OEIg+og8L/naQbQPlaTsOoXPKsvTwtmXP2Vk09oVK0XuS5AD3x5/CqLrM G0GIng39m1v0lZ4sKpUf3T99/+YBxM9RX44WLALuhESqgh+r5BAShy10176lEQBE3q DQvd2fgD6zwuDb2r3HtAMEKvNfyGEklzY4KUQ+U+VxMilUgRO+yfLfvjALw1DuedIj U07cuyKZx46E0NJINEB5+8FVHhYvvSWxSY7sKWAoGvSBG/TJ18P0TuXGu+r+H6bH0e aXUQ8ilJHofP52ff/zDalxsvFnS/I19R0WtGSyZHeql8nV+rZAy3ckW9tGr7DubBUl qpbsJvQK16Hb/jOSoEHhPkG1VKXuLKMb1qy/wzkUplRpkQy3lck+ggy2ukzRhUgkqh N1Q6mMJi30A9PGd1HWpWuLWkLg4LedcJItJ961IWPw6XnamogZOK4OajearEtq6Wug Q7fZpUvUrqSKSyRRBPeipKEoLRw/YY+95nWqf7l5GKHjuTC0GylNVU3e6c29Aa3j+X 5pRuwG5Xw/zIJlIzmObseyKrpDD4TC7M/3O2j/4ernSmXnXxPfSq1dRv9DqHM2oKIk cA8ovQOzGfvEiJha5fCrgByfWUnR6D8Ngp3/azplb/9QJOs0SiH1pg9yh8F/C3rFek 9RkRnoy0sArwZ3E9Df8kzHf0= Received: from adsilva.ozlabs.ibm.com (static-82-10.transact.net.au [122.99.82.10] (may be forged)) (authenticated bits=0) by mail2.nmnhosting.com (8.15.2/8.15.2) with ESMTPSA id x5H47CvI055927 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Mon, 17 Jun 2019 14:07:28 +1000 (AEST) (envelope-from alastair@d-silva.org) Message-ID: Subject: Re: [PATCH v3 3/7] lib/hexdump.c: Optionally suppress lines of repeated bytes From: "Alastair D'Silva" To: Jani Nikula Cc: Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Dan Carpenter , 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 , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , David Laight , 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 Date: Mon, 17 Jun 2019 14:07:12 +1000 In-Reply-To: <20190617020430.8708-4-alastair@au1.ibm.com> References: <20190617020430.8708-1-alastair@au1.ibm.com> <20190617020430.8708-4-alastair@au1.ibm.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.2 (3.32.2-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail2.nmnhosting.com [10.0.1.20]); Mon, 17 Jun 2019 14:07:35 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-06-17 at 12:04 +1000, Alastair D'Silva wrote: > From: Alastair D'Silva > > Some buffers may only be partially filled with useful data, while the > rest > is padded (typically with 0x00 or 0xff). > > This patch introduces a flag to allow the supression of lines of > repeated > bytes, which are replaced with '** Skipped %u bytes of value 0x%x **' > > An inline wrapper function is provided for backwards compatibility > with > existing code, which maintains the original behaviour. > > Signed-off-by: Alastair D'Silva > --- > include/linux/printk.h | 25 +++++++++--- > lib/hexdump.c | 91 ++++++++++++++++++++++++++++++++++++-- > ---- > 2 files changed, 99 insertions(+), 17 deletions(-) > > diff --git a/include/linux/printk.h b/include/linux/printk.h > index cefd374c47b1..d7754799cfe0 100644 > --- a/include/linux/printk.h > +++ b/include/linux/printk.h > @@ -481,13 +481,18 @@ enum { > DUMP_PREFIX_ADDRESS, > DUMP_PREFIX_OFFSET > }; > + > extern int hex_dump_to_buffer(const void *buf, size_t len, int > rowsize, > int groupsize, char *linebuf, size_t > linebuflen, > bool ascii); > + > +#define HEXDUMP_ASCII BIT(0) > +#define HEXDUMP_SUPPRESS_REPEATED BIT(1) > + This is missing the include of linux/bits.h, I'll fix this in the next version. -- Alastair D'Silva mob: 0423 762 819 skype: alastair_dsilva Twitter: @EvilDeece blog: http://alastair.d-silva.org