[PATCH] drm/imx: Allow building under COMPILE_TEST

kbuild test robot lkp at intel.com
Tue Nov 6 01:49:30 UTC 2018


Hi Philipp,

I love your patch! Perhaps something to improve:

[auto build test WARNING on sof-driver-fuweitax/master]
[also build test WARNING on v4.20-rc1 next-20181105]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Philipp-Zabel/drm-imx-Allow-building-under-COMPILE_TEST/20181106-050753
base:   https://github.com/fuweitax/linux master
config: powerpc64-allyesconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=powerpc64 

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/imx/imx-tve.c:123:16: error: field 'clk_hw_di' has incomplete type
     struct clk_hw clk_hw_di;
                   ^~~~~~~~~
   In file included from include/linux/err.h:5:0,
                    from include/linux/clk.h:15,
                    from drivers/gpu/drm/imx/imx-tve.c:16:
   drivers/gpu/drm/imx/imx-tve.c: In function 'clk_tve_di_recalc_rate':
   include/linux/kernel.h:962:32: error: dereferencing pointer to incomplete type 'struct clk_hw'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                                   ^~~~~~
   include/linux/compiler.h:316:19: note: in definition of macro '__compiletime_assert'
      bool __cond = !(condition);    \
                      ^~~~~~~~~
   include/linux/compiler.h:339:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:45:37: note: in expansion of macro 'compiletime_assert'
    #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                        ^~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:962:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
     ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:962:20: note: in expansion of macro '__same_type'
     BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                       ^~~~~~~~~~~
>> drivers/gpu/drm/imx/imx-tve.c:384:24: note: in expansion of macro 'container_of'
     struct imx_tve *tve = container_of(hw, struct imx_tve, clk_hw_di);
                           ^~~~~~~~~~~~
   drivers/gpu/drm/imx/imx-tve.c: At top level:
   drivers/gpu/drm/imx/imx-tve.c:445:15: error: variable 'clk_tve_di_ops' has initializer but incomplete type
    static struct clk_ops clk_tve_di_ops = {
                  ^~~~~~~
   drivers/gpu/drm/imx/imx-tve.c:446:3: error: 'struct clk_ops' has no member named 'round_rate'
     .round_rate = clk_tve_di_round_rate,
      ^~~~~~~~~~
   drivers/gpu/drm/imx/imx-tve.c:446:16: warning: excess elements in struct initializer
     .round_rate = clk_tve_di_round_rate,
                   ^~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/imx/imx-tve.c:446:16: note: (near initialization for 'clk_tve_di_ops')
   drivers/gpu/drm/imx/imx-tve.c:447:3: error: 'struct clk_ops' has no member named 'set_rate'
     .set_rate = clk_tve_di_set_rate,
      ^~~~~~~~
   drivers/gpu/drm/imx/imx-tve.c:447:14: warning: excess elements in struct initializer
     .set_rate = clk_tve_di_set_rate,
                 ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/imx/imx-tve.c:447:14: note: (near initialization for 'clk_tve_di_ops')
   drivers/gpu/drm/imx/imx-tve.c:448:3: error: 'struct clk_ops' has no member named 'recalc_rate'
     .recalc_rate = clk_tve_di_recalc_rate,
      ^~~~~~~~~~~
   drivers/gpu/drm/imx/imx-tve.c:448:17: warning: excess elements in struct initializer
     .recalc_rate = clk_tve_di_recalc_rate,
                    ^~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/imx/imx-tve.c:448:17: note: (near initialization for 'clk_tve_di_ops')
   drivers/gpu/drm/imx/imx-tve.c: In function 'tve_clk_init':
   drivers/gpu/drm/imx/imx-tve.c:454:9: error: variable 'init' has initializer but incomplete type
     struct clk_init_data init = {
            ^~~~~~~~~~~~~
   drivers/gpu/drm/imx/imx-tve.c:455:4: error: 'struct clk_init_data' has no member named 'name'
      .name = "tve_di",
       ^~~~
   drivers/gpu/drm/imx/imx-tve.c:455:11: warning: excess elements in struct initializer
      .name = "tve_di",
              ^~~~~~~~
   drivers/gpu/drm/imx/imx-tve.c:455:11: note: (near initialization for 'init')
   drivers/gpu/drm/imx/imx-tve.c:456:4: error: 'struct clk_init_data' has no member named 'ops'
      .ops = &clk_tve_di_ops,
       ^~~
   drivers/gpu/drm/imx/imx-tve.c:456:10: warning: excess elements in struct initializer
      .ops = &clk_tve_di_ops,
             ^
   drivers/gpu/drm/imx/imx-tve.c:456:10: note: (near initialization for 'init')
   drivers/gpu/drm/imx/imx-tve.c:457:4: error: 'struct clk_init_data' has no member named 'num_parents'
      .num_parents = 1,
       ^~~~~~~~~~~
   drivers/gpu/drm/imx/imx-tve.c:457:18: warning: excess elements in struct initializer
      .num_parents = 1,
                     ^
   drivers/gpu/drm/imx/imx-tve.c:457:18: note: (near initialization for 'init')
   drivers/gpu/drm/imx/imx-tve.c:458:4: error: 'struct clk_init_data' has no member named 'flags'
      .flags = 0,
       ^~~~~
   drivers/gpu/drm/imx/imx-tve.c:458:12: warning: excess elements in struct initializer
      .flags = 0,
               ^
   drivers/gpu/drm/imx/imx-tve.c:458:12: note: (near initialization for 'init')
   drivers/gpu/drm/imx/imx-tve.c:454:23: error: storage size of 'init' isn't known
     struct clk_init_data init = {
                          ^~~~
   drivers/gpu/drm/imx/imx-tve.c:461:21: error: implicit declaration of function '__clk_get_name'; did you mean 'clk_get_rate'? [-Werror=implicit-function-declaration]
     tve_di_parent[0] = __clk_get_name(tve->clk);
                        ^~~~~~~~~~~~~~
                        clk_get_rate
>> drivers/gpu/drm/imx/imx-tve.c:461:19: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     tve_di_parent[0] = __clk_get_name(tve->clk);
                      ^
   drivers/gpu/drm/imx/imx-tve.c:465:16: error: implicit declaration of function 'clk_register'; did you mean 'bus_register'? [-Werror=implicit-function-declaration]
     tve->di_clk = clk_register(tve->dev, &tve->clk_hw_di);
                   ^~~~~~~~~~~~
                   bus_register
   drivers/gpu/drm/imx/imx-tve.c:454:23: warning: unused variable 'init' [-Wunused-variable]
     struct clk_init_data init = {
                          ^~~~
   drivers/gpu/drm/imx/imx-tve.c: At top level:
   drivers/gpu/drm/imx/imx-tve.c:445:23: error: storage size of 'clk_tve_di_ops' isn't known
    static struct clk_ops clk_tve_di_ops = {
                          ^~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/container_of +384 drivers/gpu/drm/imx/imx-tve.c

fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  380  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  381  static unsigned long clk_tve_di_recalc_rate(struct clk_hw *hw,
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  382  					    unsigned long parent_rate)
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  383  {
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08 @384  	struct imx_tve *tve = container_of(hw, struct imx_tve, clk_hw_di);
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  385  	unsigned int val;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  386  	int ret;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  387  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  388  	ret = regmap_read(tve->regmap, TVE_COM_CONF_REG, &val);
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  389  	if (ret < 0)
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  390  		return 0;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  391  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  392  	switch (val & TVE_DAC_SAMP_RATE_MASK) {
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  393  	case TVE_DAC_DIV4_RATE:
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  394  		return parent_rate / 4;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  395  	case TVE_DAC_DIV2_RATE:
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  396  		return parent_rate / 2;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  397  	case TVE_DAC_FULL_RATE:
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  398  	default:
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  399  		return parent_rate;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  400  	}
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  401  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  402  	return 0;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  403  }
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  404  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  405  static long clk_tve_di_round_rate(struct clk_hw *hw, unsigned long rate,
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  406  				  unsigned long *prate)
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  407  {
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  408  	unsigned long div;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  409  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  410  	div = *prate / rate;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  411  	if (div >= 4)
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  412  		return *prate / 4;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  413  	else if (div >= 2)
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  414  		return *prate / 2;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  415  	return *prate;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  416  }
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  417  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  418  static int clk_tve_di_set_rate(struct clk_hw *hw, unsigned long rate,
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  419  			       unsigned long parent_rate)
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  420  {
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  421  	struct imx_tve *tve = container_of(hw, struct imx_tve, clk_hw_di);
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  422  	unsigned long div;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  423  	u32 val;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  424  	int ret;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  425  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  426  	div = parent_rate / rate;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  427  	if (div >= 4)
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  428  		val = TVE_DAC_DIV4_RATE;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  429  	else if (div >= 2)
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  430  		val = TVE_DAC_DIV2_RATE;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  431  	else
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  432  		val = TVE_DAC_FULL_RATE;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  433  
89911e583 drivers/staging/imx-drm/imx-tve.c Andreas Werner 2013-08-11  434  	ret = regmap_update_bits(tve->regmap, TVE_COM_CONF_REG,
89911e583 drivers/staging/imx-drm/imx-tve.c Andreas Werner 2013-08-11  435  				 TVE_DAC_SAMP_RATE_MASK, val);
89911e583 drivers/staging/imx-drm/imx-tve.c Andreas Werner 2013-08-11  436  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  437  	if (ret < 0) {
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  438  		dev_err(tve->dev, "failed to set divider: %d\n", ret);
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  439  		return ret;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  440  	}
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  441  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  442  	return 0;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  443  }
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  444  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  445  static struct clk_ops clk_tve_di_ops = {
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  446  	.round_rate = clk_tve_di_round_rate,
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  447  	.set_rate = clk_tve_di_set_rate,
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  448  	.recalc_rate = clk_tve_di_recalc_rate,
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  449  };
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  450  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  451  static int tve_clk_init(struct imx_tve *tve, void __iomem *base)
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  452  {
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  453  	const char *tve_di_parent[1];
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  454  	struct clk_init_data init = {
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  455  		.name = "tve_di",
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  456  		.ops = &clk_tve_di_ops,
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  457  		.num_parents = 1,
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08 @458  		.flags = 0,
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  459  	};
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  460  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08 @461  	tve_di_parent[0] = __clk_get_name(tve->clk);
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  462  	init.parent_names = (const char **)&tve_di_parent;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  463  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  464  	tve->clk_hw_di.init = &init;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  465  	tve->di_clk = clk_register(tve->dev, &tve->clk_hw_di);
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  466  	if (IS_ERR(tve->di_clk)) {
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  467  		dev_err(tve->dev, "failed to register TVE output clock: %ld\n",
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  468  			PTR_ERR(tve->di_clk));
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  469  		return PTR_ERR(tve->di_clk);
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  470  	}
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  471  
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  472  	return 0;
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  473  }
fcbc51e54 drivers/staging/imx-drm/imx-tve.c Philipp Zabel  2013-04-08  474  

:::::: The code at line 384 was first introduced by commit
:::::: fcbc51e54d2aa9d402206601f4894251049e5d77 staging: drm/imx: Add support for Television Encoder (TVEv2)

:::::: TO: Philipp Zabel <p.zabel at pengutronix.de>
:::::: CC: Greg Kroah-Hartman <gregkh at linuxfoundation.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 56199 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20181106/ce79b38a/attachment-0001.gz>


More information about the dri-devel mailing list