Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1784417ybi; Thu, 20 Jun 2019 03:48:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXoSX7KMUs7ZD+Akf3xQnBEcykYfzRsWyMJHRXLb+JD+eu1HDy1hOnVeX3qFQhk8JlqnUc X-Received: by 2002:a17:90a:7146:: with SMTP id g6mr2417008pjs.45.1561027697944; Thu, 20 Jun 2019 03:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561027697; cv=none; d=google.com; s=arc-20160816; b=neaVgELmONm3hEZoPwJZvxlCwi8erzhabp4b0je8tIvSfKst5OR/pxGodqSG7FvKyi EoSawcvAJemVUpG2Qy6UBZDMI7lGKW0+8nlRC0czxPV2Gskm0zYN9zXlsIllwsFttZYx SvY6sE40jD3IIPJbifMGvG+z2TZ1P+TAHhwgWLU5HKfByQzmgfrUwgDR7UpaZzKNn2r3 KzqOd48TGxRQ5gR6uVttNkf1Qf7ep7LT59bK2bH5X7RvM65TjiqEvrv8BeG1IgC5pLXb ve8fW10m3eS2M6x4BiG0h8SwAJtGkoHaMReqO/pgfFY3EjfTiGOgIZQ9p48timQOIhul iIUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from; bh=guEZfP6zNzEZIRlZYfb6ubAYdIP8SrJp5vG/pgtgcf4=; b=BZ5W1ESLhQBEXa8gXENlGxLltbFIL0HuSYXJI9xqYa80kSY4GEkRxAb+pSQB5mJxP0 ujyETTH00qQaLvcy1sJv9lLRYxIQyfyJRS4vk0XroFL68xOy9TPIDijucmFdAIbpkTlT oOyPwL6wZtALrzwOVyG+dAZ4d+5wqDXEROHOXtyZFLGh5etW8fBgYJVspO4iRwFTgaLI h+Ma7Ds/mdpn5yD6vKB80vZgRuE+NDpxf/QYD0Qf/C8ycvv7wydB8pR+9/ie0lxSZd4R erYanbWHjnnHYeW0hzpIGkDHixnI4pcjQ9hq1hnqZeZyjX0UraOMdnDi+RW3ecc4oR2z qF+A== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si17672790plo.396.2019.06.20.03.48.02; Thu, 20 Jun 2019 03:48:17 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731119AbfFTKru (ORCPT + 99 others); Thu, 20 Jun 2019 06:47:50 -0400 Received: from mga04.intel.com ([192.55.52.120]:63311 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfFTKru (ORCPT ); Thu, 20 Jun 2019 06:47:50 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jun 2019 03:47:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,396,1557212400"; d="scan'208";a="181838324" Received: from jnikula-mobl3.fi.intel.com (HELO localhost) ([10.237.66.150]) by fmsmga001.fm.intel.com with ESMTP; 20 Jun 2019 03:47:41 -0700 From: Jani Nikula To: Joe Perches , Alastair D'Silva Cc: 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: Re: [PATCH v3 0/7] Hexdump Enhancements In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20190617020430.8708-1-alastair@au1.ibm.com> <9a000734375c0801fc16b71f4be1235f9b857772.camel@perches.com> <9456ca2a4ae827635bb6d864e5095a9e51f2ac45.camel@d-silva.org> Date: Thu, 20 Jun 2019 13:50:33 +0300 Message-ID: <87sgs4sf7q.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Jun 2019, Joe Perches wrote: > On Thu, 2019-06-20 at 11:14 +1000, Alastair D'Silva wrote: >> On Wed, 2019-06-19 at 17:35 -0700, Joe Perches wrote: >> > On Thu, 2019-06-20 at 09:15 +1000, Alastair D'Silva wrote: >> > > On Wed, 2019-06-19 at 09:31 -0700, Joe Perches wrote: >> > > > On Mon, 2019-06-17 at 12:04 +1000, Alastair D'Silva wrote: >> > > > > 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. >> > > > >> > > > Still not a fan of these patches. >> > > >> > > I'm afraid there's not too much action I can take on that, I'm >> > > happy to >> > > address specific issues though. >> > > >> > > > > These improve the readability of the dumped data in certain >> > > > > situations >> > > > > (eg. wide terminals are available, many lines of empty bytes >> > > > > exist, >> > > > > etc). >> > >> > I think it's generally overkill for the desired uses. >> >> I understand where you're coming from, however, these patches make it a >> lot easier to work with large chucks of binary data. I think it makes >> more sense to have these patches upstream, even though committed code >> may not necessarily have all the features enabled, as it means that >> devs won't have to apply out-of-tree patches during development to make >> larger dumps manageable. >> >> > > > Changing hexdump's last argument from bool to int is odd. >> > > > >> > > >> > > Think of it as replacing a single boolean with many booleans. >> > >> > I understand it. It's odd. >> > >> > I would rather not have a mixture of true, false, and apparently >> > random collections of bitfields like 0xd or 0b1011 or their >> > equivalent or'd defines. >> > >> >> Where's the mixture? What would you propose instead? > > create a hex_dump_to_buffer_ext with a new argument > and a new static inline for the old hex_dump_to_buffer > without modifying the argument list that calls > hex_dump_to_buffer with whatever added argument content > you need. > > Something like: > > static inline > int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, > int groupsize, char *linebuf, size_t linebuflen, > bool ascii) > { > return hex_dump_to_buffer_ext(buf, len, rowsize, groupsize, > linebuf, linebuflen, ascii, 0); > } > > and remove EXPORT_SYMBOL(hex_dump_to_buffer) If you decide to do something like this, I'd actually suggest you drop the bool ascii parameter from hex_dump_to_buffer() altogether, and replace the callers that do require ascii with hex_dump_to_buffer_ext(..., HEXDUMP_ASCII). Even if that also requires touching all callers. But no strong opinions, really. BR, Jani. -- Jani Nikula, Intel Open Source Graphics Center