Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4458588yba; Tue, 9 Apr 2019 20:21:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwILE9Hee925j4JsyhzfRUd9NyHmtXtzsVJVnjtoxtmLrWF1APCGBAD6Fmy8kIDTsm+yx3t X-Received: by 2002:a63:1c6:: with SMTP id 189mr39195456pgb.22.1554866502888; Tue, 09 Apr 2019 20:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554866502; cv=none; d=google.com; s=arc-20160816; b=ObGFQ+Yk7qNuL3uqi6bPgOqALKZiL3aG9IVN/1VML/j46YrS1v/Se8zStKRHzo02u8 Nr/0idTVVRryuPdV6FD1Exf4JqDF7RGiDTakx0oVIyvCjflgi1Rbl3cEl1jgFn4skyly 6Cwqaam9HDzjisEAhpVU+o5LD7Rk+xG+MNzK/OnDVJSB88Ie4FhQnlijMUbG84az7fGT XZ+LmQiuAuYTx8+JzZmnuTFXYZPZ/KwZnOe+SeWOJ/NmhW5MVkpgMTg7aIxHDXQ03/Yi erMR25h/enzqk+F85wbiYJPys8rrdijHnJ8EMB6JDKe/PiViPWD3URjXe1/k3ZqmZ3nC fTBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from; bh=3PYUP9eJ4onsWblXX4ZL4OtuacuBi0wBX7xuAQhr9BY=; b=hbT12HZXKMWPKgCCjs7cxoh+mKiQKKwu92kGnfHlPvQSC1hSM6nQKugFWoPBBd870d 4XYP3hieSA6OuvGIIDjURIpcArci7mLErrljKP3htJFEEgQhaBXZGl1IQY7mSdUCQtik B1M8tTd1EFG9xOQRKHCjpLKmU0kFlLqpACvlINN9eK9bZPTurkyl9nWqcvuNNmrywAFY yFkR8Q806HdMjsyoIV64Jak6ke7Hli6lKe0Q3QtA95d6tOJ1uEH/OxDrOdj1dpFz8bup HMEy3kPgu67MDKM5BKL2332LwHis23NOFeVAnceub6kjPrdizIKm/QQXe/tyNspS7Qyd duuQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12si31102999plp.47.2019.04.09.20.21.27; Tue, 09 Apr 2019 20:21:42 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727289AbfDJDSk (ORCPT + 99 others); Tue, 9 Apr 2019 23:18:40 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36846 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726894AbfDJDSD (ORCPT ); Tue, 9 Apr 2019 23:18:03 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3A3BXmu119118 for ; Tue, 9 Apr 2019 23:18:01 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2rs4eefsxr-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 09 Apr 2019 23:18:01 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Apr 2019 04:17:59 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 10 Apr 2019 04:17:50 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3A3HnHv47710454 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Apr 2019 03:17:49 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9E2E54C04A; Wed, 10 Apr 2019 03:17:49 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EE18E4C044; Wed, 10 Apr 2019 03:17:48 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 10 Apr 2019 03:17:48 +0000 (GMT) Received: from adsilva.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id BE626A0211; Wed, 10 Apr 2019 13:17:47 +1000 (AEST) From: "Alastair D'Silva" To: alastair@d-silva.org Cc: 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 , Petr Mladek , 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: [PATCH 1/4] lib/hexdump.c: Allow 64 bytes per line Date: Wed, 10 Apr 2019 13:17:17 +1000 X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190410031720.11067-1-alastair@au1.ibm.com> References: <20190410031720.11067-1-alastair@au1.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19041003-0028-0000-0000-0000035F20B8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19041003-0029-0000-0000-0000241E40D5 Message-Id: <20190410031720.11067-2-alastair@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-10_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904100022 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alastair D'Silva With modern high resolution screens, we can display more data, which makes life a bit easier when debugging. Allow 64 bytes to be dumped per line. Signed-off-by: Alastair D'Silva --- lib/hexdump.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/hexdump.c b/lib/hexdump.c index 81b70ed37209..b8a164814744 100644 --- a/lib/hexdump.c +++ b/lib/hexdump.c @@ -80,14 +80,14 @@ EXPORT_SYMBOL(bin2hex); * hex_dump_to_buffer - convert a blob of data to "hex ASCII" in memory * @buf: data blob to dump * @len: number of bytes in the @buf - * @rowsize: number of bytes to print per line; must be 16 or 32 + * @rowsize: number of bytes to print per line; must be 16, 32 or 64 * @groupsize: number of bytes to print at a time (1, 2, 4, 8; default = 1) * @linebuf: where to put the converted data * @linebuflen: total size of @linebuf, including space for terminating NUL * @ascii: include ASCII after the hex output * * hex_dump_to_buffer() works on one "line" of output at a time, i.e., - * 16 or 32 bytes of input data converted to hex + ASCII output. + * 16, 32 or 64 bytes of input data converted to hex + ASCII output. * * Given a buffer of u8 data, hex_dump_to_buffer() converts the input data * to a hex + ASCII dump at the supplied memory location. @@ -116,7 +116,7 @@ int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, int ascii_column; int ret; - if (rowsize != 16 && rowsize != 32) + if (rowsize != 16 && rowsize != 32 && rowsize != 64) rowsize = 16; if (len > rowsize) /* limit to one line at a time */ @@ -216,7 +216,7 @@ EXPORT_SYMBOL(hex_dump_to_buffer); * caller supplies trailing spaces for alignment if desired * @prefix_type: controls whether prefix of an offset, address, or none * is printed (%DUMP_PREFIX_OFFSET, %DUMP_PREFIX_ADDRESS, %DUMP_PREFIX_NONE) - * @rowsize: number of bytes to print per line; must be 16 or 32 + * @rowsize: number of bytes to print per line; must be 16, 32 or 64 * @groupsize: number of bytes to print at a time (1, 2, 4, 8; default = 1) * @buf: data blob to dump * @len: number of bytes in the @buf @@ -227,7 +227,7 @@ EXPORT_SYMBOL(hex_dump_to_buffer); * leading prefix. * * print_hex_dump() works on one "line" of output at a time, i.e., - * 16 or 32 bytes of input data converted to hex + ASCII output. + * 16, 32 or 64 bytes of input data converted to hex + ASCII output. * print_hex_dump() iterates over the entire input @buf, breaking it into * "line size" chunks to format and print. * @@ -246,9 +246,9 @@ void print_hex_dump(const char *level, const char *prefix_str, int prefix_type, { const u8 *ptr = buf; int i, linelen, remaining = len; - unsigned char linebuf[32 * 3 + 2 + 32 + 1]; + unsigned char linebuf[64 * 3 + 2 + 64 + 1]; - if (rowsize != 16 && rowsize != 32) + if (rowsize != 16 && rowsize != 32 && rowsize != 64) rowsize = 16; for (i = 0; i < len; i += rowsize) { -- 2.20.1