From mboxrd@z Thu Jan 1 00:00:00 1970 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 91C54C04A68 for ; Thu, 28 Jul 2022 11:15:27 +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:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PVlK2rEeJ+OhRajQeH37sUEMiJGpWfg5+bTMYvami+s=; b=Pv442sLoKjO6NQxmEaKSkdwCIR IN94tp6YUNeu66DjmRbxIUSCw13rsvVj/nk6VqRxZENSTm/C2xhIA5FKBy63EAic8B6KU9SNnhNKy HwGZcSWgKd2Y4vVsoOKcQj6D0rs8yu04ShsGpsVxZ1eci4CebvBADmwOCHbI/WlOneGPWFxzcjxd5 7wTDFtWeXLOG4Eo4k0zpNuJWQiLuoo/e0PNcsySuqk1D/SOWE7aJeMs/Ru0wIRT9YH59e4QZFw5GM Q4S2T0C77qfTmFZMCvOFr3X90e7oIYA0yei/tUwSxLl1gu/oF+vrmDbUciyLM0vamAYmwuT738qVA KRS+O9BA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oH1U9-008eEL-5s; Thu, 28 Jul 2022 11:15:21 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oH1U6-008eD4-KC for linux-mediatek@lists.infradead.org; Thu, 28 Jul 2022 11:15:20 +0000 Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id D93A56601B43; Thu, 28 Jul 2022 12:15:16 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1659006917; bh=0gnnEk0TG5O1vi5/Vm6gds5OMe6ylZ4Rer3EJsmYcoU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Ye6q2lA5BgXCgHk9eToRCt4M7AqeV1MuUi/od7Zy/EQY00QXeuaD3kymlgnox+gTb QsOoV4EGCLKh5N9Uyr18G+AZZXgvLBLMZ+jShh7FLPLTG/PGZ+SzvzPLezgdlJhvb+ hFsrnavXWQXsJOHz1eY4YyGy30i84TH4zKDVjFZwQTbUEYI4VtRT9YszA9MLQ96RBz tyMpA1KomVlbITyGOuZ71Cb9lU7XDHMbLzxiKZ7ovJ1Cgcoe0torqjO2HKIhA//Em0 JxMpdKEZBS6xeoyPZWy0KL1H/osgLmU57KZO3Jft20v218FEip4wABFExuRjmyo8HE MbZ6NJlzmXMBw== Message-ID: Date: Thu, 28 Jul 2022 13:15:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH RFC] regulator: mt6380: Fix unused array warning Content-Language: en-US To: Jean Delvare , linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Mark Brown Cc: Liam Girdwood , Mark Brown , Matthias Brugger , Chenglin Xu , Sean Wang References: <20220727132637.76d6073f@endymion.delvare> From: AngeloGioacchino Del Regno In-Reply-To: <20220727132637.76d6073f@endymion.delvare> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220728_041518_817161_8B3EDA96 X-CRM114-Status: GOOD ( 22.40 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Il 27/07/22 13:26, Jean Delvare ha scritto: > With the following configuration options: > CONFIG_OF is not set > CONFIG_REGULATOR_MT6380=y > we get the following build warning: > > CC drivers/regulator/mt6380-regulator.o > drivers/regulator/mt6380-regulator.c:322:34: warning: ‘mt6380_of_match’ defined but not used [-Wunused-const-variable=] > > Fix this by annotating that array with __maybe_unused, as done in > various regulator drivers. I know I'm late to the party, but I would've preferred to see the of_match_ptr() dropped instead of adding a __maybe_unused. Cheers, Angelo > > Signed-off-by: Jean Delvare > Reported-by: kernel test robot > Link: https://lore.kernel.org/all/202207240252.ZY5hSCNB-lkp@intel.com/ > Cc: Liam Girdwood > Cc: Mark Brown > Cc: Matthias Brugger > Cc: Chenglin Xu > --- > This assumes that the mt6380 driver can be used without OF support. > However, I can't find any in-tree piece of code instantiating the > "mt6380-regulator" platform device by name. So unless there's an > out-of-tree user, a better fix would be to remove mt6380_platform_ids > and make the driver depend on OF. Chenglin, would that be OK with > you? > > drivers/regulator/mt6380-regulator.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > --- linux-5.18.orig/drivers/regulator/mt6380-regulator.c 2022-07-27 11:55:21.672421481 +0200 > +++ linux-5.18/drivers/regulator/mt6380-regulator.c 2022-07-27 12:01:53.151833378 +0200 > @@ -319,7 +319,7 @@ static const struct platform_device_id m > }; > MODULE_DEVICE_TABLE(platform, mt6380_platform_ids); > > -static const struct of_device_id mt6380_of_match[] = { > +static const struct of_device_id __maybe_unused mt6380_of_match[] = { > { .compatible = "mediatek,mt6380-regulator", }, > { /* sentinel */ }, > }; >