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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable 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 91F42C433E6 for ; Wed, 30 Dec 2020 06:50:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4199C21BE5 for ; Wed, 30 Dec 2020 06:50:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726317AbgL3GuP (ORCPT ); Wed, 30 Dec 2020 01:50:15 -0500 Received: from smtprelay0131.hostedemail.com ([216.40.44.131]:48084 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726203AbgL3GuP (ORCPT ); Wed, 30 Dec 2020 01:50:15 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id C3A88180A7FCD; Wed, 30 Dec 2020 06:49:33 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: angle06_3e022d3274a3 X-Filterd-Recvd-Size: 2065 Received: from [192.168.1.159] (unknown [47.151.137.21]) (Authenticated sender: joe@perches.com) by omf15.hostedemail.com (Postfix) with ESMTPA; Wed, 30 Dec 2020 06:49:32 +0000 (UTC) Message-ID: <42f953220e40a2e32540f729f03b762610b35a42.camel@perches.com> Subject: Re: [PATCH] liquidio: fix: warning: %u in format string (no. 3) requires 'unsigned int' but the argument type is 'signed int'. From: Joe Perches To: YANG LI , davem@davemloft.net Cc: kuba@kernel.org, dchickles@marvell.com, sburla@marvell.com, fmanlunas@marvell.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 29 Dec 2020 22:49:31 -0800 In-Reply-To: <1609310480-80777-1-git-send-email-abaci-bugfix@linux.alibaba.com> References: <1609310480-80777-1-git-send-email-abaci-bugfix@linux.alibaba.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, 2020-12-30 at 14:41 +0800, YANG LI wrote: > For safety, modify '%u' to '%d' to keep the type consistent. There is no additional safety here. The for loop ensures that i is positive as num_ioq_vector is also int and so i can not be negative as it's incremented from 0. > diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c [] > @@ -1109,12 +1109,12 @@ int octeon_setup_interrupt(struct octeon_device *oct, u32 num_ioqs) >   for (i = 0 ; i < num_ioq_vectors ; i++) { >   if (OCTEON_CN23XX_PF(oct)) >   snprintf(&queue_irq_names[IRQ_NAME_OFF(i)], > - INTRNAMSIZ, "LiquidIO%u-pf%u-rxtx-%u", > + INTRNAMSIZ, "LiquidIO%u-pf%u-rxtx-%d", >   oct->octeon_id, oct->pf_num, i); >   > >   if (OCTEON_CN23XX_VF(oct)) >   snprintf(&queue_irq_names[IRQ_NAME_OFF(i)], > - INTRNAMSIZ, "LiquidIO%u-vf%u-rxtx-%u", > + INTRNAMSIZ, "LiquidIO%u-vf%u-rxtx-%d", >   oct->octeon_id, oct->vf_num, i); >   > >   irqret = request_irq(msix_entries[i].vector,