dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] drm/i2c: tda998x: remove redundant of_match_ptr
@ 2023-07-31 13:02 Zhu Wang
  2023-07-31 23:18 ` kernel test robot
  2023-08-01  3:23 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Zhu Wang @ 2023-07-31 13:02 UTC (permalink / raw)
  To: linux, airlied, daniel, dri-devel, u.kleine-koenig, arnd; +Cc: wangzhu9

The driver depends on CONFIG_OF, so it is not necessary to use
of_match_ptr here.

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 of_match_ptr.

Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
---
 drivers/gpu/drm/i2c/tda998x_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index d8d7de18dd65..d1a6c87290f2 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -2103,7 +2103,7 @@ static struct i2c_driver tda998x_driver = {
 	.remove = tda998x_remove,
 	.driver = {
 		.name = "tda998x",
-		.of_match_table = of_match_ptr(tda998x_dt_ids),
+		.of_match_table = tda998x_dt_ids,
 	},
 	.id_table = tda998x_ids,
 };
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] drm/i2c: tda998x: remove redundant of_match_ptr
  2023-07-31 13:02 [PATCH -next] drm/i2c: tda998x: remove redundant of_match_ptr Zhu Wang
@ 2023-07-31 23:18 ` kernel test robot
  2023-08-01  3:23 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2023-07-31 23:18 UTC (permalink / raw)
  To: Zhu Wang, linux, airlied, daniel, dri-devel, u.kleine-koenig,
	arnd
  Cc: wangzhu9, oe-kbuild-all

Hi Zhu,

kernel test robot noticed the following build errors:

[auto build test ERROR on next-20230731]

url:    https://github.com/intel-lab-lkp/linux/commits/Zhu-Wang/drm-i2c-tda998x-remove-redundant-of_match_ptr/20230731-210417
base:   next-20230731
patch link:    https://lore.kernel.org/r/20230731130257.94751-1-wangzhu9%40huawei.com
patch subject: [PATCH -next] drm/i2c: tda998x: remove redundant of_match_ptr
config: i386-buildonly-randconfig-r004-20230731 (https://download.01.org/0day-ci/archive/20230801/202308010739.e8CIMoSS-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230801/202308010739.e8CIMoSS-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308010739.e8CIMoSS-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/i2c/tda998x_drv.c:2106:35: error: 'tda998x_dt_ids' undeclared here (not in a function); did you mean 'tda998x_ids'?
    2106 |                 .of_match_table = tda998x_dt_ids,
         |                                   ^~~~~~~~~~~~~~
         |                                   tda998x_ids


vim +2106 drivers/gpu/drm/i2c/tda998x_drv.c

  2100	
  2101	static struct i2c_driver tda998x_driver = {
  2102		.probe = tda998x_probe,
  2103		.remove = tda998x_remove,
  2104		.driver = {
  2105			.name = "tda998x",
> 2106			.of_match_table = tda998x_dt_ids,
  2107		},
  2108		.id_table = tda998x_ids,
  2109	};
  2110	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] drm/i2c: tda998x: remove redundant of_match_ptr
  2023-07-31 13:02 [PATCH -next] drm/i2c: tda998x: remove redundant of_match_ptr Zhu Wang
  2023-07-31 23:18 ` kernel test robot
@ 2023-08-01  3:23 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2023-08-01  3:23 UTC (permalink / raw)
  To: Zhu Wang, linux, airlied, daniel, dri-devel, u.kleine-koenig,
	arnd
  Cc: wangzhu9, llvm, oe-kbuild-all

Hi Zhu,

kernel test robot noticed the following build errors:

[auto build test ERROR on next-20230731]

url:    https://github.com/intel-lab-lkp/linux/commits/Zhu-Wang/drm-i2c-tda998x-remove-redundant-of_match_ptr/20230731-210417
base:   next-20230731
patch link:    https://lore.kernel.org/r/20230731130257.94751-1-wangzhu9%40huawei.com
patch subject: [PATCH -next] drm/i2c: tda998x: remove redundant of_match_ptr
config: i386-randconfig-i012-20230731 (https://download.01.org/0day-ci/archive/20230801/202308011156.JV5BlEpl-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce: (https://download.01.org/0day-ci/archive/20230801/202308011156.JV5BlEpl-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308011156.JV5BlEpl-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/i2c/tda998x_drv.c:2106:21: error: use of undeclared identifier 'tda998x_dt_ids'; did you mean 'tda998x_ids'?
                   .of_match_table = tda998x_dt_ids,
                                     ^~~~~~~~~~~~~~
                                     tda998x_ids
   drivers/gpu/drm/i2c/tda998x_drv.c:2095:35: note: 'tda998x_ids' declared here
   static const struct i2c_device_id tda998x_ids[] = {
                                     ^
>> drivers/gpu/drm/i2c/tda998x_drv.c:2106:21: error: incompatible pointer types initializing 'const struct of_device_id *' with an expression of type 'const struct i2c_device_id[2]' [-Werror,-Wincompatible-pointer-types]
                   .of_match_table = tda998x_dt_ids,
                                     ^~~~~~~~~~~~~~
   2 errors generated.


vim +2106 drivers/gpu/drm/i2c/tda998x_drv.c

  2100	
  2101	static struct i2c_driver tda998x_driver = {
  2102		.probe = tda998x_probe,
  2103		.remove = tda998x_remove,
  2104		.driver = {
  2105			.name = "tda998x",
> 2106			.of_match_table = tda998x_dt_ids,
  2107		},
  2108		.id_table = tda998x_ids,
  2109	};
  2110	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-01  3:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-31 13:02 [PATCH -next] drm/i2c: tda998x: remove redundant of_match_ptr Zhu Wang
2023-07-31 23:18 ` kernel test robot
2023-08-01  3:23 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox