Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3185306ybd; Mon, 24 Jun 2019 21:13:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQihcRPBF4MZB8ErYBOOMm+AYwgT/le+QejEvd/trn9C7+GGQSEnKMU0ILxv+s0RbtVtjU X-Received: by 2002:a17:90a:2641:: with SMTP id l59mr27469579pje.55.1561436037564; Mon, 24 Jun 2019 21:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561436037; cv=none; d=google.com; s=arc-20160816; b=EvMkbuYSdkhBGjFDWXJYIA4pdRtD2FU0ZM1NmCcbKmjuTkGfMpby4xBOf6ZLP43+CY ibB/tPYMWQZhW+0oJHangSTGTov+uIt+jdNK4DIqrrwhlsnvpG8oujCQM7C7Z/Xk3Py5 ipBFxLOjy8W3xetDfJ76yfduv89khqkaAcJDR1MQwil1//Dg9jIc1cQusKDM65hvyrFw sQZVe9+omaQiBvYTwC71/2jh+5CaWw+t7h1l/cDuIIrxGdHuxT9kEDP1CaAzeOgd81GV jYMeIJO8Drkk6b3rKhGp2M1brSeUdhpov1ZsV+1oE2QtzGiZ512XXJkO+dBiKugh/sLY suIQ== 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:date:subject:cc:to:from; bh=v0J5AHbvIG6zTO+/v9il2S7E2WzbTvM3eBWWUDMToS0=; b=oav3X6cNu7jOiEtr40OPHdZx/LJFh9QXYW2++so2PR4koHXTRIn7Y3WwlM1zR5lzwh qTxUl0lS4Bx1Z+urFHi3i4tc/Gonj+MiJSPZPSN1fBRPfxB8OUWnxOeMavzK1GvIL7a7 ztjJ+NoDQMvuaYILUJ7vi3HfJngKcORH4zowKbkzjJ+k/vGr7AbXB1wVg0W0GWFg46WG v7Q7926ihqs85Tna6qTDhOUDjjxaktrsyNVkn3ZppzErysA3BDley/Ct0nL1n1OyiuvE ttPCtJZGNNd0saeE1w7y03Ti+1oz1omMMWqQzSRkIav2p58iteWLcDkZXLupi1SadoY4 PU3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 a14si12753386pga.567.2019.06.24.21.13.42; Mon, 24 Jun 2019 21:13:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 S1728769AbfFYDTg (ORCPT + 99 others); Mon, 24 Jun 2019 23:19:36 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57934 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728535AbfFYDTf (ORCPT ); Mon, 24 Jun 2019 23:19:35 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5P36iQS072868 for ; Mon, 24 Jun 2019 23:19:35 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tb9pyc0c1-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 24 Jun 2019 23:19:34 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Jun 2019 04:19:31 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 25 Jun 2019 04:19:22 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5P3JLkE57212948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Jun 2019 03:19:21 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2310FAE057; Tue, 25 Jun 2019 03:19:21 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 76678AE056; Tue, 25 Jun 2019 03:19:20 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 25 Jun 2019 03:19:20 +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 1790BA01B9; Tue, 25 Jun 2019 13:19:19 +1000 (AEST) From: "Alastair D'Silva" To: alastair@d-silva.org Cc: Jani Nikula , 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 Subject: [PATCH v4 0/7] Hexdump Enhancements Date: Tue, 25 Jun 2019 13:17:19 +1000 X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19062503-0008-0000-0000-000002F6B5BD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19062503-0009-0000-0000-00002263E424 Message-Id: <20190625031726.12173-1-alastair@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-25_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=995 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906250024 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Alastair D'Silva Apologies for the large CC list, it's a heads up for those responsible for subsystems where a prototype change in generic code causes a change in those subsystems. This series enhances hexdump. These improve the readability of the dumped data in certain situations (eg. wide terminals are available, many lines of empty bytes exist, etc). The default behaviour of hexdump is unchanged, however, the prototype for hex_dump_to_buffer() has changed, and print_hex_dump() has been renamed to print_hex_dump_ext(), with a wrapper replacing it for compatibility with existing code, which would have been too invasive to change. Hexdump selftests have be run & confirmed passed. Changelog: V4: - Add missing header (linux/bits.h) - Fix comment formatting - Create hex_dump_to_buffer_ext & make hex_dump_to_buffer a wrapper V3: - Fix inline documention - use BIT macros - use u32 rather than u64 for flags V2: - Fix failing selftests - Fix precedence bug in 'Replace ascii bool in hex_dump_to_buffer...' - Remove hardcoded new lengths & instead relax the checks in hex_dump_to_buffer, allocating the buffer from the heap instead of the stack. - Replace the skipping of lines of 0x00/0xff with skipping lines of repeated characters, announcing what has been skipped. - Add spaces as an optional N-group separator - Allow byte ordering to be maintained when HEXDUMP_RETAIN_BYTE_ORDERING is set. - Updated selftests to cover 'Relax rowsize checks' & 'Optionally retain byte ordering' Alastair D'Silva (7): lib/hexdump.c: Fix selftests lib/hexdump.c: Relax rowsize checks in hex_dump_to_buffer lib/hexdump.c: Optionally suppress lines of repeated bytes lib/hexdump.c: Replace ascii bool in hex_dump_to_buffer with flags lib/hexdump.c: Allow multiple groups to be separated by lines '|' lib/hexdump.c: Allow multiple groups to be separated by spaces lib/hexdump.c: Optionally retain byte ordering drivers/gpu/drm/i915/intel_engine_cs.c | 5 +- drivers/isdn/hardware/mISDN/mISDNisar.c | 10 +- drivers/mailbox/mailbox-test.c | 8 +- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 2 +- .../net/ethernet/synopsys/dwc-xlgmac-common.c | 2 +- drivers/net/wireless/ath/ath10k/debug.c | 7 +- .../net/wireless/intel/iwlegacy/3945-mac.c | 4 +- drivers/platform/chrome/wilco_ec/debugfs.c | 10 +- drivers/scsi/scsi_logging.c | 8 +- drivers/staging/fbtft/fbtft-core.c | 2 +- fs/seq_file.c | 6 +- include/linux/printk.h | 75 ++++- lib/hexdump.c | 267 +++++++++++++++--- lib/test_hexdump.c | 154 +++++++--- 14 files changed, 438 insertions(+), 122 deletions(-) -- 2.21.0