[linux-next:master 2514/4430] drivers/clk/clk.c:867:6: error: redefinition of 'clk_unprepare'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Martin,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   7fd22855300e693668c3397771b3a2b3948f827a
commit: 3df5d0d972893d3c0df5aead8152fe1ad48ef45c [2514/4430] ASoC: apple: mca: Start new platform driver
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20220901/202209011158.y3NxLR81-lkp@xxxxxxxxx/config)
compiler: sh4-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3df5d0d972893d3c0df5aead8152fe1ad48ef45c
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 3df5d0d972893d3c0df5aead8152fe1ad48ef45c
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash drivers/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> drivers/clk/clk.c:867:6: error: redefinition of 'clk_unprepare'
     867 | void clk_unprepare(struct clk *clk)
         |      ^~~~~~~~~~~~~
   In file included from drivers/clk/clk.c:9:
   include/linux/clk.h:303:20: note: previous definition of 'clk_unprepare' with type 'void(struct clk *)'
     303 | static inline void clk_unprepare(struct clk *clk)
         |                    ^~~~~~~~~~~~~
>> drivers/clk/clk.c:948:5: error: redefinition of 'clk_prepare'
     948 | int clk_prepare(struct clk *clk)
         |     ^~~~~~~~~~~
   include/linux/clk.h:271:19: note: previous definition of 'clk_prepare' with type 'int(struct clk *)'
     271 | static inline int clk_prepare(struct clk *clk)
         |                   ^~~~~~~~~~~
>> drivers/clk/clk.c:1194:6: error: redefinition of 'clk_is_enabled_when_prepared'
    1194 | bool clk_is_enabled_when_prepared(struct clk *clk)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/clk.h:284:20: note: previous definition of 'clk_is_enabled_when_prepared' with type 'bool(struct clk *)' {aka '_Bool(struct clk *)'}
     284 | static inline bool clk_is_enabled_when_prepared(struct clk *clk)
         |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for COMMON_CLK
   Depends on [n]: !HAVE_LEGACY_CLK [=y]
   Selected by [m]:
   - SND_SOC_APPLE_MCA [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && (ARCH_APPLE || COMPILE_TEST [=y])


vim +/clk_unprepare +867 drivers/clk/clk.c

a6adc30ba7bef8 Dong Aisheng     2016-06-30  855  
4dff95dc9477a3 Stephen Boyd     2015-04-30  856  /**
4dff95dc9477a3 Stephen Boyd     2015-04-30  857   * clk_unprepare - undo preparation of a clock source
4dff95dc9477a3 Stephen Boyd     2015-04-30  858   * @clk: the clk being unprepared
4dff95dc9477a3 Stephen Boyd     2015-04-30  859   *
4dff95dc9477a3 Stephen Boyd     2015-04-30  860   * clk_unprepare may sleep, which differentiates it from clk_disable.  In a
4dff95dc9477a3 Stephen Boyd     2015-04-30  861   * simple case, clk_unprepare can be used instead of clk_disable to gate a clk
4dff95dc9477a3 Stephen Boyd     2015-04-30  862   * if the operation may sleep.  One example is a clk which is accessed over
4dff95dc9477a3 Stephen Boyd     2015-04-30  863   * I2c.  In the complex case a clk gate operation may require a fast and a slow
4dff95dc9477a3 Stephen Boyd     2015-04-30  864   * part.  It is this reason that clk_unprepare and clk_disable are not mutually
4dff95dc9477a3 Stephen Boyd     2015-04-30  865   * exclusive.  In fact clk_disable must be called before clk_unprepare.
4dff95dc9477a3 Stephen Boyd     2015-04-30  866   */
4dff95dc9477a3 Stephen Boyd     2015-04-30 @867  void clk_unprepare(struct clk *clk)
b2476490ef1113 Mike Turquette   2012-03-15  868  {
4dff95dc9477a3 Stephen Boyd     2015-04-30  869  	if (IS_ERR_OR_NULL(clk))
4dff95dc9477a3 Stephen Boyd     2015-04-30  870  		return;
b2476490ef1113 Mike Turquette   2012-03-15  871  
a6adc30ba7bef8 Dong Aisheng     2016-06-30  872  	clk_core_unprepare_lock(clk->core);
1e435256d625c2 Olof Johansson   2013-04-27  873  }
4dff95dc9477a3 Stephen Boyd     2015-04-30  874  EXPORT_SYMBOL_GPL(clk_unprepare);
1e435256d625c2 Olof Johansson   2013-04-27  875  
4dff95dc9477a3 Stephen Boyd     2015-04-30  876  static int clk_core_prepare(struct clk_core *core)
4dff95dc9477a3 Stephen Boyd     2015-04-30  877  {
4dff95dc9477a3 Stephen Boyd     2015-04-30  878  	int ret = 0;
b2476490ef1113 Mike Turquette   2012-03-15  879  
a63347251907d7 Stephen Boyd     2015-05-06  880  	lockdep_assert_held(&prepare_lock);
a63347251907d7 Stephen Boyd     2015-05-06  881  
4dff95dc9477a3 Stephen Boyd     2015-04-30  882  	if (!core)
4dff95dc9477a3 Stephen Boyd     2015-04-30  883  		return 0;
b2476490ef1113 Mike Turquette   2012-03-15  884  
4dff95dc9477a3 Stephen Boyd     2015-04-30  885  	if (core->prepare_count == 0) {
9a34b45397e5a3 Marek Szyprowski 2017-08-21  886  		ret = clk_pm_runtime_get(core);
4dff95dc9477a3 Stephen Boyd     2015-04-30  887  		if (ret)
4dff95dc9477a3 Stephen Boyd     2015-04-30  888  			return ret;
b2476490ef1113 Mike Turquette   2012-03-15  889  
9a34b45397e5a3 Marek Szyprowski 2017-08-21  890  		ret = clk_core_prepare(core->parent);
9a34b45397e5a3 Marek Szyprowski 2017-08-21  891  		if (ret)
9a34b45397e5a3 Marek Szyprowski 2017-08-21  892  			goto runtime_put;
9a34b45397e5a3 Marek Szyprowski 2017-08-21  893  
4dff95dc9477a3 Stephen Boyd     2015-04-30  894  		trace_clk_prepare(core);
1c155b3dfe0835 Ulf Hansson      2013-03-12  895  
4dff95dc9477a3 Stephen Boyd     2015-04-30  896  		if (core->ops->prepare)
4dff95dc9477a3 Stephen Boyd     2015-04-30  897  			ret = core->ops->prepare(core->hw);
1c155b3dfe0835 Ulf Hansson      2013-03-12  898  
4dff95dc9477a3 Stephen Boyd     2015-04-30  899  		trace_clk_prepare_complete(core);
b2476490ef1113 Mike Turquette   2012-03-15  900  
9a34b45397e5a3 Marek Szyprowski 2017-08-21  901  		if (ret)
9a34b45397e5a3 Marek Szyprowski 2017-08-21  902  			goto unprepare;
b2476490ef1113 Mike Turquette   2012-03-15  903  	}
b2476490ef1113 Mike Turquette   2012-03-15  904  
4dff95dc9477a3 Stephen Boyd     2015-04-30  905  	core->prepare_count++;
b2476490ef1113 Mike Turquette   2012-03-15  906  
9461f7b33d11cb Jerome Brunet    2018-06-19  907  	/*
9461f7b33d11cb Jerome Brunet    2018-06-19  908  	 * CLK_SET_RATE_GATE is a special case of clock protection
9461f7b33d11cb Jerome Brunet    2018-06-19  909  	 * Instead of a consumer claiming exclusive rate control, it is
9461f7b33d11cb Jerome Brunet    2018-06-19  910  	 * actually the provider which prevents any consumer from making any
9461f7b33d11cb Jerome Brunet    2018-06-19  911  	 * operation which could result in a rate change or rate glitch while
9461f7b33d11cb Jerome Brunet    2018-06-19  912  	 * the clock is prepared.
9461f7b33d11cb Jerome Brunet    2018-06-19  913  	 */
9461f7b33d11cb Jerome Brunet    2018-06-19  914  	if (core->flags & CLK_SET_RATE_GATE)
9461f7b33d11cb Jerome Brunet    2018-06-19  915  		clk_core_rate_protect(core);
9461f7b33d11cb Jerome Brunet    2018-06-19  916  
4dff95dc9477a3 Stephen Boyd     2015-04-30  917  	return 0;
9a34b45397e5a3 Marek Szyprowski 2017-08-21  918  unprepare:
9a34b45397e5a3 Marek Szyprowski 2017-08-21  919  	clk_core_unprepare(core->parent);
9a34b45397e5a3 Marek Szyprowski 2017-08-21  920  runtime_put:
9a34b45397e5a3 Marek Szyprowski 2017-08-21  921  	clk_pm_runtime_put(core);
9a34b45397e5a3 Marek Szyprowski 2017-08-21  922  	return ret;
b2476490ef1113 Mike Turquette   2012-03-15  923  }
b2476490ef1113 Mike Turquette   2012-03-15  924  
a6adc30ba7bef8 Dong Aisheng     2016-06-30  925  static int clk_core_prepare_lock(struct clk_core *core)
a6adc30ba7bef8 Dong Aisheng     2016-06-30  926  {
a6adc30ba7bef8 Dong Aisheng     2016-06-30  927  	int ret;
a6adc30ba7bef8 Dong Aisheng     2016-06-30  928  
a6adc30ba7bef8 Dong Aisheng     2016-06-30  929  	clk_prepare_lock();
a6adc30ba7bef8 Dong Aisheng     2016-06-30  930  	ret = clk_core_prepare(core);
a6adc30ba7bef8 Dong Aisheng     2016-06-30  931  	clk_prepare_unlock();
a6adc30ba7bef8 Dong Aisheng     2016-06-30  932  
a6adc30ba7bef8 Dong Aisheng     2016-06-30  933  	return ret;
a6adc30ba7bef8 Dong Aisheng     2016-06-30  934  }
a6adc30ba7bef8 Dong Aisheng     2016-06-30  935  
4dff95dc9477a3 Stephen Boyd     2015-04-30  936  /**
4dff95dc9477a3 Stephen Boyd     2015-04-30  937   * clk_prepare - prepare a clock source
4dff95dc9477a3 Stephen Boyd     2015-04-30  938   * @clk: the clk being prepared
4dff95dc9477a3 Stephen Boyd     2015-04-30  939   *
4dff95dc9477a3 Stephen Boyd     2015-04-30  940   * clk_prepare may sleep, which differentiates it from clk_enable.  In a simple
4dff95dc9477a3 Stephen Boyd     2015-04-30  941   * case, clk_prepare can be used instead of clk_enable to ungate a clk if the
4dff95dc9477a3 Stephen Boyd     2015-04-30  942   * operation may sleep.  One example is a clk which is accessed over I2c.  In
4dff95dc9477a3 Stephen Boyd     2015-04-30  943   * the complex case a clk ungate operation may require a fast and a slow part.
4dff95dc9477a3 Stephen Boyd     2015-04-30  944   * It is this reason that clk_prepare and clk_enable are not mutually
4dff95dc9477a3 Stephen Boyd     2015-04-30  945   * exclusive.  In fact clk_prepare must be called before clk_enable.
4dff95dc9477a3 Stephen Boyd     2015-04-30  946   * Returns 0 on success, -EERROR otherwise.
4dff95dc9477a3 Stephen Boyd     2015-04-30  947   */
4dff95dc9477a3 Stephen Boyd     2015-04-30 @948  int clk_prepare(struct clk *clk)
b2476490ef1113 Mike Turquette   2012-03-15  949  {
035a61c314eb3d Tomeu Vizoso     2015-01-23  950  	if (!clk)
4dff95dc9477a3 Stephen Boyd     2015-04-30  951  		return 0;
035a61c314eb3d Tomeu Vizoso     2015-01-23  952  
a6adc30ba7bef8 Dong Aisheng     2016-06-30  953  	return clk_core_prepare_lock(clk->core);
7ef3dcc8145263 James Hogan      2013-07-29  954  }
4dff95dc9477a3 Stephen Boyd     2015-04-30  955  EXPORT_SYMBOL_GPL(clk_prepare);
035a61c314eb3d Tomeu Vizoso     2015-01-23  956  

:::::: The code at line 867 was first introduced by commit
:::::: 4dff95dc9477a34de77d24c59dcf1dc593687fcf clk: Remove forward declared function prototypes

:::::: TO: Stephen Boyd <sboyd@xxxxxxxxxxxxxx>
:::::: CC: Stephen Boyd <sboyd@xxxxxxxxxxxxxx>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux