diff mbox series

[2/2] clk: Remove CONFIG_ARCH_HISI check for subdir hisilicon

Message ID 1590377516-32117-2-git-send-email-yangtiezhu@loongson.cn (mailing list archive)
State Changes Requested, archived
Headers show
Series [1/2] clk: hisilicon: Use correct return value about hisi_reset_init() | expand

Commit Message

Tiezhu Yang May 25, 2020, 3:31 a.m. UTC
If CONFIG_ARCH_HISI is not set but COMPILE_TEST is set, the file
in the subdir hisilicon can not be built due to CONFIG_ARCH_HISI
check in drivers/clk/Makefile.

Since the related configs in drivers/clk/hisilicon/Kconfig depend
on ARCH_HISI, so remove CONFIG_ARCH_HISI check for subdir hisilicon
in drivers/clk/Makefile.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/clk/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

kernel test robot May 26, 2020, 6:55 p.m. UTC | #1
Hi Tiezhu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on clk/clk-next]
[also build test ERROR on v5.7-rc7 next-20200526]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Tiezhu-Yang/clk-hisilicon-Use-correct-return-value-about-hisi_reset_init/20200525-113342
base:   https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_fixed_rate':
>> clk.c:(.text+0x9e): undefined reference to `clk_register_fixed_rate'
>> ld: clk.c:(.text+0xdf): undefined reference to `clk_unregister_fixed_rate'
ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_fixed_factor':
>> clk.c:(.text+0x117): undefined reference to `clk_register_fixed_factor'
>> ld: clk.c:(.text+0x158): undefined reference to `clk_unregister_fixed_factor'
ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_mux':
>> clk.c:(.text+0x1cb): undefined reference to `clk_register_mux_table'
>> ld: clk.c:(.text+0x1f2): undefined reference to `clk_register_clkdev'
>> ld: clk.c:(.text+0x21a): undefined reference to `clk_unregister_mux'
ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_divider':
>> clk.c:(.text+0x2c9): undefined reference to `clk_register_divider_table'
ld: clk.c:(.text+0x2e3): undefined reference to `clk_register_clkdev'
>> ld: clk.c:(.text+0x311): undefined reference to `clk_unregister_divider'
ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_gate':
>> clk.c:(.text+0x36c): undefined reference to `clk_register_gate'
ld: clk.c:(.text+0x393): undefined reference to `clk_register_clkdev'
>> ld: clk.c:(.text+0x3bb): undefined reference to `clk_unregister_gate'
ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_gate_sep':
>> clk.c:(.text+0x425): undefined reference to `clk_register_clkdev'
ld: drivers/clk/hisilicon/clk.o: in function `hi6220_clk_register_divider':
>> clk.c:(.init.text+0x5d): undefined reference to `clk_register_clkdev'
ld: drivers/clk/hisilicon/clkgate-separated.o: in function `hisi_register_clkgate_sep':
>> clkgate-separated.c:(.text+0xf0): undefined reference to `clk_register'
ld: drivers/clk/hisilicon/clkdivider-hi6220.o: in function `hi6220_clkdiv_set_rate':
>> clkdivider-hi6220.c:(.text+0x16): undefined reference to `divider_get_val'
ld: drivers/clk/hisilicon/clkdivider-hi6220.o: in function `hi6220_clkdiv_recalc_rate':
>> clkdivider-hi6220.c:(.text+0x8a): undefined reference to `divider_recalc_rate'
ld: drivers/clk/hisilicon/clkdivider-hi6220.o: in function `hi6220_clkdiv_round_rate':
>> clkdivider-hi6220.c:(.text+0xa9): undefined reference to `clk_hw_get_parent'
>> ld: clkdivider-hi6220.c:(.text+0xbd): undefined reference to `divider_round_rate_parent'
ld: drivers/clk/hisilicon/clkdivider-hi6220.o: in function `hi6220_register_clkdiv':
>> clkdivider-hi6220.c:(.text+0x1c5): undefined reference to `clk_register'
ld: drivers/clk/hisilicon/clk-hisi-phase.o: in function `clk_register_hisi_phase':
>> clk-hisi-phase.c:(.text+0x121): undefined reference to `devm_clk_register'

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot May 27, 2020, 4:13 a.m. UTC | #2
Hi Tiezhu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on clk/clk-next]
[also build test ERROR on v5.7-rc7 next-20200526]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Tiezhu-Yang/clk-hisilicon-Use-correct-return-value-about-hisi_reset_init/20200525-113342
base:   https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
config: m68k-allnoconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.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
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

m68k-linux-ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_fixed_rate':
clk.c:(.text+0xd0): undefined reference to `clk_register_fixed_rate'
>> m68k-linux-ld: clk.c:(.text+0x120): undefined reference to `clk_unregister_fixed_rate'
m68k-linux-ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_fixed_factor':
clk.c:(.text+0x166): undefined reference to `clk_register_fixed_factor'
>> m68k-linux-ld: clk.c:(.text+0x1ba): undefined reference to `clk_unregister_fixed_factor'
m68k-linux-ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_mux':
clk.c:(.text+0x208): undefined reference to `clk_register_mux_table'
>> m68k-linux-ld: clk.c:(.text+0x210): undefined reference to `clk_register_clkdev'
>> m68k-linux-ld: clk.c:(.text+0x2a8): undefined reference to `clk_unregister_mux'
m68k-linux-ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_divider':
clk.c:(.text+0x360): undefined reference to `clk_register_divider_table'
m68k-linux-ld: clk.c:(.text+0x366): undefined reference to `clk_register_clkdev'
>> m68k-linux-ld: clk.c:(.text+0x3f0): undefined reference to `clk_unregister_divider'
m68k-linux-ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_gate':
clk.c:(.text+0x43c): undefined reference to `clk_register_gate'
m68k-linux-ld: clk.c:(.text+0x442): undefined reference to `clk_register_clkdev'
>> m68k-linux-ld: clk.c:(.text+0x4c0): undefined reference to `clk_unregister_gate'
m68k-linux-ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_gate_sep':
clk.c:(.text+0x510): undefined reference to `clk_register_clkdev'
m68k-linux-ld: drivers/clk/hisilicon/clk.o: in function `hi6220_clk_register_divider':
clk.c:(.init.text+0x16): undefined reference to `clk_register_clkdev'
m68k-linux-ld: drivers/clk/hisilicon/clkgate-separated.o: in function `hisi_register_clkgate_sep':
clkgate-separated.c:(.text+0x128): undefined reference to `clk_register'
>> m68k-linux-ld: clkgate-separated.c:(.text+0x176): undefined reference to `clk_register'
m68k-linux-ld: drivers/clk/hisilicon/clkdivider-hi6220.o: in function `hi6220_clkdiv_set_rate':
clkdivider-hi6220.c:(.text+0x26): undefined reference to `divider_get_val'
m68k-linux-ld: drivers/clk/hisilicon/clkdivider-hi6220.o: in function `hi6220_clkdiv_round_rate':
clkdivider-hi6220.c:(.text+0xa6): undefined reference to `clk_hw_get_parent'
>> m68k-linux-ld: clkdivider-hi6220.c:(.text+0xc0): undefined reference to `divider_round_rate_parent'
m68k-linux-ld: drivers/clk/hisilicon/clkdivider-hi6220.o: in function `hi6220_clkdiv_recalc_rate':
clkdivider-hi6220.c:(.text+0x10a): undefined reference to `divider_recalc_rate'
m68k-linux-ld: drivers/clk/hisilicon/clkdivider-hi6220.o: in function `hi6220_register_clkdiv':
clkdivider-hi6220.c:(.text+0x1f8): undefined reference to `clk_register'
m68k-linux-ld: drivers/clk/hisilicon/clk-hisi-phase.o: in function `clk_register_hisi_phase':
clk-hisi-phase.c:(.text+0x172): undefined reference to `devm_clk_register'
>> m68k-linux-ld: clk-hisi-phase.c:(.text+0x1e2): undefined reference to `devm_clk_register'

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Tiezhu Yang May 27, 2020, 4:16 a.m. UTC | #3
On 05/27/2020 02:55 AM, kbuild test robot wrote:
> Hi Tiezhu,
>
> Thank you for the patch! Yet something to improve:
>
> [auto build test ERROR on clk/clk-next]
> [also build test ERROR on v5.7-rc7 next-20200526]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
>
> url:    https://github.com/0day-ci/linux/commits/Tiezhu-Yang/clk-hisilicon-Use-correct-return-value-about-hisi_reset_init/20200525-113342
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
> config: i386-tinyconfig (attached as .config)

Hi,

Thanks for your report.

I find that both CONFIG_ARCH_HISI and CONFIG_COMPILE_TEST are not
set in .config, if one of them is set, the build will be success.

But when used with this patch and this .config, I think it is
better to check CONFIG_COMMON_CLK and CONFIG_CLKDEV_LOOKUP or
just check CONFIG_ARCH_HISI before build the following files
"clk.o clkgate-separated.o clkdivider-hi6220.o clk-hisi-phase.o"
in drivers/clk/hisilicon/Makefile to avoid the build failure.

I will verify it and then send v2.

Thanks,
Tiezhu Yang

> compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
> reproduce (this is a W=1 build):
>          # save the attached .config to linux build tree
>          make W=1 ARCH=i386
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kbuild test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>, old ones prefixed by <<):
>
> ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_fixed_rate':
>>> clk.c:(.text+0x9e): undefined reference to `clk_register_fixed_rate'
>>> ld: clk.c:(.text+0xdf): undefined reference to `clk_unregister_fixed_rate'
> ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_fixed_factor':
>>> clk.c:(.text+0x117): undefined reference to `clk_register_fixed_factor'
>>> ld: clk.c:(.text+0x158): undefined reference to `clk_unregister_fixed_factor'
> ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_mux':
>>> clk.c:(.text+0x1cb): undefined reference to `clk_register_mux_table'
>>> ld: clk.c:(.text+0x1f2): undefined reference to `clk_register_clkdev'
>>> ld: clk.c:(.text+0x21a): undefined reference to `clk_unregister_mux'
> ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_divider':
>>> clk.c:(.text+0x2c9): undefined reference to `clk_register_divider_table'
> ld: clk.c:(.text+0x2e3): undefined reference to `clk_register_clkdev'
>>> ld: clk.c:(.text+0x311): undefined reference to `clk_unregister_divider'
> ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_gate':
>>> clk.c:(.text+0x36c): undefined reference to `clk_register_gate'
> ld: clk.c:(.text+0x393): undefined reference to `clk_register_clkdev'
>>> ld: clk.c:(.text+0x3bb): undefined reference to `clk_unregister_gate'
> ld: drivers/clk/hisilicon/clk.o: in function `hisi_clk_register_gate_sep':
>>> clk.c:(.text+0x425): undefined reference to `clk_register_clkdev'
> ld: drivers/clk/hisilicon/clk.o: in function `hi6220_clk_register_divider':
>>> clk.c:(.init.text+0x5d): undefined reference to `clk_register_clkdev'
> ld: drivers/clk/hisilicon/clkgate-separated.o: in function `hisi_register_clkgate_sep':
>>> clkgate-separated.c:(.text+0xf0): undefined reference to `clk_register'
> ld: drivers/clk/hisilicon/clkdivider-hi6220.o: in function `hi6220_clkdiv_set_rate':
>>> clkdivider-hi6220.c:(.text+0x16): undefined reference to `divider_get_val'
> ld: drivers/clk/hisilicon/clkdivider-hi6220.o: in function `hi6220_clkdiv_recalc_rate':
>>> clkdivider-hi6220.c:(.text+0x8a): undefined reference to `divider_recalc_rate'
> ld: drivers/clk/hisilicon/clkdivider-hi6220.o: in function `hi6220_clkdiv_round_rate':
>>> clkdivider-hi6220.c:(.text+0xa9): undefined reference to `clk_hw_get_parent'
>>> ld: clkdivider-hi6220.c:(.text+0xbd): undefined reference to `divider_round_rate_parent'
> ld: drivers/clk/hisilicon/clkdivider-hi6220.o: in function `hi6220_register_clkdiv':
>>> clkdivider-hi6220.c:(.text+0x1c5): undefined reference to `clk_register'
> ld: drivers/clk/hisilicon/clk-hisi-phase.o: in function `clk_register_hisi_phase':
>>> clk-hisi-phase.c:(.text+0x121): undefined reference to `devm_clk_register'
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot May 27, 2020, 7:56 a.m. UTC | #4
Hi Tiezhu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on clk/clk-next]
[also build test WARNING on v5.7-rc7 next-20200526]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Tiezhu-Yang/clk-hisilicon-Use-correct-return-value-about-hisi_reset_init/20200525-113342
base:   https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
config: x86_64-randconfig-s021-20200527 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-240-gf0fe1cd9-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

>> drivers/clk/hisilicon/reset.c:100:28: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected struct hisi_reset_controller * @@     got void [noderef] <asn:2> *membase @@
>> drivers/clk/hisilicon/reset.c:100:28: sparse:     expected struct hisi_reset_controller *
>> drivers/clk/hisilicon/reset.c:100:28: sparse:     got void [noderef] <asn:2> *membase

vim +100 drivers/clk/hisilicon/reset.c

25824d52caa8e61 Jiancheng Xue       2016-04-23   89  
97b7129cd2afb47 Jiancheng Xue       2016-06-15   90  struct hisi_reset_controller *hisi_reset_init(struct platform_device *pdev)
25824d52caa8e61 Jiancheng Xue       2016-04-23   91  {
25824d52caa8e61 Jiancheng Xue       2016-04-23   92  	struct hisi_reset_controller *rstc;
25824d52caa8e61 Jiancheng Xue       2016-04-23   93  
97b7129cd2afb47 Jiancheng Xue       2016-06-15   94  	rstc = devm_kmalloc(&pdev->dev, sizeof(*rstc), GFP_KERNEL);
25824d52caa8e61 Jiancheng Xue       2016-04-23   95  	if (!rstc)
78847951203a978 Tiezhu Yang         2020-05-25   96  		return ERR_PTR(-ENOMEM);
25824d52caa8e61 Jiancheng Xue       2016-04-23   97  
75cc0a123c90c8e YueHaibing          2019-10-14   98  	rstc->membase = devm_platform_ioremap_resource(pdev, 0);
e9a2310fb689151 Gustavo A. R. Silva 2018-07-25   99  	if (IS_ERR(rstc->membase))
78847951203a978 Tiezhu Yang         2020-05-25 @100  		return rstc->membase;
25824d52caa8e61 Jiancheng Xue       2016-04-23  101  
25824d52caa8e61 Jiancheng Xue       2016-04-23  102  	spin_lock_init(&rstc->lock);
25824d52caa8e61 Jiancheng Xue       2016-04-23  103  	rstc->rcdev.owner = THIS_MODULE;
25824d52caa8e61 Jiancheng Xue       2016-04-23  104  	rstc->rcdev.ops = &hisi_reset_ops;
97b7129cd2afb47 Jiancheng Xue       2016-06-15  105  	rstc->rcdev.of_node = pdev->dev.of_node;
25824d52caa8e61 Jiancheng Xue       2016-04-23  106  	rstc->rcdev.of_reset_n_cells = 2;
25824d52caa8e61 Jiancheng Xue       2016-04-23  107  	rstc->rcdev.of_xlate = hisi_reset_of_xlate;
25824d52caa8e61 Jiancheng Xue       2016-04-23  108  	reset_controller_register(&rstc->rcdev);
25824d52caa8e61 Jiancheng Xue       2016-04-23  109  
25824d52caa8e61 Jiancheng Xue       2016-04-23  110  	return rstc;
25824d52caa8e61 Jiancheng Xue       2016-04-23  111  }
25824d52caa8e61 Jiancheng Xue       2016-04-23  112  EXPORT_SYMBOL_GPL(hisi_reset_init);
25824d52caa8e61 Jiancheng Xue       2016-04-23  113  

:::::: The code at line 100 was first introduced by commit
:::::: 78847951203a978f4544f9e7dd244a3930b3945b clk: hisilicon: Use correct return value about hisi_reset_init()

:::::: TO: Tiezhu Yang <yangtiezhu@loongson.cn>
:::::: CC: 0day robot <lkp@intel.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
index f4169cc..81045ec 100644
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -79,7 +79,7 @@  obj-y					+= bcm/
 obj-$(CONFIG_ARCH_BERLIN)		+= berlin/
 obj-$(CONFIG_ARCH_DAVINCI)		+= davinci/
 obj-$(CONFIG_H8300)			+= h8300/
-obj-$(CONFIG_ARCH_HISI)			+= hisilicon/
+obj-y					+= hisilicon/
 obj-y					+= imgtec/
 obj-y					+= imx/
 obj-y					+= ingenic/