Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9984410ybi; Wed, 24 Jul 2019 13:32:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyoXGaaDFtKuRPstaVSa2qYEl4k65bUI6Ci1tGRSwu7rQ/eGRskiNpJ5AifhJU6Q7R34rry X-Received: by 2002:a63:5459:: with SMTP id e25mr18086151pgm.366.1564000373952; Wed, 24 Jul 2019 13:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564000373; cv=none; d=google.com; s=arc-20160816; b=O+OuqSSll6JMYqpAC/n+5enEWYCg7cOszly3gmMBGaLMw1LGx0tzS/wOr+WaoLQ/yr 96ltXxPkRp325Z9Bd8ngDQP1nN54fDyAcf/9dNs5zZ2E/QP0blfTx/kcgQnDnx3ws+ES cN1k/GvcRrlmsp8cx36Aq4xtFt2deFKgyUTmlcXl47i/b4PlvaIIFT1DJ00nzDgmucpP vc/Yhw9jpBTOXILi1ShZxCOtK4sQ6nuM1DTF8qgasJoxP5NFovdkuf7AjsulWUAar9h+ xEmSb+/1+UjJQGAnP7JZnxaGqaZ/nx7o/knbNXzt5+4P7J7HjdDNoz05DAkmBHZxIGl/ 22dw== 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=4wgDx1KzHxqXCjBa+nIk9gZ3omGbU9Elw4KrXsQGCAc=; b=yuHfZe7SxP0iwalBG+E6C60OaknEE5BLzLwXLDpOu1fSoDTp/Me5OAPFjnHClVUxcf Xa25tkn2k0+nD2m5c6UfvyqJr0Yy3/HcJOyFPvRyhawto5CyTPE1vw53p7Hb0ZftH7tj ZEMCzBEmxm4z9rd0af58enBj881u3cPAi+HhnNeD2SXty5cdGOulepFlW6ogy7xTShSy IY6ktH/b7gMvjsayEcLWPLx5G25hiMe5nOn2zIb7LbuaA1YBsX9MXNJ6LrXx8xZuL8yz 9eeT0IqcleWeOX3xV9czNgUtzVVW+AkHa9ckI7To8CC5iJHYP/NUAOfaeAj06hYMbctO 3eFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mRNxtaGH; 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 v141si19406609pgb.183.2019.07.24.13.32.39; Wed, 24 Jul 2019 13:32:53 -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=mRNxtaGH; 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 S2389104AbfGXUaU (ORCPT + 99 others); Wed, 24 Jul 2019 16:30:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:53286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388565AbfGXTcD (ORCPT ); Wed, 24 Jul 2019 15:32:03 -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 A3F3D2238C; Wed, 24 Jul 2019 19:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996722; bh=y6Vc/BAK+Qw39T35MaVs1LJLETLoyxaz1hBqYAT28A8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mRNxtaGH8L+GwbMkPL2eLKCkylzVxe5H6F1Y7fdT9iCDBEh9vxY5IiCVOIwQCt7jZ B0HFNHuS2v96cYvKyIZOe/meBdTBKEjkNY29P7/QGxAULN38wWdfFAxkppaAxcc+TO C1nNrlN8OV+zKAvF2h5HOTDRHm74kE9ikCu8/0PQ= 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 5.2 193/413] net: hns3: fix a -Wformat-nonliteral compile warning Date: Wed, 24 Jul 2019 21:18:04 +0200 Message-Id: <20190724191748.436152459@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 645b9b3e0256..f661281de36b 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -552,8 +552,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