From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B80FEB64D7 for ; Wed, 21 Jun 2023 17:10:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230298AbjFURKr (ORCPT ); Wed, 21 Jun 2023 13:10:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjFURKp (ORCPT ); Wed, 21 Jun 2023 13:10:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3094129 for ; Wed, 21 Jun 2023 10:10:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7F5B161626 for ; Wed, 21 Jun 2023 17:10:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DB25C433C0; Wed, 21 Jun 2023 17:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687367443; bh=qbttSnX61aRCfPZ9doviFJYcYAqStHfzS0R2tONpN9A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IlgxkyNgnp1V16aJEA+rLpAZS3Uq3r34cV6+czilUjkKDSBf9KQWcYXtYj6fT+2Qh L9EKe7trA6o/xYdTnGW/IyHpGgmMDOM+5ki54BbJQMCIzfukpV27yEu+p6sWxFFQAK f39c7wuBRI2yLN8i/ZYL5Galo2DfcrQLLhxyFYibzLZF6O/GWHseHrZL3c15wWTHnJ XqFGQVbxapHDpzn2PzVEVT3bIUA2LC8OAaSJVp4we/JpN9azytQWYOSoROHrGd9dFa STBbpHGB5LE6j5dd8hJ1UwylsgigizvDav9ylQ28RKN938rqzl8adCusle2jtQe2zy ctVUa+ybHvaoQ== Date: Wed, 21 Jun 2023 18:10:40 +0100 From: Lee Jones To: Andy Shevchenko Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/1] mfd: ipaq-micro: Use %*ph for printing hexdump of a small buffer Message-ID: <20230621171040.GK10378@google.com> References: <20230612212007.3621-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230612212007.3621-1-andriy.shevchenko@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Jun 2023, Andy Shevchenko wrote: > The kernel already has a helper to print a hexdump of a small > buffer via pointer extension. Use that instead of open coded > variant. That's not all you're doing is it? Nice try. 2 patches please. > In long term it helps to kill pr_cont() or at least narrow down > its use. > > Signed-off-by: Andy Shevchenko > --- > drivers/mfd/ipaq-micro.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c > index 6d3968458e81..57fb7874fc91 100644 > --- a/drivers/mfd/ipaq-micro.c > +++ b/drivers/mfd/ipaq-micro.c > @@ -131,10 +131,8 @@ static void micro_rx_msg(struct ipaq_micro *micro, u8 id, int len, u8 *data) > break; > default: > dev_err(micro->dev, > - "unknown msg %d [%d] ", id, len); > - for (i = 0; i < len; ++i) > - pr_cont("0x%02x ", data[i]); > - pr_cont("\n"); > + "unknown msg %d [%d] %*ph\n", id, len, len, data); > + break; > } > spin_unlock(µ->lock); > } > -- > 2.40.0.1.gaa8946217a0b > -- Lee Jones [李琼斯]