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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 341E0EB64DD for ; Fri, 11 Aug 2023 15:33:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236581AbjHKPda (ORCPT ); Fri, 11 Aug 2023 11:33:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234781AbjHKPd3 (ORCPT ); Fri, 11 Aug 2023 11:33:29 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77084E53; Fri, 11 Aug 2023 08:33:28 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4RMnqx5rgvz67GC0; Fri, 11 Aug 2023 23:33:17 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Fri, 11 Aug 2023 16:33:25 +0100 Date: Fri, 11 Aug 2023 16:33:24 +0100 From: Jonathan Cameron To: Krzysztof Kozlowski CC: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , , , Andi Shyti Subject: Re: [PATCH 1/2] iio: dac: ad5755: mark OF related data as maybe unused Message-ID: <20230811163324.00003b3c@Huawei.com> In-Reply-To: <20230810111933.205619-1-krzysztof.kozlowski@linaro.org> References: <20230810111933.205619-1-krzysztof.kozlowski@linaro.org> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Thu, 10 Aug 2023 13:19:32 +0200 Krzysztof Kozlowski wrote: > When compile tested with W=1 on x86_64 with driver as built-in: > > ad5755.c:866:34: error: unused variable 'ad5755_of_match' [-Werror,-Wunused-const-variable] > > Signed-off-by: Krzysztof Kozlowski I'd rather see the table used as relying on the fallback path via the spi_match_id table is fragile as two tables may not have equivalent entries in the long run. Entry missing in the spi_driver.driver structure. Bonus points for adding the match data to the of table and making them all pointers there and in spi_device_id table + using spi_get_device_match_data() Jonathan > --- > drivers/iio/dac/ad5755.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c > index 404865e35460..823049ce2686 100644 > --- a/drivers/iio/dac/ad5755.c > +++ b/drivers/iio/dac/ad5755.c > @@ -863,7 +863,7 @@ static const struct spi_device_id ad5755_id[] = { > }; > MODULE_DEVICE_TABLE(spi, ad5755_id); > > -static const struct of_device_id ad5755_of_match[] = { > +static const struct of_device_id ad5755_of_match[] __maybe_unused = { > { .compatible = "adi,ad5755" }, > { .compatible = "adi,ad5755-1" }, > { .compatible = "adi,ad5757" },