Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1694685yba; Fri, 17 May 2019 03:52:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyj4zNYiSxvu/BsZGiXL7R9YeL1SamlQKHsc55KR1IsWcyqIn5wzGXmxzp+T3av5f1RGCZo X-Received: by 2002:a65:418d:: with SMTP id a13mr15510726pgq.332.1558090332180; Fri, 17 May 2019 03:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558090332; cv=none; d=google.com; s=arc-20160816; b=ruFsoPOpZnnyw8X/TDojDTqULhvxtX6J+zOBJNhsXSPKMo1tpQj2nUN7nHorEfjCS7 dQ155vNv9eHbSSdT46U9IdojlRClYHI6eAozeAeoanGhAI2tPAtb8nGrCbxbXq1Hg+ah onX0YvecEGftz+QCJUf2pYG+Aagevn9Q3XtGHS9LJAFz7KNOq8BmihAQ5ACKkP4Nxo2t UzYBk8PbMmm/8oqWr3dUHAfPM3aqlwnxbKlbGnIvNppinGtHCIFHa+2sNKR/d6qjjeqV ZL02aVokBw6ftUB9I/FpK2iTM1UCHjaQ404HrXv75s9kdlKKDP9/TkoCGpKtd8HE/tZ4 iQQg== 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 :message-id:date:subject:cc:to:from; bh=9+SJ9o/2Ia98MBHLBP4wnNF0xaKL1E3z7CqNJi69g5Y=; b=XNlep/QdsNZSMMiVtUZLD22CbkAVakXiXMehKbSkI8XT9bQvLuWPYClXXM33kFwuto /6UVM0XbBsL5SJTMJTsQk9nIWfuG5qJRxEWpOcBWWZNdO8KBnwgpU+m9X+ImfEt95HpM Wv2LJPzmkmsMA6i7p4dLhJSk204jkh/8lyKuUQuP+4C5UDZWIrxkm/1lcixxVyj8nY95 l4aNlN0QzkhT7liTzUiuzpDpCPToDmaaDYN4XgiBdnzWE0yuwNepFCRB1AA86gbVfOWR TDwLtRqdzAHfqcwheJMWMqe7Ic0aLZP12EqP3u1oxttguavUaROip+a9belwq+5o9JTD dMqQ== 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 t10si7588105pgh.494.2019.05.17.03.51.56; Fri, 17 May 2019 03:52:12 -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 S1728519AbfEQKpT (ORCPT + 99 others); Fri, 17 May 2019 06:45:19 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:38469 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728406AbfEQKpT (ORCPT ); Fri, 17 May 2019 06:45:19 -0400 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hRaMX-0004R0-63; Fri, 17 May 2019 12:45:17 +0200 Received: from sha by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1hRaMW-0002i5-Oc; Fri, 17 May 2019 12:45:16 +0200 From: Sascha Hauer To: ecryptfs@vger.kernel.org Cc: Tyler Hicks , linux-kernel@vger.kernel.org, kernel@pengutronix.de, Sascha Hauer Subject: [PATCH] ecryptfs: use print_hex_dump_bytes for hexdump Date: Fri, 17 May 2019 12:45:15 +0200 Message-Id: <20190517104515.10371-1-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Kernel has nice hexdump facilities, use them rather a homebrew hexdump function. Signed-off-by: Sascha Hauer --- 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