From patchwork Mon May 12 15:15:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 4159371 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9BCF1BFF02 for ; Mon, 12 May 2014 15:17:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CEE8F2020F for ; Mon, 12 May 2014 15:17:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F04C22016C for ; Mon, 12 May 2014 15:17:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758635AbaELPRQ (ORCPT ); Mon, 12 May 2014 11:17:16 -0400 Received: from mga01.intel.com ([192.55.52.88]:16707 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758430AbaELPRQ (ORCPT ); Mon, 12 May 2014 11:17:16 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 12 May 2014 08:15:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,1035,1389772800"; d="scan'208";a="530500333" Received: from smile.fi.intel.com ([10.237.72.73]) by fmsmga001.fm.intel.com with ESMTP; 12 May 2014 08:15:22 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.82) (envelope-from ) id 1Wjrwm-0004r4-SL; Mon, 12 May 2014 18:15:20 +0300 From: Andy Shevchenko To: Alexander Bokovoy , Jeff Layton , Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Cc: Andy Shevchenko Subject: [PATCH v2] cifs: call print_hex_dump instead of custom implementation Date: Mon, 12 May 2014 18:15:20 +0300 Message-Id: <1399907720-18622-1-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.0.0.rc2 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch converts custom dumper to use native print_hex_dump() instead. The dump will have a given label and addresses per each line which differs it from the original code. Signed-off-by: Andy Shevchenko Acked-by: Jeff Layton --- fs/cifs/cifs_debug.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index fa78b68..e7b87ce 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c @@ -34,27 +34,10 @@ void cifs_dump_mem(char *label, void *data, int length) { - int i, j; - int *intptr = data; - char *charptr = data; - char buf[10], line[80]; - printk(KERN_DEBUG "%s: dump of %d bytes of data at 0x%p\n", label, length, data); - for (i = 0; i < length; i += 16) { - line[0] = 0; - for (j = 0; (j < 4) && (i + j * 4 < length); j++) { - sprintf(buf, " %08x", intptr[i / 4 + j]); - strcat(line, buf); - } - buf[0] = ' '; - buf[2] = 0; - for (j = 0; (j < 16) && (i + j < length); j++) { - buf[1] = isprint(charptr[i + j]) ? charptr[i + j] : '.'; - strcat(line, buf); - } - printk(KERN_DEBUG "%s\n", line); - } + print_hex_dump(KERN_DEBUG, label, DUMP_PREFIX_ADDRESS, 16, 4, + data, length, true); } #ifdef CONFIG_CIFS_DEBUG