Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2010949lqt; Sun, 21 Apr 2024 20:31:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUhQXlPloKm08rog9Ygf1OSrqfpCRYJrqrUTrledgAkN7UvaOgZGNU4voTQjtTpNh5Pdxa/3GiGbOwNefGUPc+7X4rQpgqfZyz/BmWCog== X-Google-Smtp-Source: AGHT+IEpX5Yqjut6WpIg2GRtjyh9kZS9nwldn9d3SU98q1cadn434BJ+wRqXKAGkrQrX6JB58LqG X-Received: by 2002:a05:622a:253:b0:437:889f:1f5 with SMTP id c19-20020a05622a025300b00437889f01f5mr12421856qtx.45.1713756700960; Sun, 21 Apr 2024 20:31:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713756700; cv=pass; d=google.com; s=arc-20160816; b=0OxwMm72ZG9NIF62C1eaZo+UB5pOZQ/5nZcwKLhvdy0CA+HMnd2G7CbT68VUzEgyN/ 0acGdYc0sCX6xLh6Q/lAEYZjpmEcW77M3q30WDxRh/U4YNyzIcunT8SzMENS46LufEZt Hi2XFlEy9HovgD0F73zMDJn9zf2HLtGZ8gbD/k0Bv/WVChcpaquK8nglfybkJPo42M9k bCHpGJ3NoKKcc2DRGhQlr35sJOSAvjPv2IRMPoxYuGe08vKfeBjoMWI0Px3ODEDd6q7d nAgnBKA16aNE2iwhh2ryZ2sxsIaVlEmW93E4S/h4DuDgjQ2pn5qKvQFpyZymWFoLKyuO E+1g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Li3+1Ghj2slvXiv+/E7e/F9kDJtZLuXuC3BIKi+jfUc=; fh=/hCFmLDMs2/gelr4YAiKIFKg2J4QfwOCEAJearKNWI4=; b=QYrsdqHdFWy9v2cW9O4pjrFINx4vEE/TV/7oOe732g2NIzb+I+5M6xvqwCZCTychS4 jKHKa+jfL8y9PJT5+4WypejVp0poQMl6L3IuuOF9IFjTTV2k1jWbtQXY9Q7Mgct4Y0ig juWqkvq8bxNZQX8xRswK08KBpxa7/ul2u29oZo2ry7+r0drCn354glFSZHGfLYEu/zJi 2XKwB2bahlYWYZIkO/l5YCqOPxKrhVoPu85eORNREpwu4IIj2DP4Sdm2US/HGVDvqvuM 9SK6alhI5rw9gJP9KRMyTrI+ybdANKPXyLX75EzXcQUxUX306xXdFl6r4gwkG6mHhbUf o3QQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Er5qu7FT; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-152696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152696-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v19-20020ac85793000000b00437b7acf08asi8088238qta.165.2024.04.21.20.31.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 20:31:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Er5qu7FT; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-152696-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152696-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AD3071C209F3 for ; Mon, 22 Apr 2024 03:31:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1416D12E4D; Mon, 22 Apr 2024 03:31:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Er5qu7FT" Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8923DF49 for ; Mon, 22 Apr 2024 03:31:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713756683; cv=none; b=aMwTdOGUgy47NITI6DbNG70xjEUQW1g5c9nAq1MvSoQXrqL719kMti0nTcRPyD340HpB3WyyJ5KNAlL7c+5Bqz8ixPkfY1COhhEnNnqM6QSxzrW5aReJOZ8TikwaATHw1pfeZYfzdX1V6c+KOO27IrMqFCwYFa4B4Wv+viogJgI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713756683; c=relaxed/simple; bh=WgJQBh8J1Waa7dt3AUnqHF0bETc6Ofj/zz3UpXYRizY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=kJuvqhUOWh/Pv2HOYUMNRIKbdtgVXqdoOw5TaixDS+CF+tf+njtNescvoQKP6Id+3OTf0+YjN6TrWrGNRgDA2SGJ54LEXIv4zEVPcIceX3fRm3G5sRGNooODFX3PFii6vJYMkns288bEnMMXFHqy1ejUkiZagbI76a9OBGzj0UE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Er5qu7FT; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1e3ca4fe4cfso27271495ad.2 for ; Sun, 21 Apr 2024 20:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713756681; x=1714361481; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Li3+1Ghj2slvXiv+/E7e/F9kDJtZLuXuC3BIKi+jfUc=; b=Er5qu7FTKrIPEWR48uAEX1DLYS3VrpieX1PAzPUN2S1jtCYeQcEqGhZymduJGj6U+t avDkS3SfYje394nnAdXeQX9DD86J8sH2kAd0D1+HfnuqL41j/NULtAJF/IOyrCTFSox2 ftmMIQfgnDacyeH+vaHHqdWo2A1t+bRxe5UZhG/zO8bGNRKPjMuOYpUUiZVFCD74ZFua cNfatV6U+bwdYUHaTqJ6d07qjLw9/Y6X1UvoajhziCHJiemYdgFquIkaKqhzdlMcz2Me z84rjr7izdmwmlucBWp7PTsmCKwHRe/mByVCEso/21+FovunMHfQa0vnyomYhkZrVOdY eVLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713756681; x=1714361481; 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=Li3+1Ghj2slvXiv+/E7e/F9kDJtZLuXuC3BIKi+jfUc=; b=UVrZEJnlpmal+dNSvh9ZPpznEGjPBLZyQcOEBt2ZF3PL6Q5EDrRMseY9IRtCKL3VFi kbN2oxeEpXxvhq63uwtmv0DYrQrzDABTCTecpU/KM39f2il74CRgje/hfxKacI3EnCYO xmvvjOfzrCwFg7ZsQV/JyKuobll2JNxt5T3oiyxghWVJhJkfoqiqvyVnrYAI99jBMngC MS+ThNlrnunx1X6U81AGMLbe9DI9KtfqFHM9bZn9R6AQqBxpLZzT7mcgZf0ymsRWSymJ NuGstp1Dz9TDAVurTi0SKoqAdDtyiY6RW5K4DGkxWiBH0/V7OZKcTOEipcP216vubQFv zKpA== X-Forwarded-Encrypted: i=1; AJvYcCV/bgeXBAtS45wtDELaEnM1k3eVAkPS7yurk+HOK7b/rBpV1ggqUydugJuhpounEezv4z3qcoNwLnZ75MIBUEgvdM9ko6e+Vk2DCmpC X-Gm-Message-State: AOJu0YxNqAZRkd9CU1sOk5x53fUFbn24k2pWE277ke4Ft2JZZkKfRl9r YppEARBpVo3wTUObE3tn3Iuf3eQlIeA5U/QBn9hJvh4ZphrIXdvZi6Ox8ipMUYw= X-Received: by 2002:a17:903:244b:b0:1e5:5041:b18a with SMTP id l11-20020a170903244b00b001e55041b18amr11845236pls.40.1713756680930; Sun, 21 Apr 2024 20:31:20 -0700 (PDT) Received: from localhost ([122.172.87.52]) by smtp.gmail.com with ESMTPSA id w5-20020a1709029a8500b001e435350a7bsm6981020plp.259.2024.04.21.20.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 20:31:20 -0700 (PDT) From: Viresh Kumar To: "Rafael J. Wysocki" , Yangtao Li , Viresh Kumar , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-pm@vger.kernel.org, Vincent Guittot , kernel test robot , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] cpufreq: sun50i: Fix build warning around snprint() Date: Mon, 22 Apr 2024 09:01:09 +0530 Message-Id: <285de20a187f3e4baeb28f639b5bf55e914a3821.1713756666.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The Sun50i driver generates a warning with W=1: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=] Fix it by allocating a big enough array to print an integer. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202404191715.LDwMm2gP-lkp@intel.com/ Signed-off-by: Viresh Kumar --- drivers/cpufreq/sun50i-cpufreq-nvmem.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c index 30e5c337611c..cd50cea16a87 100644 --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c @@ -19,8 +19,6 @@ #include #include -#define MAX_NAME_LEN 7 - #define NVMEM_MASK 0x7 #define NVMEM_SHIFT 5 @@ -208,7 +206,7 @@ static int sun50i_cpufreq_get_efuse(void) static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) { int *opp_tokens; - char name[MAX_NAME_LEN]; + char name[] = "speedXXXXXXXXXXX"; /* Integers can take 11 chars max */ unsigned int cpu, supported_hw; struct dev_pm_opp_config config = {}; int speed; @@ -235,7 +233,7 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) config.supported_hw_count = 1; } - snprintf(name, MAX_NAME_LEN, "speed%d", speed); + snprintf(name, sizeof(name), "speed%d", speed); config.prop_name = name; for_each_possible_cpu(cpu) { -- 2.31.1.272.g89b43f80a514