drm/bridge: fix -Wunused-const-variable= warning
authorZhu Wang <wangzhu9@huawei.com>
Mon, 31 Jul 2023 02:13:45 +0000 (10:13 +0800)
committerRobert Foss <rfoss@kernel.org>
Mon, 31 Jul 2023 09:14:24 +0000 (11:14 +0200)
commit132b6512e69453bac0db1437c143e7751c0c88d4
tree459cb7dbdfcd845f567761473814d62594ab559c
parent8b8067fcce3df66ce4d00c0c9f80cd3f014d843b
drm/bridge: fix -Wunused-const-variable= warning

When building with W=1, the following warning occurs.

drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c:48:17: warning: ‘anx781x_i2c_addresses’ defined but not used [-Wunused-const-variable=]  static const u8 anx781x_i2c_addresses[] = {
                 ^~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c:40:17: warning: ‘anx7808_i2c_addresses’ defined but not used [-Wunused-const-variable=]  static const u8 anx7808_i2c_addresses[] = {

When CONFIG_IO is disabled, above two variables are not used,
since the place where it is used is inclueded in the macro
CONFIG_OF.

Even for drivers that do not depend on CONFIG_OF, it's almost
always better to leave out the of_match_ptr(), since the only
thing it can possibly do is to save a few bytes of .text if a
driver can be used both with and without it. Hence we remove
all of_match_ptr() used in other places.

Fixes: 0647e7dd3f7a ("drm/bridge: Add Analogix anx78xx support")
Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230731021345.219588-1-wangzhu9@huawei.com
drivers/gpu/drm/bridge/analogix/analogix-anx6345.c
drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
drivers/gpu/drm/bridge/chrontel-ch7033.c
drivers/gpu/drm/bridge/sil-sii8620.c
drivers/gpu/drm/bridge/ti-tfp410.c