Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10424559ybi; Wed, 24 Jul 2019 22:59:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqNi/dNEmd3vmKSQDjYF928QWyv5tO8MBAIlesAdsLnHJMpfzrpcMZ4+vjCNh6WQmamI7L X-Received: by 2002:a63:f807:: with SMTP id n7mr87458542pgh.119.1564034384367; Wed, 24 Jul 2019 22:59:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034384; cv=none; d=google.com; s=arc-20160816; b=RWQKo6PrbtKy9jToT/aSLne3C81BseB3693lsec6vZFM6wtRFLGFay+bmWf7v8KT/7 84c5OY7KyTpvBWLSA7AEmmzNvi1voV63YRCjBYrTeIreBAsbQeA3CwF61f1dPlrUTdQf 3fqk5vkflWKCrymfV4Drhc+6txSaPamxPWbMe2VppQuAouiRpxEx8OMWf/b+RDdjGqyI 9k7QohTBJudhThkqzIYYB7y01YIySNcX4WEXuq71gulLy21OsjjAmjTb/wjfVlKmEl9H M5vZvDOqcdBNa6VQVVTQV7j5KhhMhYulBQUPL/KS6Y2GJesERyVN7tZGQ6cSW16v/P9H /+VA== 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=p/1FNt9ifoyYYx1Vlbt3Qg4ZEUR7/qwOg4qOfXuXt4E=; b=XFwr9UfsfQ/+jOmZIxUPYP9lj+Hg5RFIpVjVntui6Cy6bWfc7hqekrqk+sA/fEMCrb gMVF3ENim3JScrEN8vuaXt/oof14RUPL5lZvnd3reA6O/y1Mqg8ZkGSbmIvJDvVTrUo0 meJhRSIzvG7n2ScZGNx87/LYCjr1+M/AD56zuP0jV/Q7u5Od/mP0n8JYeTh77yb37g5m FGsvSlaTojup/yJGWkdAOeSv6tTe86fFEW7YoG8UJsEfaoTepYp1b4Zx3vCYP3wFwJfE NxBRIwlpG6tWKUePuDrH4wrhXF7xOxbtHjYKqf4WL5KWqNS+d+SgjO/7Tx3ftfunM6KL r57w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nzVqv3eg; 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 f7si7431632pgs.210.2019.07.24.22.59.29; Wed, 24 Jul 2019 22:59:44 -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=nzVqv3eg; 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 S2404843AbfGYFmL (ORCPT + 99 others); Thu, 25 Jul 2019 01:42:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:57082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404830AbfGYFmK (ORCPT ); Thu, 25 Jul 2019 01:42:10 -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 33DB621850; Thu, 25 Jul 2019 05:42:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033329; bh=I3Wqt9c23mGhj+9OrE5ctJWyRvD3B+593rBHj/RbxA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nzVqv3egRW1yQsrFtgjW4ZMDtbLkmoE/xrW2t0qrKczQleoOH52dEpcQbIeI05l4d 9IDJ2QskZAEsPiFBVjP4cIFRwREftKdM7Dmfab56oo4DclULPCe9erDSFiNEYiL6z2 QVq7VtlotV+CS6eRYB68Amd5JjCATF59LeOkd7VU= 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.19 129/271] net: hns3: fix a -Wformat-nonliteral compile warning Date: Wed, 24 Jul 2019 21:19:58 +0200 Message-Id: <20190724191706.299913954@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@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 4648c6a9d9e8..89ca69fa2b97 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -663,8 +663,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