Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1025653yba; Thu, 4 Apr 2019 02:42:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKfdc4rFBLdHMxCkiSwPec7DlqWkNWj84jKPlbCuapW4a4fX1HiW5DS/+suJxlYEnoBRva X-Received: by 2002:a17:902:2a29:: with SMTP id i38mr5418051plb.22.1554370960940; Thu, 04 Apr 2019 02:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554370960; cv=none; d=google.com; s=arc-20160816; b=qjY/IoErhl9z1EWNtYl3/mHwidyxW73DSJHQzsk6xyYgL3c+WS682jKm9mLjF/sGD2 +Lq2pQdoI6Z/e/eMEx40DQ1gzq455n/akA6wydAJU8vyLyFN2MJIFzFgacY8+NHFBPCL kTUdcvbvotO2crKlt/DfbxaFO7ks4dflelTR2HZivL5eRfoJcdje9oyPzfx9Q93FhCuY Q89se8EQCb3yHUz44NEbzzOzttPiulf3gLapcqn0+avQYQ8WGPbOBW3DvR2yFhcfhVJZ 8WrgSFm1mVqS4rfc+f4GzEgZ7kJx9DFrzAFplIfifHmJH71LuvTAgOZ6ARCfpoxzTZFB jPMA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=RV/y/LsVy6rYV1MqmPqdy4bjmLEYJqUiNc+B3nGGZJs=; b=aYBPwzjVbL5RkHfSNI9jkI0CN+05+UR7lewanhZUXzC8xLdhb6Iiddw3vz28POn8l2 PAp05oiIKd1vR5jxNN+frh7GXtHqEveRDvpN/Bvmqn71Md0Sqx+HSqKQqs3e7hSGE04L Njt7cgd51uIc82L8WA/rXT3W0S+7VlV9Cg4sCm7riyHxTZGB4p363zqr09fZhzX0pXvK wFj/KrYIQyEtXuXvww6kxkvZ8JbzcmgPWAolEgN39MKOW3SXsSLY6t11bb2Luv6fGfAX 1A1JLk0rtRoOOVCz464bLoFrMSDrEpgv3dnG9TTsj674dbUe6JFYRJTOBdO+fg3SVAJd dEcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nbXEKyxm; 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 137si16045802pge.63.2019.04.04.02.42.25; Thu, 04 Apr 2019 02:42:40 -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=@kernel.org header.s=default header.b=nbXEKyxm; 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 S1731497AbfDDJBv (ORCPT + 99 others); Thu, 4 Apr 2019 05:01:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:39024 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731007AbfDDJBt (ORCPT ); Thu, 4 Apr 2019 05:01:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8591721741; Thu, 4 Apr 2019 09:01:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368508; bh=858bbCwl64CoWtjXnTihhaeJHR1t1OlbGtsuwGH/MUg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nbXEKyxmhfUIhspGo2GwfZTjFmXl2bFFMrgJld3VveN3XkWf3mozcJj/b11tYx6vE u0LjuxG+s6hSyBG4E/gc8K81XGmur+DPJ/G4rKIYnVnm+HsB+IPCOb7Cn+RETHBKxY /vy0ixERdcqDaoBsS/gIm8Vq5aHpcHcVQgZHysvU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 065/187] e1000e: Fix -Wformat-truncation warnings Date: Thu, 4 Apr 2019 10:46:42 +0200 Message-Id: <20190404084606.119052776@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 135e7245479addc6b1f5d031e3d7e2ddb3d2b109 ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 3ba0c90e7055..e3945469b5c8 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, -- 2.19.1