Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2655858lqt; Mon, 22 Apr 2024 18:38:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVBV6yJkgxL+mRsVjoUVupgidRfZRrQW3TKm8VCjxoRbkEKMCpmmx0Pmxqytotr9JjN7y5bU54QTf6ZKwfZ/bfB8S1AnQWkRI33M3Sntg== X-Google-Smtp-Source: AGHT+IEIHeYAG2t3Dtm+mUck8T1wq+DTm2yBfK5JAgxrljHa+N83YdxP+bJKw/kNpcoCuJXOxRac X-Received: by 2002:a05:6358:5bc3:b0:183:e9f8:19ad with SMTP id i3-20020a0563585bc300b00183e9f819admr13583340rwf.18.1713836324923; Mon, 22 Apr 2024 18:38:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713836324; cv=pass; d=google.com; s=arc-20160816; b=Wxx69dVOOwSNSMrfnFyjpe9BwpDdXyTiSRdV0S1irCw5+zoKCDgZ+NsXxQBBOFNaO5 v8fLKL2r7uy3nyo4jmalHQCNejHlnJJ0RLfU/j8CiaO1Wdk7Y1FUdqHmhhFSJp+7z9Au x0GyD6S3sq1p3BFivcSWxc1E1u8Zv8RaAPFGvTHa6lbNP2640/Dy7dFE59XTJJPNm49f qvEE9ESUb7wz6duWmhs4dNH/AVpLhQOWb2UejvetZBQNW5QWzSFD0iDjcJfd6MQ9VZei 5+epWKkVfD9h3EuKEYiWOsTsZcC9KY4DAH65wXHB+R49OJqkDKNJassg0WqRpOrLpcsX hICQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=0rtki28GfeCNBbS4WQvcAXIspTIGgU1gSHxdtSjsBoQ=; fh=ozSoPf9mQMUmv2aPL+rSVIE4HL2uolOfQ41TR7LHyww=; b=SmpbCjjwjbDM0vjXIQINLpO9R2Impn2rY3wkukYxWBRfS6/k0s18Oy1O9aIzjP6x2b Rx4K+0R5xI45o6lPPRkGs0VlRKlWGD+5SpbKDpZFk7er+B+e8MEYvNTC9CqBaCVDFrwW j1pzHXQu5ARfmJ1T5H3omw8Hb2KLk806yknqjaJt/+itfKVTlp0HT8D2v5UB0OQO3QVK j6ObQIOOcW790lWwp7b1Hdo96rUuaVqUnDwviurYuV422ZlCy02Yw+J3NqUdsJeTcEJ3 h0BTQ0xFtaAy4KJ24pnatUn/r2R6I6exC55sqtCrK1mIqiuq8fv23dlmIgqT8ym9HOPJ rqnA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KV6U0IgY; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-154395-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h15-20020ac85e0f000000b004399b0a33acsi4786174qtx.375.2024.04.22.18.38.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 18:38:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154395-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=@gmail.com header.s=20230601 header.b=KV6U0IgY; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-154395-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 5B47F1C21313 for ; Tue, 23 Apr 2024 01:38:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4BEC0FC18; Tue, 23 Apr 2024 01:38:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KV6U0IgY" Received: from mail-oo1-f48.google.com (mail-oo1-f48.google.com [209.85.161.48]) (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 2C912125C0; Tue, 23 Apr 2024 01:38:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713836317; cv=none; b=VdC/THMxK6Audr0Prq3ghhpH/6rsXquUU4KZ0au6rHYz4oQWV4dEaQd+wrO2jeFtqOAxBUSl9UrQC973oFmd95gp2n5RqHJ8FeVPvuB3TETWbwG/h3XZn9IpDrwjCqVDcm4aAyLtd46Y6/VX710Qc2fclv6vuATnydqzCMGRceE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713836317; c=relaxed/simple; bh=C7wCWBdC6TfEVr3TjcsdkpMwWzcgG7xcQ19WyXxt6JQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=C3BO5LE795zt5HKW3/hctDK+c2lgKT34geOQ0dQwFERJpqFV73frIO2MO80eaFYhs5rQfByqeoSN+C3IbLujgOakMnMeiO8xX5WOn5NEPaWTiRnxG2/ox3pz+nAKeMZfAD1FKzbZshzoWZ+Nh9F/UC02x3WbHrHEv1lIelRZXQ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KV6U0IgY; arc=none smtp.client-ip=209.85.161.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f48.google.com with SMTP id 006d021491bc7-5aa20adda1dso3307687eaf.1; Mon, 22 Apr 2024 18:38:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713836315; x=1714441115; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=0rtki28GfeCNBbS4WQvcAXIspTIGgU1gSHxdtSjsBoQ=; b=KV6U0IgYxkTNCiqT9WovlNoHV92yFinLl0WZkn3DipJUfk6jw1Nlzqgh6cqg5Mixjd 2/dyrkbpjHNcgDKilUZhu8olZigHXmHzrz4Eb3Sqs60ivm56BBRhKE+t12zzEJpnzNkb yNgYAO0phnGBw3yP9AShswcE8tyzlJxCH2J8dYwrpGDpdyvVwySlnaob/HikbFO0nv+X /yKqQ6hfNVxcVTqcJa2VInVGMJRiC6H2apLA+csanHLe2uuch8/CW7JdLvuiybJuqhQN SadO2aacd7yppnNKkdxiLLXIH9xAq7luGLvlCtD4dFMAS3jUMAJVJLqU1Hr75tUR6V2i guhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713836315; x=1714441115; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0rtki28GfeCNBbS4WQvcAXIspTIGgU1gSHxdtSjsBoQ=; b=UdI3iip5ZILLFT1DkWm0dzR5AlNVq+an5Z5Ysy63KLrKrLvNmlzY15f+ixPtoVN9Ut F7up3XpNXVjOWxvUp8+NyIO7A12+EhQ6libfgIrTE2FsOICoi4yBbWiaOKF0bLiWASDU xQU2VZ/5pf9bqOGIpMJsaF2yQbEfPKYzT3ULlk+Zmjh4binufgt3rXLGmEw0Ke8xVEwq Lfl/YgWVDnd4QBGG1ki2jy+RKyIgdwOhV0ZkKme5pSYjWqcuwug8Vr7yqjpsy2mXDkfp I/CqE23Zb1c6Xh481Kwu9DxgHuhT1CIE/MFAhg4V72tH1wwmQzROhLV7sSrjcYFFLZOF EwjA== X-Forwarded-Encrypted: i=1; AJvYcCV39arVd4X70eVNQBAgiZ1ZBuOYFjy333uDYn2Z/JC1bDTTiCmiuxB+LiFrbE36JUa0zMtvXK2WVLI8eSbB48mBO8BxaQF2DoHSxmA+DfLZWgV9ljnv7x0iyetgZaPSvV2kRueXXUk= X-Gm-Message-State: AOJu0Yx5eKnPN+2UF94uRnECMw4XG3FFa6heiDD6pbbiBuMQq7XpPute d+1zWUT29DlCol5SO8A+L3iLErF0bNdMPZKywH8pEXutFssnW2Wfr44gLj1Wq7zYmDwPPKlFdet 9s1XrHUiIm6oUph6dL/taBktp2Sk= X-Received: by 2002:a05:6358:9792:b0:183:fb11:adeb with SMTP id f18-20020a056358979200b00183fb11adebmr15644866rwb.21.1713836315176; Mon, 22 Apr 2024 18:38:35 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <285de20a187f3e4baeb28f639b5bf55e914a3821.1713756666.git.viresh.kumar@linaro.org> In-Reply-To: <285de20a187f3e4baeb28f639b5bf55e914a3821.1713756666.git.viresh.kumar@linaro.org> From: Julian Calaby Date: Tue, 23 Apr 2024 11:38:24 +1000 Message-ID: Subject: Re: [PATCH] cpufreq: sun50i: Fix build warning around snprint() To: Viresh Kumar Cc: "Rafael J. Wysocki" , Yangtao Li , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Viresh, On Mon, Apr 22, 2024 at 1:31=E2=80=AFPM Viresh Kumar wrote: > > The Sun50i driver generates a warning with W=3D1: > > warning: '%d' directive output may be truncated writing between 1 and 10 = bytes into a region of size 2 [-Wformat-truncation=3D] > > 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@i= ntel.com/ > Signed-off-by: Viresh Kumar This'll absolutely fix the issue here, so: Reviewed-by: Julian Calaby However: > --- > 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/sun= 50i-cpufreq-nvmem.c > index 30e5c337611c..cd50cea16a87 100644 > --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c > +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c > @@ -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[] =3D "speedXXXXXXXXXXX"; /* Integers can take 11 chars= max */ Would it make sense to just set a static length for the string here, say 17-20 characters and add a comment explaining the number, say: /* "speed" + 11 chars for the int */ The string constant, while it'll probably be optimised away, seems weird and wasteful. Thanks, --=20 Julian Calaby Email: julian.calaby@gmail.com Profile: http://www.google.com/profiles/julian.calaby/