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 X-Spam-Level: X-Spam-Status: No, score=-19.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F9A4C433DB for ; Wed, 23 Dec 2020 20:35:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4285B224B2 for ; Wed, 23 Dec 2020 20:35:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728971AbgLWUf3 (ORCPT ); Wed, 23 Dec 2020 15:35:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41356 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726159AbgLWUf2 (ORCPT ); Wed, 23 Dec 2020 15:35:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608755642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OGTIr6a89HgqbH7yTRjoe+GO8SUBG8fEbsZOo6NPZe4=; b=DaouclyTsWoBtEwdNOh2dyUvLtlOblBlTLBR+b/uF58lCUj1BGC67EdPri5eiEho6i/rby dG2Uoslcz8c80Bpq0IcSh4gBmf06MJtNcwi74+UA7ucFAPQp4tIeOh3gsNCCdKjERHMYhI iPw6uatNMzkRL4utP3j/Ri/KcxqmKJw= Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-47-bMZlSnvjNMyjWwHgnLF5Gg-1; Wed, 23 Dec 2020 15:34:00 -0500 X-MC-Unique: bMZlSnvjNMyjWwHgnLF5Gg-1 Received: by mail-ot1-f71.google.com with SMTP id j22so103813otq.16 for ; Wed, 23 Dec 2020 12:34:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=OGTIr6a89HgqbH7yTRjoe+GO8SUBG8fEbsZOo6NPZe4=; b=JdJPiZZLk+1NB+ZnMAIJfG6g4AWc64ED9+RyPgCBNlCbqaWBe0GIKcyPxj1H5fJ4M3 kvjkbzenHqRh0YbxxDcJlbNy3AMgSqbuzs0+uegbaz0F8CKcs+TC0NBSCnQWauvc9sGC +DNIUCxg9u354GcOilWxOiFZG9RdY2fYLt/ToPzXbsvm8TuD7OUbM4uZPFkqjcHc8axc zuXQLI8jLrUVcoC6b1vgWbzCrYlXBQ45Z3xHqVdEpuTf/3Cfgp37PV9lDI8T5eGLWLFj q5kwvNw0fIqBOnSmZWOv/0iOgY5V6yMqmJbJ+aG0fzXrKoFSD7Gjv7NSw92yLUpsWX9t hL8Q== X-Gm-Message-State: AOAM53347I2xxozXaRp2NdHSDdPLjSuFbsCfx7uXgYiq1TKAkPQREFlp k7VU4y0HkktpHYCF8IzpEUwzimQVTVNURMTCZQffeeOQaD55QUCfZwvdC/NK6Sf/N1oHZ7hZmVj tZQA778R3YGdUjVvuJKKOmtUnTgV+bIMlyBQEOTNmEPwlkdmXNDuygT0RZsRAKvtHM7g5z/E= X-Received: by 2002:a4a:c503:: with SMTP id i3mr18716560ooq.6.1608755639610; Wed, 23 Dec 2020 12:33:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJztzzfuO6HS1xto1fsgsDfbSz1aW7zP99Tr8269WBaPCFtrQ4oY+gCF7HuJrdOsZ5o4XkjCBA== X-Received: by 2002:a4a:c503:: with SMTP id i3mr18716549ooq.6.1608755639308; Wed, 23 Dec 2020 12:33:59 -0800 (PST) Received: from trix.remote.csb (075-142-250-213.res.spectrum.com. [75.142.250.213]) by smtp.gmail.com with ESMTPSA id r204sm6128940oif.0.2020.12.23.12.33.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Dec 2020 12:33:58 -0800 (PST) Subject: Re: [PATCH] amd-xgbe: remove h from printk format specifier To: Joe Perches , thomas.lendacky@amd.com, davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20201223194345.125205-1-trix@redhat.com> <46b3bba25d09e89471048ae119a2c3b460b6b7be.camel@perches.com> From: Tom Rix Message-ID: Date: Wed, 23 Dec 2020 12:33:56 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <46b3bba25d09e89471048ae119a2c3b460b6b7be.camel@perches.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/23/20 12:14 PM, Joe Perches wrote: > On Wed, 2020-12-23 at 11:43 -0800, trix@redhat.com wrote: >> From: Tom Rix >> >> This change fixes the checkpatch warning described in this commit >> commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]") >> >> Standard integer promotion is already done and %hx and %hhx is useless >> so do not encourage the use of %hh[xudi] or %h[xudi]. > Why only xgbe-ethtool? > > Perhaps your script only converts direct uses of functions > marked with __printf and not any uses of the same functions > via macros. The fixer may have issues. A works as designed by not desired is it only fixes what it compiles and if a macro is #if-def away then it will not do the fix.  This is troublesome for the the *_debug() routines.  So I am rejecting files with partial fixes. It is also likely I missed adding __printf attributes. There will be enough changes for this pass through to count as my feat of strength for today. Tom > $ git grep -P '%[\w\d\.]*h\w' drivers/net/ethernet/amd/xgbe/ > drivers/net/ethernet/amd/xgbe/xgbe-dcb.c: "TC%u: tx_bw=%hhu, rx_bw=%hhu, tsa=%hhu\n", i, > drivers/net/ethernet/amd/xgbe/xgbe-dcb.c: netif_dbg(pdata, drv, netdev, "PRIO%u: TC=%hhu\n", i, > drivers/net/ethernet/amd/xgbe/xgbe-dcb.c: "unsupported TSA algorithm (%hhu)\n", > drivers/net/ethernet/amd/xgbe/xgbe-dcb.c: "cap=%hhu, en=%#hhx, mbc=%hhu, delay=%hhu\n", > drivers/net/ethernet/amd/xgbe/xgbe-dev.c: netif_dbg(pdata, drv, pdata->netdev, "VXLAN tunnel id set to %hx\n", > drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c: netdev_err(netdev, "invalid phy address %hhu\n", > drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c: netdev_err(netdev, "unsupported autoneg %hhu\n", > drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c: netdev_err(netdev, "unsupported duplex %hhu\n", > >> Signed-off-by: Tom Rix >> --- >>  drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c | 6 +++--- >>  1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c >> index 61f39a0e04f9..3c18f26bf2a5 100644 >> --- a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c >> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c >> @@ -339,14 +339,14 @@ static int xgbe_set_link_ksettings(struct net_device *netdev, >>   speed = cmd->base.speed; >>   >> >>   if (cmd->base.phy_address != pdata->phy.address) { >> - netdev_err(netdev, "invalid phy address %hhu\n", >> + netdev_err(netdev, "invalid phy address %u\n", >>   cmd->base.phy_address); >>   return -EINVAL; >>   } >>   >> >>   if ((cmd->base.autoneg != AUTONEG_ENABLE) && >>   (cmd->base.autoneg != AUTONEG_DISABLE)) { >> - netdev_err(netdev, "unsupported autoneg %hhu\n", >> + netdev_err(netdev, "unsupported autoneg %u\n", >>   cmd->base.autoneg); >>   return -EINVAL; >>   } >> @@ -358,7 +358,7 @@ static int xgbe_set_link_ksettings(struct net_device *netdev, >>   } >>   >> >>   if (cmd->base.duplex != DUPLEX_FULL) { >> - netdev_err(netdev, "unsupported duplex %hhu\n", >> + netdev_err(netdev, "unsupported duplex %u\n", >>   cmd->base.duplex); >>   return -EINVAL; >>   } >