From patchwork Mon Jul 8 17:14:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Rapha=C3=ABl_Gallais-Pou?= X-Patchwork-Id: 13726927 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4BCAAC3271E for ; Mon, 8 Jul 2024 17:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=AH6LUdcBA2pznTYvrbFIdQvAbh5slbBjvxCpyNIT8HU=; b=M2NAGVFATbVeZlMIJ1pDeylNt6 ROq7ABNWAybFN5AjukRS3JB2kCeRfhyVsfn5FJX+vNNoRyqFSt1uZQhgrw6HwCViYpFjo7tViL0oF GK1oynvah6nd5Cgbe24k/KElVlboQmkI47Tga5Sra18Rc7wo7PdLEygtx7OQJto5j65H8/3ODF7bb 6bgI/AFwiey0ZAKArsPbz6E7issQEOwlaMJvIGuU47R4YmpFmPrpLSDqeEzFLGL8wGjuNxekKzYD+ w0L4zdeM2jdY0ymNEwmSHRWLNE9yYBC9x3yExfuFkqSOzrP6oxcjyiS2nsxrO7ds8C5tWl37LWFe6 vrs5QyVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sQrxD-00000004ZWq-1ljE; Mon, 08 Jul 2024 17:15:07 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sQrwx-00000004ZSk-2KeR for linux-arm-kernel@lists.infradead.org; Mon, 08 Jul 2024 17:14:53 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2eeb2d60efbso2999621fa.1 for ; Mon, 08 Jul 2024 10:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720458886; x=1721063686; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=AH6LUdcBA2pznTYvrbFIdQvAbh5slbBjvxCpyNIT8HU=; b=g/DICvYoGEw7fAllXQDbbQKwQz1v6kdwl5XxDjMw0gW/LrDddrbLkH6ieTlGNLdAKB kIGj5+wGTwOGkwiUz1G/cflSrBB/EyqUS0UUXdpv/6Q3h6++Yv5XXziOjDGFZLz3fYe5 RRxu95I9r2FA+ATxVCCBnnZnlxYEEeJsU0fIeu19m/q3olSDapxIkBZdyiQZzC0yU3KD 9zrl1sPVud+bTTZTbDTX4b6NtHwo/Ya/htsl3UVSTjQlbSrDEViAStPBbU9VudpDfbbd DsaAz/2NWdyj2UlLmQlA1agyBo256oh1u3YIK4+fMBoqYEBP38LCitmq0MXrKVaBMk5S WBww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720458886; x=1721063686; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AH6LUdcBA2pznTYvrbFIdQvAbh5slbBjvxCpyNIT8HU=; b=TT8W75+P1KSe4LKwWDktVEsbbq1dVBeUWQuL/Bp+7pWVGS6WBSSKExhjC9yqmQEHQb FWhZYuhu6c+SmYtlVaUK0qnYW4JKpTsbgkpGYxAo1YjFEU3b5C8/NcwxijMIO8s8gkm3 4/2vVzZ15tmTPbYDSNWnZzZ9ZHdyeFCvnOIMZ6UbneZ/pgQ5UbS2iP7P/YSaedzOVxCW TpxGzucDoN0aoBVO+ero8VaUPQ9XwBPJXQ9MI0E/g+coyKSmA964Ev2YhvidPw2by+mm LmCGoGUFGFwgevG2uRi/rAt2QxQfqIXuJoZZz27/K9bqb4/FVj45zfOyAEV2a8MwN/tJ XcdQ== X-Gm-Message-State: AOJu0YwGEaQqfss7JTLgNkgr6CLTs0cDD6fH1zSRlkoEcVR6y84V5ZdJ MxcAc6ebG/EQB1LWqEADygxXcOYwql5VOsQXmcxs7nWVxSb3t/7J X-Google-Smtp-Source: AGHT+IEN5DfkubDT5gfgqNhNr0gKh0isbiFIhj+wDr5xuXU5SvAS70bUQlCMHGeHRici2j9JlCnHmQ== X-Received: by 2002:a05:651c:4c9:b0:2ee:8171:8e13 with SMTP id 38308e7fff4ca-2eeb318a3a4mr2723491fa.44.1720458885961; Mon, 08 Jul 2024 10:14:45 -0700 (PDT) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4266f6f5a27sm6034055e9.23.2024.07.08.10.14.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jul 2024 10:14:45 -0700 (PDT) From: Raphael Gallais-Pou To: Patrice Chotard , "'Rafael J . Wysocki'" , Viresh Kumar Cc: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] cpufreq: sti: fix build warning Date: Mon, 8 Jul 2024 19:14:34 +0200 Message-ID: <20240708171434.111623-1-rgallaispou@gmail.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240708_101451_675699_5803B4BD X-CRM114-Status: GOOD ( 13.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Building this driver yields the following: .../drivers/cpufreq/sti-cpufreq.c:215:50: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=] 215 | snprintf(name, MAX_PCODE_NAME_LEN, pcode%d, pcode); | ^~ .../drivers/cpufreq/sti-cpufreq.c:215:44: note: directive argument in the range [0, 2147483647] 215 | snprintf(name, MAX_PCODE_NAME_LEN, pcode%d, pcode); | ^~~~~~~~~ .../drivers/cpufreq/sti-cpufreq.c:215:9: note: ‘snprintf’ output between 7 and 16 bytes into a destination of size 7 215 | snprintf(name, MAX_PCODE_NAME_LEN, pcode%d, pcode); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix the buffer size to avoid the warning at build time. Signed-off-by: Raphael Gallais-Pou --- drivers/cpufreq/sti-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c index 1ffa23dd8907..8e2e703c3865 100644 --- a/drivers/cpufreq/sti-cpufreq.c +++ b/drivers/cpufreq/sti-cpufreq.c @@ -18,7 +18,7 @@ #include #define VERSION_ELEMENTS 3 -#define MAX_PCODE_NAME_LEN 7 +#define MAX_PCODE_NAME_LEN 16 #define VERSION_SHIFT 28 #define HW_INFO_INDEX 1