Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp4758858imc; Mon, 25 Feb 2019 10:27:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IZEhxS33BheLj1aHjyJF8EVZdBLWE2h+S5+kJNYopV1HnfvlIbl7c/N74ZbBy1DPnapuJeo X-Received: by 2002:a62:e802:: with SMTP id c2mr20292797pfi.249.1551119222975; Mon, 25 Feb 2019 10:27:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551119222; cv=none; d=google.com; s=arc-20160816; b=Q6czq8pLVszWO6jfuJdVnoavQ7Ok+F0G2OOb+4jvJRQ7c37zEOn80jOSbYlsU7Ibpr 7cSQO8fG0MIX2lhQQptv4aQMSfmzVMerSyvf7SOMDbZo0LwEA3zXcHreRqiu3ZaAwSMO 5IQ6Qd2LLzrctK6XbP4f6CnyUfziy4I/8cWwvdjHwZ8vxf4CEdPjVO43EzSyJeoVM35B wyCG6BNv9BzdUNMDcXmfxtJF98Q3zJk1O9FauIv4pn3g9qt3uqH+2feho8qNCplE+KUP nOYkAWbymHu1Wfmta4Bu9+1tXYm8Eg2KKd5lBG50G8dJQa39EniBdy5G9/Y/+mFX/BRP iJRg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=56wSOBZOsMZbLdH23Lp/onixaNpAeUCmEEsajAKlPLM=; b=BEPqf3VCNkKMUs/2JCXtViqq/apHQlp0QLu4x9z6fujBKi5BftRY5z9BEpeSpfEynY vpAEJsBaE1nWf6pkj9W964tMK07afznYvRrX1NaPFlqEjWLvJ36rSoWyGym8Bi0EfJ2G vvigsU9SWBYM9Hhy5rGYDkMA1RtqdPyJgoUcNlkxPNUfIzWAWbNiTXiSm7lP5HLj8KSc URgCJ2T27T5bZEDbW6ingZaH9V6JByvMnDZFU4n4uxUtY9W0aM+AaG2tRC3Jkh88iUfg Um3CVNMjiU99wL0ktuhNzyjZpijjvi0Ef+KGlK0Sp1lnpy7NWPKzctAV8Q0h4liM8Gbm fXxQ== 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 91si10284761pla.89.2019.02.25.10.26.47; Mon, 25 Feb 2019 10:27:02 -0800 (PST) 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 S1728931AbfBYS0S (ORCPT + 99 others); Mon, 25 Feb 2019 13:26:18 -0500 Received: from mga11.intel.com ([192.55.52.93]:37968 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbfBYS0R (ORCPT ); Mon, 25 Feb 2019 13:26:17 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2019 10:26:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,412,1544515200"; d="scan'208";a="137084684" Received: from lrahamim-mobl1.ger.corp.intel.com ([10.255.197.83]) by orsmga002.jf.intel.com with ESMTP; 25 Feb 2019 10:26:14 -0800 Subject: Re: [Intel-wired-lan] [PATCH net-next 3/4] e1000e: Fix -Wformat-truncation warnings To: Florian Fainelli , netdev@vger.kernel.org Cc: open list , "moderated list:INTEL ETHERNET DRIVERS" , davem@davemloft.net References: <20190222040929.16657-1-f.fainelli@gmail.com> <20190222040929.16657-4-f.fainelli@gmail.com> From: "Neftin, Sasha" Message-ID: <69782768-4bba-6442-a1e4-3b019847e53b@intel.com> Date: Mon, 25 Feb 2019 20:26:13 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190222040929.16657-4-f.fainelli@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/02/2019 6:09, Florian Fainelli wrote: > Provide precision hints to snprintf() since we know the destination > buffer size of the RX/TX ring names are IFNAMSIZ + 5 - 1. This fixes the > following warnings: > > drivers/net/ethernet/intel/e1000e/netdev.c: In function > 'e1000_request_msix': > drivers/net/ethernet/intel/e1000e/netdev.c:2109:13: warning: 'snprintf' > output may be truncated before the last format character > [-Wformat-truncation=] > "%s-rx-0", netdev->name); > ^ > drivers/net/ethernet/intel/e1000e/netdev.c:2107:3: note: 'snprintf' > output between 6 and 21 bytes into a destination of size 20 > snprintf(adapter->rx_ring->name, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > sizeof(adapter->rx_ring->name) - 1, > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > "%s-rx-0", netdev->name); > ~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/net/ethernet/intel/e1000e/netdev.c:2125:13: warning: 'snprintf' > output may be truncated before the last format character > [-Wformat-truncation=] > "%s-tx-0", netdev->name); > ^ > drivers/net/ethernet/intel/e1000e/netdev.c:2123:3: note: 'snprintf' > output between 6 and 21 bytes into a destination of size 20 > snprintf(adapter->tx_ring->name, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > sizeof(adapter->tx_ring->name) - 1, > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > "%s-tx-0", netdev->name); > ~~~~~~~~~~~~~~~~~~~~~~~~ > > Signed-off-by: Florian Fainelli > --- > drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c > index 736fa51878f8..7acc61e4f645 100644 > --- a/drivers/net/ethernet/intel/e1000e/netdev.c > +++ b/drivers/net/ethernet/intel/e1000e/netdev.c > @@ -2106,7 +2106,7 @@ static int e1000_request_msix(struct e1000_adapter *adapter) > if (strlen(netdev->name) < (IFNAMSIZ - 5)) > snprintf(adapter->rx_ring->name, > sizeof(adapter->rx_ring->name) - 1, > - "%s-rx-0", netdev->name); > + "%.14s-rx-0", netdev->name); > else > memcpy(adapter->rx_ring->name, netdev->name, IFNAMSIZ); > err = request_irq(adapter->msix_entries[vector].vector, > @@ -2122,7 +2122,7 @@ static int e1000_request_msix(struct e1000_adapter *adapter) > if (strlen(netdev->name) < (IFNAMSIZ - 5)) > snprintf(adapter->tx_ring->name, > sizeof(adapter->tx_ring->name) - 1, > - "%s-tx-0", netdev->name); > + "%.14s-tx-0", netdev->name); > else > memcpy(adapter->tx_ring->name, netdev->name, IFNAMSIZ); > err = request_irq(adapter->msix_entries[vector].vector, > Acked-by: Sasha Neftin