From patchwork Mon Jul 17 06:00:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hanyu001@208suo.com X-Patchwork-Id: 13316388 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from [183.242.55.162] (helo=mail.208.org) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qLHHa-002rKK-2f for linux-arm-kernel@lists.infradead.org; Mon, 17 Jul 2023 06:00:32 +0000 Received: from mail.208.org (email.208.org [127.0.0.1]) by mail.208.org (Postfix) with ESMTP id 4R4BJ163DGzBHXgk for ; Mon, 17 Jul 2023 14:00:01 +0800 (CST) Received: from mail.208.org ([127.0.0.1]) by mail.208.org (mail.208.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id BWXv2spRKRcE for ; Mon, 17 Jul 2023 14:00:01 +0800 (CST) MIME-Version: 1.0 Date: Mon, 17 Jul 2023 14:00:01 +0800 From: hanyu001@208suo.com Subject: [PATCH] arm: mm: Convert snprintf to scnprintf In-Reply-To: References: Message-ID: <0d07bc2edba6e0c8c1cd130366f1b417@208suo.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+lwn-linux-arm-kernel=archive.lwn.net@lists.infradead.org List-Archive: To: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Fix the coccicheck warning: ./arch/arm/mm/cache-l2x0-pmu.c:346:8-16: WARNING: use scnprintf or sprintf Signed-off-by: ztt <1549089851@qq.com> --- arch/arm/mm/cache-l2x0-pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) static umode_t l2x0_pmu_event_attr_is_visible(struct kobject *kobj, diff --git a/arch/arm/mm/cache-l2x0-pmu.c b/arch/arm/mm/cache-l2x0-pmu.c index 993fefdc167a..d20626451a2e 100644 --- a/arch/arm/mm/cache-l2x0-pmu.c +++ b/arch/arm/mm/cache-l2x0-pmu.c @@ -343,7 +343,7 @@ static ssize_t l2x0_pmu_event_show(struct device *dev, struct l2x0_event_attribute *lattr; lattr = container_of(attr, typeof(*lattr), attr); - return snprintf(buf, PAGE_SIZE, "config=0x%x\n", lattr->config); + return scnprintf(buf, PAGE_SIZE, "config=0x%x\n", lattr->config); }