Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp400530imn; Thu, 28 Jul 2022 04:22:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uDLSXlhGUU273QsATpWaLJZBijHPYN8tEcIViJkg8hTkiGChDQ/GP/CrzjHyEjHLH0Q2fh X-Received: by 2002:a17:902:efc9:b0:16d:a665:c19e with SMTP id ja9-20020a170902efc900b0016da665c19emr10632023plb.39.1659007333634; Thu, 28 Jul 2022 04:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659007333; cv=none; d=google.com; s=arc-20160816; b=KnAzG/XiQHJ4JabP2lYUt6T7dq3wqQXRMV5i13L8Dko5sVQXq8CQq6UPYjvjhu/gC6 xoA8RNy1e9O50H8AJyHAOjVDV6THC+2cO4/DLw2FGfwEZtup9Y3DYM6sdJwSCVUCYpqI Z11LW1pGVQNl49/PxZh5xb/p5G5XNM8IQh0MrGB23SyDFOx4LBlTGL6qoNg2QgbJUELF 2ZnO1g4o4s/orhRGyLbAqJzyqlj1N5+ALpr9n6AMBPQhqlOe/BWgp0cGfLTDk6aGvl6V otzdyC1KrN7OLYG6G36Ez1Zt+6eddDLXYczgFOxRe8hNQFWgpE06b0HF/0/fMp8LFInp WVAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=PVlK2rEeJ+OhRajQeH37sUEMiJGpWfg5+bTMYvami+s=; b=z6vJbpFMUFTHdaaJpD/xBg6V8AXD0sxPVEflc81oPRMZmZMikXR/mi3niIDIi+gAtu boWLIDMdwwlm4jPy6g7UZ5fr2mwEoTohC73IIiyfwqykgChf7OYdLUl/Jh6A7dOVWRcT 78JMJG82DmKAvU8oIi8COMVCrsPKhL5v3JzD4iN8JhzlsW0kTx2tcP0ExWKO6uOSqukI XFEutt+1znflyIv5fnJpGbbBDR/0yzV7e9tNBcupFnTIsYbCXaqca9dw8m6T6VLkmYe9 fq+Xuw0y+8eAWa5H1q2awwlRIdlCIe9aSX6sEJTSYnytfyi1Cjy8zqRnr47ykXW/0JaJ jYTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Ye6q2lA5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020a170902e95100b0016bf13b2efcsi805520pll.123.2022.07.28.04.21.58; Thu, 28 Jul 2022 04:22:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Ye6q2lA5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235806AbiG1LPV (ORCPT + 99 others); Thu, 28 Jul 2022 07:15:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbiG1LPU (ORCPT ); Thu, 28 Jul 2022 07:15:20 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BBF22A43F for ; Thu, 28 Jul 2022 04:15:18 -0700 (PDT) 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 */ }, > }; >