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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham 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 94AC1C31E49 for ; Wed, 19 Jun 2019 06:36:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69E2F20B1F for ; Wed, 19 Jun 2019 06:36:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731027AbfFSGgC (ORCPT ); Wed, 19 Jun 2019 02:36:02 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:44105 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbfFSGgB (ORCPT ); Wed, 19 Jun 2019 02:36:01 -0400 Received: from 162-237-133-238.lightspeed.rcsntx.sbcglobal.net ([162.237.133.238] helo=lindsey) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hdUCN-0001ay-Kp; Wed, 19 Jun 2019 06:36:00 +0000 Date: Wed, 19 Jun 2019 01:35:56 -0500 From: Tyler Hicks To: Sascha Hauer Cc: ecryptfs@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH] ecryptfs: use print_hex_dump_bytes for hexdump Message-ID: <20190619063555.GC22021@lindsey> References: <20190517104515.10371-1-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190517104515.10371-1-s.hauer@pengutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-05-17 12:45:15, Sascha Hauer wrote: > The Kernel has nice hexdump facilities, use them rather a homebrew > hexdump function. > > Signed-off-by: Sascha Hauer Thanks! This is much nicer. I've pushed the commit to the eCryptfs next branch. Tyler > --- > fs/ecryptfs/debug.c | 22 +++------------------- > 1 file changed, 3 insertions(+), 19 deletions(-) > > diff --git a/fs/ecryptfs/debug.c b/fs/ecryptfs/debug.c > index 3d2bdf546ec6..ee9d8ac4a809 100644 > --- a/fs/ecryptfs/debug.c > +++ b/fs/ecryptfs/debug.c > @@ -97,25 +97,9 @@ void ecryptfs_dump_auth_tok(struct ecryptfs_auth_tok *auth_tok) > */ > void ecryptfs_dump_hex(char *data, int bytes) > { > - int i = 0; > - int add_newline = 1; > - > if (ecryptfs_verbosity < 1) > return; > - if (bytes != 0) { > - printk(KERN_DEBUG "0x%.2x.", (unsigned char)data[i]); > - i++; > - } > - while (i < bytes) { > - printk("0x%.2x.", (unsigned char)data[i]); > - i++; > - if (i % 16 == 0) { > - printk("\n"); > - add_newline = 0; > - } else > - add_newline = 1; > - } > - if (add_newline) > - printk("\n"); > -} > > + print_hex_dump(KERN_DEBUG, "ecryptfs: ", DUMP_PREFIX_OFFSET, 16, 1, > + data, bytes, false); > +} > -- > 2.20.1 >