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 3E6F2C433F5 for ; Sat, 7 May 2022 02:06:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1445294AbiEGCJz (ORCPT ); Fri, 6 May 2022 22:09:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356477AbiEGCJw (ORCPT ); Fri, 6 May 2022 22:09:52 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12450289B5 for ; Fri, 6 May 2022 19:06:07 -0700 (PDT) Received: from canpemm500007.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Kw9kj2Q2WzhYyc; Sat, 7 May 2022 10:05:33 +0800 (CST) Received: from [10.174.179.215] (10.174.179.215) by canpemm500007.china.huawei.com (7.192.104.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 7 May 2022 10:05:53 +0800 Subject: Re: [PATCH -next] ASoC: mediatek: mt8195: Fix build warning without CONFIG_OF To: Arnd Bergmann CC: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Matthias Brugger , Tzung-Bi Shih , AngeloGioacchino Del Regno , Trevor Wu , ALSA Development Mailing List , Linux ARM , "moderated list:ARM/Mediatek SoC..." , Linux Kernel Mailing List References: <20220506022638.15864-1-yuehaibing@huawei.com> From: YueHaibing Message-ID: <7204f405-444e-629b-67c5-db10959085ab@huawei.com> Date: Sat, 7 May 2022 10:05:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500007.china.huawei.com (7.192.104.62) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/5/6 15:08, Arnd Bergmann wrote: > On Fri, May 6, 2022 at 4:26 AM YueHaibing wrote: >> >> sound/soc/mediatek/mt8195/mt8195-mt6359.c:1639:32: warning: ‘mt8195_mt6359_max98390_rt5682_card’ defined but not used [-Wunused-variable] >> 1639 | static struct mt8195_card_data mt8195_mt6359_max98390_rt5682_card = { >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> sound/soc/mediatek/mt8195/mt8195-mt6359.c:1634:32: warning: ‘mt8195_mt6359_rt1011_rt5682_card’ defined but not used [-Wunused-variable] >> 1634 | static struct mt8195_card_data mt8195_mt6359_rt1011_rt5682_card = { >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> sound/soc/mediatek/mt8195/mt8195-mt6359.c:1629:32: warning: ‘mt8195_mt6359_rt1019_rt5682_card’ defined but not used [-Wunused-variable] >> 1629 | static struct mt8195_card_data mt8195_mt6359_rt1019_rt5682_card = { >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> These variables is only used with CONFIG_OF, move it into the ifdef block. >> >> Fixes: 86a6b9c9dfff ("ASoC: mediatek: mt8195: add machine support for max98390 and rt5682") >> Signed-off-by: YueHaibing > > It's generally better to remove the #ifdef rather than expanding it, > there is no need to > save a few bytes on kernel builds of this driver that disable > CONFIG_OF. Just drop > the of_match_ptr() macro as well. Sure, will do that in v2. > > > Arnd > > . >