From nobody Sun Feb 8 13:53:03 2026 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 3828FC001B0 for ; Wed, 26 Jul 2023 10:07:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233096AbjGZKHe (ORCPT ); Wed, 26 Jul 2023 06:07:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233464AbjGZKHT (ORCPT ); Wed, 26 Jul 2023 06:07:19 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67B951BFB for ; Wed, 26 Jul 2023 03:07:04 -0700 (PDT) Received: from dggpeml500025.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R9qH707gKztRSb; Wed, 26 Jul 2023 18:03:47 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.202) by dggpeml500025.china.huawei.com (7.185.36.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 26 Jul 2023 18:07:01 +0800 From: Zhu Wang To: , , , , , , , , , , , , , , , , , CC: Subject: [PATCH -next] drm/bridge: fix -Wunused-const-variable= warning Date: Wed, 26 Jul 2023 18:06:26 +0800 Message-ID: <20230726100626.167490-1-wangzhu9@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.67.174.202] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500025.china.huawei.com (7.185.36.35) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building with W=3D1, the following warning occurs. drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c:48:17: warning: =E2=80= =98anx781x_i2c_addresses=E2=80=99 defined but not used [-Wunused-const-vari= able=3D] static const u8 anx781x_i2c_addresses[] =3D { ^~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c:40:17: warning: =E2=80= =98anx7808_i2c_addresses=E2=80=99 defined but not used [-Wunused-const-vari= able=3D] static const u8 anx7808_i2c_addresses[] =3D { The definition of above two data variables is included by the macro CONFIG_OF, so we also include the data variable definitions in the macro CONFIG_OF. And in addition the data variable anx78xx_match_table is included in the macro CONFIG_OF, so we add CONFIG_OF to the place where it is used. Fixes: 5d97408e0d70 ("drm/bridge: move ANA78xx driver to analogix subdirect= ory") Signed-off-by: Zhu Wang --- drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c b/drivers/g= pu/drm/bridge/analogix/analogix-anx78xx.c index 06a3e3243e19..799b33cebdd5 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c @@ -37,6 +37,7 @@ =20 #define XTAL_CLK 270 /* 27M */ =20 +#if IS_ENABLED(CONFIG_OF) static const u8 anx7808_i2c_addresses[] =3D { [I2C_IDX_TX_P0] =3D 0x78, [I2C_IDX_TX_P1] =3D 0x7a, @@ -52,6 +53,7 @@ static const u8 anx781x_i2c_addresses[] =3D { [I2C_IDX_RX_P0] =3D 0x7e, [I2C_IDX_RX_P1] =3D 0x80, }; +#endif =20 struct anx78xx_platform_data { struct regulator *dvdd10; @@ -1387,7 +1389,9 @@ MODULE_DEVICE_TABLE(of, anx78xx_match_table); static struct i2c_driver anx78xx_driver =3D { .driver =3D { .name =3D "anx7814", +#if IS_ENABLED(CONFIG_OF) .of_match_table =3D of_match_ptr(anx78xx_match_table), +#endif }, .probe =3D anx78xx_i2c_probe, .remove =3D anx78xx_i2c_remove, --=20 2.17.1