Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3785114ybi; Mon, 29 Jul 2019 12:34:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxONnX6+tJY0UFVRzagYGGZGyyTKAMN8aB3FsTi2O36AgVp7H1+hzU0+atyvH7C54ePXCSr X-Received: by 2002:a62:e910:: with SMTP id j16mr39251550pfh.123.1564428868262; Mon, 29 Jul 2019 12:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564428868; cv=none; d=google.com; s=arc-20160816; b=aaWmHUjvY3g1tFQ/Ia4Scj+SSmFcL+T3pHaGIZOR+cbPcF58klGAnHWEGr1kKYpGZi 2P3dYw2Pr7kPzcE+EHqU53ux+wZjeuNkzGizo/uTijzQafjAD/tZbl/ryFiEGn1HMpvD vBVWTyxBuQhkjmeVPMVboqTjx3KKQbuh/GczohL7WRFnUISu97ZAZWGHjkh+1nz+fFmX U8/ftrxuidg1Jt6QH2OTTqv6SxOpOJW37Q/D+4ITiR98JATPLLVTnRvE/z3NHBTlSI9J jeKHAyp/JY5m6sNYDVbv9GEej6LQBSfxuDjvTr6y5AvpiJsQ0IT56eFQ+nB5gmjPq+Ez CHNg== 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=nwMuSBflOPzHsdV7tuIUE50ejp/atTVCB6p5fZuWmi8=; b=wemxfAWLW7G5erIbPX3wZIsPm+Z4QWpj4+19hzn19G8m4ujPqCxgGlWbbFCttpqbYg WxY6FFdG/prwjrH2HmdL/IC/k8GjQiVWLnue8E2iYMH+qqw6L/Sij6oFZduiAmbkvPPm 1SGpkFTjiDPml0JZ2aZRldjXaQ+DSPiEyJP8XPZ9Y13nSnWhIvWsBiWgMmJZGz5SFKjK reAU6R9/JuXBAge+LkgpqDJ/r67+WmfZR7yi6mSHnA2Wzzx4ALDFG7LKHxbCre4mtLtw 6ra5erVQjBrTtpnvCZuHzxQOOjO67e54o2Dh9PmGaVkWdU85IKwXMu+RIS2jYKBM/i2R 0YoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dxgIawUZ; 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 x8si24994775pln.298.2019.07.29.12.34.13; Mon, 29 Jul 2019 12:34:28 -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=dxgIawUZ; 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 S1729968AbfG2T2E (ORCPT + 99 others); Mon, 29 Jul 2019 15:28:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:40724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727628AbfG2T2C (ORCPT ); Mon, 29 Jul 2019 15:28:02 -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 1DC8221773; Mon, 29 Jul 2019 19:28:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428481; bh=V7IVo0iwIu+sC7gWTWTEMn7Gmx6aLqUCMxmrNGlIN2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dxgIawUZhtBIzDq7tMOvkYSu1SmxvBUu4U5d7qN8MwCkLsowUsIcIThmlQE/Q2Fra 5wS1N1D/7nJRIneZyfuO/V9PuN8v5MedhEm+luxdIOlJgfk1nJXQB6LPbkFcXJxaWm 3JU2SaMcnwiSLdxxfXjA6ZYqItLEzjUqPTwzfjHY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yonglong Liu , Peng Li , Huazhong Tan , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 089/293] net: hns3: fix a -Wformat-nonliteral compile warning Date: Mon, 29 Jul 2019 21:19:40 +0200 Message-Id: <20190729190831.412957231@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit 18d219b783da61a6cc77581f55fc4af2fa16bc36 ] When setting -Wformat=2, there is a compiler warning like this: hclge_main.c:xxx:x: warning: format not a string literal and no format arguments [-Wformat-nonliteral] strs[i].desc); ^~~~ This patch adds missing format parameter "%s" to snprintf() to fix it. Fixes: 46a3df9f9718 ("Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Yonglong Liu Signed-off-by: Peng Li Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 654aad6e748b..86523e8993cb 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -619,8 +619,7 @@ static u8 *hclge_comm_get_strings(u32 stringset, return buff; for (i = 0; i < size; i++) { - snprintf(buff, ETH_GSTRING_LEN, - strs[i].desc); + snprintf(buff, ETH_GSTRING_LEN, "%s", strs[i].desc); buff = buff + ETH_GSTRING_LEN; } -- 2.20.1