Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1783730lqg; Mon, 4 Mar 2024 03:53:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXAew+jLJj4gwMsMKuuDZoHmw82h5qF373j8WLhvPIzgPFT/7EjzFDvDew0i9lbLNKRj9PwKu0zUziOjAD2MJ661c7cPcnY01tuwPCRUw== X-Google-Smtp-Source: AGHT+IHRvZye5ENd9MBYnbsTDhUpMybUeB+6zHl+EvminacNL8NU1AJpEabAOcUDhAHkqMNWuzo4 X-Received: by 2002:a05:620a:6202:b0:787:da35:7bb9 with SMTP id ou2-20020a05620a620200b00787da357bb9mr9049838qkn.17.1709553213987; Mon, 04 Mar 2024 03:53:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709553213; cv=pass; d=google.com; s=arc-20160816; b=k4FvTCUhVwsLJfac5t9pVZQv2iEnKnlxeyVzU9up/xd4LkN33eemTFGRzM/+iVc4nt 9p+i+2eLMjxyiClR7OKiXn7aWdONXJBTb9n6Q6M4rMlLFrE2/pjSowmcpuxXB2t2Irup RDnyxuqJyPqOSTnKvXF28G9uRC5nEmyeDnaMTprqUhmXzaLPWCX1GsjjVbNdvFMf8zOH rpRevfkvk0hrymTdVQa4qIRdiAyNZUxzyJAVBKDcIW3VNSzmROuaukLvzzYCLZZBXzF5 Nr1dcHRwpQSnvme+UZOJCGpVqovkBVheGnkp8YpaNIDMlw8LDtb2e069pZUxOYT3Jup0 1pbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=gBe33nm2iOAnPbCyUfzD2Hk51P4hdFpUREFEEjcPNzk=; fh=TJiPSFWh09nqTkBYck1ubs23FqvlCXD3nQKiYUwRgzM=; b=ipBy04Ux4RC7Z9N6C8vT+H5TxKX7smXYQKjY8f7I4GPuJVilHC03cIHJvVz1KPLY22 xaUnEmZ35SQayyLSz77nXxYRPdpCBdvYOvRhAwwvQ7BuvJ8psl8frgMtkmaM0v5eDOCx /4pk+Vi4jLX03/qIoj71ttKhxIaQBSi7/7Gl58Foc6B3k1GmOHdBIA5YTO0b6CZd9jKQ uEpur/dTGkaoDwogxjvV3qIDNMDxdBVck3LxF7nYqno0nToWC62unt6LAqus70EZZQyW l2t+Ynp8mlzXKUSvHU2Uno+B3tIUoXOaPh+H8rZ8FOkftkr9xYbDL6nXiiWhs47Xi2fR eXhg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Vn9lOqZY; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-90536-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.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 l12-20020ae9f00c000000b00787bcd96713si9200390qkg.270.2024.03.04.03.53.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 03:53:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90536-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=@ti.com header.s=ti-com-17Q1 header.b=Vn9lOqZY; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-90536-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.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 B53101C216D6 for ; Mon, 4 Mar 2024 11:53:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A04A3C481; Mon, 4 Mar 2024 11:53:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="Vn9lOqZY" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91F5A3BB5E; Mon, 4 Mar 2024 11:53:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709553186; cv=none; b=SKZ0gh3gVNyp+C1SJjtFJuPTIOyFQGXJyQbs9GqgbrM46YRCdqIBFB3HVAqp4igrajSXgvncC7+YpwnkpLGcaD/7RMerW0Yu8kRFAr4cjHYnZktsCYj3F/CC4rAPYKVLvu2Tb0YhruTDwT76j1Fl3KDzr+CGGi9/IEbPFqCGdfo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709553186; c=relaxed/simple; bh=8Q0hpRNs1YcIFywA2qZbL+uykvSJlC+R25zWdO3lxgE=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=epyJMs7u91etIaYzGcbg9yAYZTMCNInmICNMrtDKxKOtJo/IT0hd90W9UjAdeRHE7561/Gp3xFDTwhIQRHfa9xZOqJbTOhp0cXXE5tORcO/VpGF4M43irnu1jBj7k2NJFdhTNgPnWrI8wynY8dQ4Tuoi78CWWZERCKj0yXtOv3c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=Vn9lOqZY; arc=none smtp.client-ip=198.47.19.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 424BqrOD100923; Mon, 4 Mar 2024 05:52:53 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1709553173; bh=gBe33nm2iOAnPbCyUfzD2Hk51P4hdFpUREFEEjcPNzk=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=Vn9lOqZYtSBGFSxODoIrKX8g/KWj9EKUrnd6uGI0kcDhj5yYNbFhJlUQB0WrEuRN9 S5hSrh6g14JhCpL1N7H34EHesCX5/Che8RFoMy+FCGARjC1u5sggeOx6RxKjo0Je1w w/X7otyWs4A+Jbb7kYIacuce1v+pqKZ7f7uCjldM= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 424BqrhG068851 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 4 Mar 2024 05:52:53 -0600 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 4 Mar 2024 05:52:52 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 4 Mar 2024 05:52:53 -0600 Received: from [172.24.227.68] (dhruva.dhcp.ti.com [172.24.227.68]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 424Bqnu3025627; Mon, 4 Mar 2024 05:52:50 -0600 Message-ID: Date: Mon, 4 Mar 2024 17:22:49 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] OPP: debugfs: Fix warning around icc_get_name() Content-Language: en-US To: Viresh Kumar , Viresh Kumar , Nishanth Menon , Stephen Boyd CC: , Vincent Guittot , "Rafael J. Wysocki" , kernel test robot , References: <0275dc46489419f34765c6ed389c0e9d6245fd31.1709551295.git.viresh.kumar@linaro.org> From: Dhruva Gole In-Reply-To: <0275dc46489419f34765c6ed389c0e9d6245fd31.1709551295.git.viresh.kumar@linaro.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Hi, On 04/03/24 16:52, Viresh Kumar wrote: > If the kernel isn't built with interconnect support, icc_get_name() > returns NULL and we get following warning: > > drivers/opp/debugfs.c: In function 'bw_name_read': > drivers/opp/debugfs.c:43:42: error: '%.62s' directive argument is null [-Werror=format-overflow=] > i = scnprintf(buf, sizeof(buf), "%.62s\n", icc_get_name(path)); > > Fix it. > > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-kbuild-all/202402141313.81ltVF5g-lkp@intel.com/ > Signed-off-by: Viresh Kumar > --- Do we not need this: Fixes: 0430b1d5704b0 ("opp: Expose bandwidth information via debugfs") ? > drivers/opp/debugfs.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/opp/debugfs.c b/drivers/opp/debugfs.c > index 27c3748347af..a9ebfdf0b6a1 100644 > --- a/drivers/opp/debugfs.c > +++ b/drivers/opp/debugfs.c > @@ -37,10 +37,12 @@ static ssize_t bw_name_read(struct file *fp, char __user *userbuf, > size_t count, loff_t *ppos) > { > struct icc_path *path = fp->private_data; > + const char *name = icc_get_name(path); > char buf[64]; > - int i; > + int i = 0; > > - i = scnprintf(buf, sizeof(buf), "%.62s\n", icc_get_name(path)); > + if (name) > + i = scnprintf(buf, sizeof(buf), "%.62s\n", name); Reviewed-by: Dhruva Gole > > return simple_read_from_buffer(userbuf, count, ppos, buf, i); > } -- Thanks and Regards, Dhruva Gole