Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3157588ybi; Mon, 17 Jun 2019 17:57:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxL71cXsSkvPl6eW8V1esyZtYhrqYoriODWJ9RwvRtialzM1rGguSUOM1Vy/KfnJ3CczU4l X-Received: by 2002:a65:5889:: with SMTP id d9mr128643pgu.39.1560819478048; Mon, 17 Jun 2019 17:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560819478; cv=none; d=google.com; s=arc-20160816; b=wY6E7cKJ/uA/pHKKDdIY7pzPgvjUBFDP9EuDRPmIsGG7dBGGXgVIAeU30VJkBleLkI laM0Op0SKnDmdxvDnwVAlYb+SprZm+hj6Rr0+dLiAcsFzYij88OJyjpgUQAmHXgvBG0b xG1Kc0Q6FDdd3pFIgAwZ/7D1PTjTkmRHL14cd0cbAPZlVgR70hWoS1uTdoXQK70R8ZIZ gHaGr6f9pAM/ML7vGLTkenF0vSzeH5UNaSnKsSeKusRwgUE5G8phF2F8BL7s6HsLiQhw JEeSf7eqFDRcp93+eSe6HVeZAgsnamDo7RGOBKlnXnAW5roCNRp3MsuKV9bPTwY83NkR 7h7A== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=f8VOkSaWkQNDlxssR2p7eRhD7j8B35zJ7EjmgY9wEIE=; b=XvBCsdoqQkoDfuXNdi3zqIOcaTq0rAInuT8wPdqmxHMBvW83+pcMkWGaEIFoE4ZGCL +McIWRi1y3quZX4Gb1PkCNQPDnKPvZNKVmv2Nlz0gaXnZ/M1jzPe36UXwbliQl7QnMkh roOQ+poji6pLtYu69TxJxptaNSYIvHEqojFx4UHMHCX16/Xl9yO8Ali0Qor9czhorWCq WCzuoOUle8KUyhG/nrNqcfITtiMkGL8MgDGwpYc8dBpwClrLO44g4TyNlnlwauE/+tIX vsHBLY1fQJcERSLjwWjTC343rvn+mzUj3zqeHumtSaMSeM7YDQjyrdzDZ5iKwgUh0t0G fAHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@d-silva.org header.s=201810a header.b=jvSabEdr; 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 a24si176775pju.32.2019.06.17.17.57.43; Mon, 17 Jun 2019 17:57:58 -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; dkim=pass header.i=@d-silva.org header.s=201810a header.b=jvSabEdr; 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 S1727087AbfFRA5d (ORCPT + 99 others); Mon, 17 Jun 2019 20:57:33 -0400 Received: from ushosting.nmnhosting.com ([66.55.73.32]:35430 "EHLO ushosting.nmnhosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725829AbfFRA5d (ORCPT ); Mon, 17 Jun 2019 20:57:33 -0400 Received: from mail2.nmnhosting.com (unknown [202.169.106.97]) by ushosting.nmnhosting.com (Postfix) with ESMTPS id 2797C2DC0096; Mon, 17 Jun 2019 20:57:31 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=d-silva.org; s=201810a; t=1560819452; bh=u7VpYNn8JpTLdyHPUljh2Z7wehVtDH+n9nHQNgN6N2A=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=jvSabEdrNHOl7NlBGL5YcdZQfi+fpB9BO+GaqBWlR/PP+V/1JX3MOC/vdfprE+d4q W0UTx/depws8/q6fCe4qsmxzaHqtVkUa+v+Mp2PYjaUrKq1XeKLKJ3TPmwKDKYb7Ix tm9Ggg2c204E7SWf1Kzm3b7UURvQRUF+YtE1qaFXWb7M1bSsECs2dxPGyAy4TwdTwu YrzjrIAdGWVZDKXuSQHyDOqmmePgS4sV2lw+tlA9IZJRT1DXVvYEFcSGBy5FTId/0l fqkDcrBYmDhMWn+3CZbnwx7qgnLFWM0LDHsbAyxHAnRZtM+pOmK0XpTf0aiYcsAURz JAHTKkLHxAgXWfC3qIJOHW9mN0wLp5AYzfNmMC3C5ks7bZYsWq3PGnPXMMgDkMzyop xeuPVBo2+37GGuWiHd1PVStu6wl0eKfSBJgyWJvhXbnAdDsbuqzYFH9Boz+O6C1oWT 2Stkwa1MvSezs7en91awfFUNUzrvwbjOv/IZIK0ZFoGni+dz4kIbQSJzdLLHGKQkgV TVlkQn6TAJU90DRRiC92kuMldKfElutBjDwzhohJifPcEvF9T9IrE1SS4Zaz3ft2Rz ho6zF2/9j+ouJCRd5AcHglBo4L8CMDItufZhI5pCGZ7PhbKy0bPXekMmqRlgelk8er vDFIJF20+9ye5cMw79l/tHxg= Received: from adsilva.ozlabs.ibm.com (static-82-10.transact.net.au [122.99.82.10] (may be forged)) (authenticated bits=0) by mail2.nmnhosting.com (8.15.2/8.15.2) with ESMTPSA id x5I0v17n063106 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Tue, 18 Jun 2019 10:57:17 +1000 (AEST) (envelope-from alastair@d-silva.org) Message-ID: Subject: Re: [PATCH v3 2/7] lib/hexdump.c: Relax rowsize checks in hex_dump_to_buffer From: "Alastair D'Silva" To: Randy Dunlap 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 Date: Tue, 18 Jun 2019 10:57:00 +1000 In-Reply-To: <94413756-c927-a4ca-dd59-47e3cc87d58d@infradead.org> References: <20190617020430.8708-1-alastair@au1.ibm.com> <20190617020430.8708-3-alastair@au1.ibm.com> <94413756-c927-a4ca-dd59-47e3cc87d58d@infradead.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.2 (3.32.2-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail2.nmnhosting.com [10.0.1.20]); Tue, 18 Jun 2019 10:57:27 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-06-17 at 15:47 -0700, Randy Dunlap wrote: > Hi, > Just a comment style nit below... > > On 6/16/19 7:04 PM, Alastair D'Silva wrote: > > From: Alastair D'Silva > > > > This patch removes the hardcoded row limits and allows for > > other lengths. These lengths must still be a multiple of > > groupsize. > > > > This allows structs that are not 16/32 bytes to display on > > a single line. > > > > This patch also expands the self-tests to test row sizes > > up to 64 bytes (though they can now be arbitrarily long). > > > > Signed-off-by: Alastair D'Silva > > --- > > lib/hexdump.c | 48 ++++++++++++++++++++++++++++-------------- > > lib/test_hexdump.c | 52 ++++++++++++++++++++++++++++++++++++++-- > > ------ > > 2 files changed, 75 insertions(+), 25 deletions(-) > > > > diff --git a/lib/hexdump.c b/lib/hexdump.c > > index 81b70ed37209..3943507bc0e9 100644 > > --- a/lib/hexdump.c > > +++ b/lib/hexdump.c > > @@ -246,17 +248,29 @@ 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; > > + unsigned int linebuf_len; > > > > - if (rowsize != 16 && rowsize != 32) > > - rowsize = 16; > > + if (rowsize % groupsize) > > + rowsize -= rowsize % groupsize; > > + > > + /* Worst case line length: > > + * 2 hex chars + space per byte in, 2 spaces, 1 char per byte > > in, NULL > > + */ > > According to Documentation/process/coding-style.rst: > > The preferred style for long (multi-line) comments is: > > .. code-block:: c > > /* > * This is the preferred style for multi-line > * comments in the Linux kernel source code. > * Please use it consistently. > * > * Description: A column of asterisks on the left side, > * with beginning and ending almost-blank lines. > */ > Thanks Randy, I'll address this. -- Alastair D'Silva mob: 0423 762 819 skype: alastair_dsilva Twitter: @EvilDeece blog: http://alastair.d-silva.org