From patchwork Mon Mar 4 07:20:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 209396 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:fa17:b0:10a:f01:a869 with SMTP id ju23csp1263880dyc; Sun, 3 Mar 2024 23:21:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX0qJXG3MvACuuVu5IUXisB+iCTAPRKKsyj9/hxG/GBX8coAbl6wWRsHhez+sbukXmUE5Qa6jhQrRrddM5/Epk8DLexDg== X-Google-Smtp-Source: AGHT+IHMxFkn50KC1edS/PS9aBVpNWhPsOEcNyas465Kaa7THQmjjunHA1VUS+35nBseJynvhF4i X-Received: by 2002:ae9:f807:0:b0:788:13c5:b94a with SMTP id x7-20020ae9f807000000b0078813c5b94amr7326741qkh.28.1709536873981; Sun, 03 Mar 2024 23:21:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709536873; cv=pass; d=google.com; s=arc-20160816; b=nGvTQHEbOr65KDQePqvp0XZ82SnBsuAHf6WGzditvOdcgdm8SQszqCv0k+vzyc/jvr xWOk1fnnMUofI/zRe0bfiLVnKeG/0t9hCZ2e5q64JF2PMpqQ5R4YtAmSf61lrVTT//jh hgUudpqWt9E80hS1D6JBic/wyNkMhSIqsFu2wfILwUe6WvjgRo63McFmWcAconAexrH1 hI31ZzX65QzVJw8LROWayXnd8gsGz1JtDyBXrBFEe4XXX1yxS5Uy79cgHMv/JFhuTGcy WGaF3BT9iUszcFHbJNLj6V8SwIDBU9ZxyYINRy8lWOpjSCmY6H5o3p1NvwfGSc3Tbjw9 gXeg== 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=ut2KpnnZ5CESsPKC15Vq3psWgxNiIKdUmLqL7tGXlBk=; fh=N91VQgEttZOmMQQaYVVm3hXdRf4zGd20JxNTx6NzVh0=; b=Kh5TeZRGyCtGY4NkBUqiSbPc0vtLz3AKB40qhHdPOhFRZGxM5w8qNfEBjydqvtZG/X 2Mec0yOlom7T/KcPZM18e9/YNJ7Il3lT7/l/7WHo6rFKIZnr0RtCsFqqGFa/0l++MJuh DB5TQ7vXnh4zJmofKKJW9UKX/PVPna4otFpytPGNgOFW89IBONTsldX1lC8fdi/b1kNh UyaTsxlSwxAmYSDYYbKAQ6RaVomI1g1PKnkZXvXfPHDzpFs+pGHYfGm/1Qj6GJFHEurq wGb4C9K/zR5osKmRIvvascytjrLHeB+GHlrCEMr/mvVpjf6ML0DAVY+Xvn+ajDHs4485 y7UQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PkDCOzX8; 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-90119-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90119-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f20-20020a05620a12f400b0078829ec12b5si1248994qkl.603.2024.03.03.23.21.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 23:21:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90119-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PkDCOzX8; 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-90119-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90119-ouuuleilei=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 C0FD01C20CFE for ; Mon, 4 Mar 2024 07:21:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1003B13FEF; Mon, 4 Mar 2024 07:21:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PkDCOzX8" Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (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 EA21C12B6F for ; Mon, 4 Mar 2024 07:20:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709536857; cv=none; b=ehXlgWN8U/u6GgKgVLQSuV+QDKz2CakJJoKIzoE64yODkSZ5UmSu8I8m+X30mFd3+OFnLeocspRTzy07vHnzZ9KBijvo7WA2QS9EwbrKp09K2SitGWMMRp5M1FIHwC0Thl5aITRtyAkpq8xPfWQ9KVfjQsHohqPnjyzJalNGs6M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709536857; c=relaxed/simple; bh=5hqiPwoVJKj8ISdmfSbD73jyVkhgdqtuBQYeN7WhxaU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=kJAKxDtrVg8k2/vm78tQirVjHLUwKvAxUP1ZJpwe6+D0T5sp7erobNAoyWt7yAeyR9SlYrPucjVX1Gc7SOypYu4hhe/Z6bZylCibtzj+uPFuII3wdkKksrute4jTXw1jL1NjwWWqM5+bA4K3szzvXCCgK3sXmiLaE9D7LBnxZKk= 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=PkDCOzX8; arc=none smtp.client-ip=209.85.210.181 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-pf1-f181.google.com with SMTP id d2e1a72fcca58-6e55731af5cso3083241b3a.0 for ; Sun, 03 Mar 2024 23:20:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709536855; x=1710141655; 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=ut2KpnnZ5CESsPKC15Vq3psWgxNiIKdUmLqL7tGXlBk=; b=PkDCOzX8L5ZFn9XTHFCJHpVxRMhoHCRil0zbqxzOhEaqgimYoywNQmKp5/OgVxr53B PrUGlNZfwu4AvbdjGP24kX7nFRESn2GCBYMuRTLtu+uEaTC5i8M2xAf7+KMT8VbMmHUD 0ngQYCxgFqnAvryiNvidM3An5PvqdPnhq2UUVogJLLeh744uUO11oStNpogXay/kYCYn RhiERuyr++N+32pNH6Qy+Qe5T+K1IcxhZdu5wIxXXEyajpGLBpNcwevjMDkIkDWiWY+z mZfsN0T5Wt+hwJqeDbBCmsJaKGzhwayNYnxSwElo5+mvh7CBHJzSKM5QYWEARqj/2QGP sFxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709536855; x=1710141655; 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=ut2KpnnZ5CESsPKC15Vq3psWgxNiIKdUmLqL7tGXlBk=; b=j69NxW2uJ508gfP07zpLG3yPKs4qN990O9FSzjrg+8DPYhodQuaFCobrrShiMB64ZM QYexsZkgQaKfmJoHtrYdEm5cmKv9IZnWDdcGFEO4XuV6PyBfP5xyZFmPgse0dljHSLSx wAF4k0azTYKeO6hlRY0PUhvpvBId/GO6J3MqSuKtMoJhO+0fuX9iPqVn9gDqlkeMQc0V AuBsNG24w5sMrcx68t5tgcJ21W2zebIRpN5DvALwc1sKLuW/Q869Qjc/udXgzsKkOpPr GFDeDfu6St+0YjQzgcWCinPHxGIiiTb3b/YSvKn/Wg1LswuXC/g0PHOuxZdwlZcf5Bsv bkeg== X-Forwarded-Encrypted: i=1; AJvYcCXbqI7/VDHhNJEiLeXFMrD1ACBgRENDqkFini2/akle6BmPFIESUB5mWUPAtWQzi98g+GNgEPUuo77SUHjQSDdiZ1VimXdxX6nTezoh X-Gm-Message-State: AOJu0Yyk5Aqld84ROiF1wahR2S0A0ZspyP4ADTdhRadYtr+jbjq9npRO EBfpSy/S5ZeYZZMIDwuOoY7G9JrpRjJc3KFRl+3cbKaSOEdMTkKX5revkNcxBmI= X-Received: by 2002:a05:6a20:144b:b0:1a1:476b:818e with SMTP id a11-20020a056a20144b00b001a1476b818emr3125377pzi.25.1709536855331; Sun, 03 Mar 2024 23:20:55 -0800 (PST) Received: from localhost ([122.172.85.206]) by smtp.gmail.com with ESMTPSA id l3-20020a170902e2c300b001db82fdc89asm7798615plc.305.2024.03.03.23.20.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 23:20:54 -0800 (PST) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , "Rafael J. Wysocki" , kernel test robot , linux-kernel@vger.kernel.org Subject: [PATCH] OPP: debugfs: Fix warning with W=1 builds Date: Mon, 4 Mar 2024 12:50:50 +0530 Message-Id: <50a1a0f23efdc261844a306f5e611051843b4e52.1709536847.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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792579336872972346 X-GMAIL-MSGID: 1792579336872972346 We currently get the following warning: debugfs.c:105:54: error: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Werror=format-truncation=] snprintf(name, sizeof(name), "supply-%d", i); ^~ debugfs.c:105:46: note: directive argument in the range [-2147483644, 2147483646] snprintf(name, sizeof(name), "supply-%d", i); ^~~~~~~~~~~ debugfs.c:105:17: note: 'snprintf' output between 9 and 19 bytes into a destination of size 15 snprintf(name, sizeof(name), "supply-%d", i); Fix this and another potential issue it by increasing size of the arrays. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202402141313.81ltVF5g-lkp@intel.com/ Signed-off-by: Viresh Kumar --- drivers/opp/debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/opp/debugfs.c b/drivers/opp/debugfs.c index ec030b19164a..96313aa55db6 100644 --- a/drivers/opp/debugfs.c +++ b/drivers/opp/debugfs.c @@ -78,7 +78,7 @@ static void opp_debug_create_clks(struct dev_pm_opp *opp, struct opp_table *opp_table, struct dentry *pdentry) { - char name[12]; + char name[19]; int i; if (opp_table->clk_count == 1) { @@ -100,7 +100,7 @@ static void opp_debug_create_supplies(struct dev_pm_opp *opp, int i; for (i = 0; i < opp_table->regulator_count; i++) { - char name[15]; + char name[19]; snprintf(name, sizeof(name), "supply-%d", i);