drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete type
Hi Daniel, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: cd4175b11685b11c40e31a03e05084cc212b0649 commit: dc11bae78529526605c5c45c369c9512fd012093 clocksource/drivers: Add timer-of common init routine date: 3 months ago config: ia64-allmodconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 6.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout dc11bae78529526605c5c45c369c9512fd012093 # save the attached .config to linux build tree make.cross ARCH=ia64 All errors (new ones prefixed by >>): In file included from drivers/clocksource/timer-of.c:25:0: >> drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete >> type struct clock_event_device clkevt; ^~ In file included from include/linux/clk.h:16:0, from drivers/clocksource/timer-of.c:18: drivers/clocksource/timer-of.h: In function 'to_timer_of': include/linux/kernel.h:854:48: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] const typeof( ((type *)0)->member ) *__mptr = (ptr); \ ^ drivers/clocksource/timer-of.h:44:9: note: in expansion of macro 'container_of' return container_of(clkevt, struct timer_of, clkevt); ^~~~ drivers/clocksource/timer-of.c: In function 'timer_irq_init': drivers/clocksource/timer-of.c:63:8: error: dereferencing pointer to incomplete type 'struct clock_event_device' clkevt->irq = of_irq->irq; ^~ cc1: some warnings being treated as errors vim +/clkevt +35 drivers/clocksource/timer-of.h 32 33 struct timer_of { 34 unsigned int flags; > 35 struct clock_event_device clkevt; 36 struct of_timer_base of_base; 37 struct of_timer_irq of_irq; 38 struct of_timer_clk of_clk; 39 void *private_data; 40 }; 41 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete type
On Tue, Sep 5, 2017 at 12:33 PM, Arnd Bergmann wrote: > On Mon, Sep 4, 2017 at 7:01 PM, Randy Dunlap wrote: >> On 09/02/17 23:28, kbuild test robot wrote: > >> >> Summary: >> >> GENERIC_CLOCKEVENTS is not enabled. (ia64) >> COMPILE_TEST=y >> >> # >> # Clock Source drivers >> # >> CONFIG_TIMER_OF=y >> CONFIG_CLKSRC_MMIO=y >> # CONFIG_CLKSRC_PISTACHIO is not set >> CONFIG_ARMV7M_SYSTICK=y >> # CONFIG_ATMEL_PIT is not set >> CONFIG_CLKSRC_ST_LPC=y >> >> Both ARMV7M_SYSTICK and CLKSRC_ST_LPC select TIMER_OF (if OF, which is >> enabled) >> and select CLKSRC_MMIO. TIMER_OF depends on GENERIC_CLOCKEVENTS (=n), but >> 'select' does not care about that "depends on". >> >> This build error only happens because COMPILE_TEST=y. >> >> Any driver that does 'select TIMER_OF' should also depend on >> GENERIC_CLOCKEVENTS. >> The problem is that some drivers do 'select TIMER_OF if OF', so if OF is not >> enabled, then we don't need to depend on GENERIC_CLOCKEVENTS. >> >> >> "O, what a tangled web we weave when first we practise to deceive!" --Walter >> Scott >> >> Not that we are trying to deceive in this case -- it's just another Kconfig >> tangled web. >> >> Arnd: any ideas? > The only architectures that use neither GENERIC_CLOCKEVENTS > nor ARCH_USES_GETTIMEOFFSET are frv, ia64 and some m68k > configurations. If we can show that none of those configurations > ever rely on clocksource drivers, we can simplify the > drivers/clocksource/Kconfig file a lot by using a > GENERIC_CLOCKEVENTS for the top-level option and removing > all the other dependencies in there. I had a closer look at this, and found a third one: CONFIG_CLKSRC_NPS should show the same bug as CONFIG_ARMV7M_SYSTICK and CLKSRC_ST_LPC on the two 32-bit architectures, it just did not trigger on ia64 because of the '!PHYS_ADDR_T_64BIT' dependency. None of those three drivers makes any sense on any of the three architectures though, and all other drivers directly or indirectly depend on GENERIC_CLOCKEVENTS already, so simply making the whole directory depend on GENERIC_CLOCKEVENTS should solve this problem for good. I'll send a patch. Arnd
Re: drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete type
On Mon, Sep 4, 2017 at 7:01 PM, Randy Dunlap wrote: > On 09/02/17 23:28, kbuild test robot wrote: > > Summary: > > GENERIC_CLOCKEVENTS is not enabled. (ia64) > COMPILE_TEST=y > > # > # Clock Source drivers > # > CONFIG_TIMER_OF=y > CONFIG_CLKSRC_MMIO=y > # CONFIG_CLKSRC_PISTACHIO is not set > CONFIG_ARMV7M_SYSTICK=y > # CONFIG_ATMEL_PIT is not set > CONFIG_CLKSRC_ST_LPC=y > > Both ARMV7M_SYSTICK and CLKSRC_ST_LPC select TIMER_OF (if OF, which is > enabled) > and select CLKSRC_MMIO. TIMER_OF depends on GENERIC_CLOCKEVENTS (=n), but > 'select' does not care about that "depends on". > > This build error only happens because COMPILE_TEST=y. > > Any driver that does 'select TIMER_OF' should also depend on > GENERIC_CLOCKEVENTS. > The problem is that some drivers do 'select TIMER_OF if OF', so if OF is not > enabled, then we don't need to depend on GENERIC_CLOCKEVENTS. > > > "O, what a tangled web we weave when first we practise to deceive!" --Walter > Scott > > Not that we are trying to deceive in this case -- it's just another Kconfig > tangled web. > > Arnd: any ideas? I think most architectures don't run into this because they select either GENERIC_CLOCKEVENTS or ARCH_USES_GETTIMEOFFSET. I thought that you need exactly one of the two (this is true on ARM), but apparently ia64 is an exception. I'm pretty sure that we don't ever need clocksource drivers on ia64, so an easy workaround would be to make the entire file depend on "!ARCH_USES_GETTIMEOFFSET && !IA64", but we can probably do better than that. The only architectures that use neither GENERIC_CLOCKEVENTS nor ARCH_USES_GETTIMEOFFSET are frv, ia64 and some m68k configurations. If we can show that none of those configurations ever rely on clocksource drivers, we can simplify the drivers/clocksource/Kconfig file a lot by using a GENERIC_CLOCKEVENTS for the top-level option and removing all the other dependencies in there. Arnd
Re: drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete type
On 09/02/17 23:28, kbuild test robot wrote: > Hi Daniel, > > FYI, the error/warning still remains. > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > master > head: d0d6ab53c9abd7dd1070f43a0455328874127ba8 > commit: dc11bae78529526605c5c45c369c9512fd012093 clocksource/drivers: Add > timer-of common init routine > date: 3 months ago > config: ia64-allyesconfig (attached as .config) > compiler: ia64-linux-gcc (GCC) 6.2.0 > reproduce: > wget > https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O > ~/bin/make.cross > chmod +x ~/bin/make.cross > git checkout dc11bae78529526605c5c45c369c9512fd012093 > # save the attached .config to linux build tree > make.cross ARCH=ia64 > > All errors (new ones prefixed by >>): > >In file included from drivers/clocksource/timer-of.c:25:0: >>> drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete >>> type > struct clock_event_device clkevt; >^~ >In file included from include/linux/clk.h:16:0, > from drivers/clocksource/timer-of.c:18: >drivers/clocksource/timer-of.h: In function 'to_timer_of': >include/linux/kernel.h:854:48: error: initialization from incompatible > pointer type [-Werror=incompatible-pointer-types] > const typeof( ((type *)0)->member ) *__mptr = (ptr); \ >^ >drivers/clocksource/timer-of.h:44:9: note: in expansion of macro > 'container_of' > return container_of(clkevt, struct timer_of, clkevt); > ^~~~ >drivers/clocksource/timer-of.c: In function 'timer_irq_init': >drivers/clocksource/timer-of.c:63:8: error: dereferencing pointer to > incomplete type 'struct clock_event_device' > clkevt->irq = of_irq->irq; >^~ >cc1: some warnings being treated as errors > > vim +/clkevt +35 drivers/clocksource/timer-of.h > > 32 > 33struct timer_of { > 34unsigned int flags; > > 35struct clock_event_device clkevt; > 36struct of_timer_base of_base; > 37struct of_timer_irq of_irq; > 38struct of_timer_clk of_clk; > 39void *private_data; > 40}; > 41 > > --- Summary: GENERIC_CLOCKEVENTS is not enabled. (ia64) COMPILE_TEST=y # # Clock Source drivers # CONFIG_TIMER_OF=y CONFIG_CLKSRC_MMIO=y # CONFIG_CLKSRC_PISTACHIO is not set CONFIG_ARMV7M_SYSTICK=y # CONFIG_ATMEL_PIT is not set CONFIG_CLKSRC_ST_LPC=y Both ARMV7M_SYSTICK and CLKSRC_ST_LPC select TIMER_OF (if OF, which is enabled) and select CLKSRC_MMIO. TIMER_OF depends on GENERIC_CLOCKEVENTS (=n), but 'select' does not care about that "depends on". This build error only happens because COMPILE_TEST=y. Any driver that does 'select TIMER_OF' should also depend on GENERIC_CLOCKEVENTS. The problem is that some drivers do 'select TIMER_OF if OF', so if OF is not enabled, then we don't need to depend on GENERIC_CLOCKEVENTS. "O, what a tangled web we weave when first we practise to deceive!" --Walter Scott Not that we are trying to deceive in this case -- it's just another Kconfig tangled web. Arnd: any ideas? thanks, -- ~Randy
drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete type
Hi Daniel, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: d0d6ab53c9abd7dd1070f43a0455328874127ba8 commit: dc11bae78529526605c5c45c369c9512fd012093 clocksource/drivers: Add timer-of common init routine date: 3 months ago config: ia64-allyesconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 6.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout dc11bae78529526605c5c45c369c9512fd012093 # save the attached .config to linux build tree make.cross ARCH=ia64 All errors (new ones prefixed by >>): In file included from drivers/clocksource/timer-of.c:25:0: >> drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete >> type struct clock_event_device clkevt; ^~ In file included from include/linux/clk.h:16:0, from drivers/clocksource/timer-of.c:18: drivers/clocksource/timer-of.h: In function 'to_timer_of': include/linux/kernel.h:854:48: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] const typeof( ((type *)0)->member ) *__mptr = (ptr); \ ^ drivers/clocksource/timer-of.h:44:9: note: in expansion of macro 'container_of' return container_of(clkevt, struct timer_of, clkevt); ^~~~ drivers/clocksource/timer-of.c: In function 'timer_irq_init': drivers/clocksource/timer-of.c:63:8: error: dereferencing pointer to incomplete type 'struct clock_event_device' clkevt->irq = of_irq->irq; ^~ cc1: some warnings being treated as errors vim +/clkevt +35 drivers/clocksource/timer-of.h 32 33 struct timer_of { 34 unsigned int flags; > 35 struct clock_event_device clkevt; 36 struct of_timer_base of_base; 37 struct of_timer_irq of_irq; 38 struct of_timer_clk of_clk; 39 void *private_data; 40 }; 41 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete type
Hi Daniel, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 89a55278dee487b172fb16295ccb2d0b2a1b319b commit: dc11bae78529526605c5c45c369c9512fd012093 clocksource/drivers: Add timer-of common init routine date: 9 weeks ago config: ia64-allyesconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 6.2.0 reproduce: wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout dc11bae78529526605c5c45c369c9512fd012093 # save the attached .config to linux build tree make.cross ARCH=ia64 All errors (new ones prefixed by >>): In file included from drivers/clocksource/timer-of.c:25:0: >> drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete >> type struct clock_event_device clkevt; ^~ In file included from include/linux/clk.h:16:0, from drivers/clocksource/timer-of.c:18: drivers/clocksource/timer-of.h: In function 'to_timer_of': include/linux/kernel.h:854:48: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] const typeof( ((type *)0)->member ) *__mptr = (ptr); \ ^ drivers/clocksource/timer-of.h:44:9: note: in expansion of macro 'container_of' return container_of(clkevt, struct timer_of, clkevt); ^~~~ drivers/clocksource/timer-of.c: In function 'timer_irq_init': drivers/clocksource/timer-of.c:63:8: error: dereferencing pointer to incomplete type 'struct clock_event_device' clkevt->irq = of_irq->irq; ^~ cc1: some warnings being treated as errors vim +/clkevt +35 drivers/clocksource/timer-of.h 32 33 struct timer_of { 34 unsigned int flags; > 35 struct clock_event_device clkevt; 36 struct of_timer_base of_base; 37 struct of_timer_irq of_irq; 38 struct of_timer_clk of_clk; 39 void *private_data; 40 }; 41 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete type
Hi Daniel, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 0fdd951c9bef93637d5af036851e7a5632fbd6c3 commit: dc11bae78529526605c5c45c369c9512fd012093 clocksource/drivers: Add timer-of common init routine date: 8 weeks ago config: ia64-allyesconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 6.2.0 reproduce: wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout dc11bae78529526605c5c45c369c9512fd012093 # save the attached .config to linux build tree make.cross ARCH=ia64 All errors (new ones prefixed by >>): In file included from drivers/clocksource/timer-of.c:25:0: >> drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete >> type struct clock_event_device clkevt; ^~ In file included from include/linux/clk.h:16:0, from drivers/clocksource/timer-of.c:18: drivers/clocksource/timer-of.h: In function 'to_timer_of': include/linux/kernel.h:854:48: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] const typeof( ((type *)0)->member ) *__mptr = (ptr); \ ^ drivers/clocksource/timer-of.h:44:9: note: in expansion of macro 'container_of' return container_of(clkevt, struct timer_of, clkevt); ^~~~ drivers/clocksource/timer-of.c: In function 'timer_irq_init': drivers/clocksource/timer-of.c:63:8: error: dereferencing pointer to incomplete type 'struct clock_event_device' clkevt->irq = of_irq->irq; ^~ cc1: some warnings being treated as errors vim +/clkevt +35 drivers/clocksource/timer-of.h 32 33 struct timer_of { 34 unsigned int flags; > 35 struct clock_event_device clkevt; 36 struct of_timer_base of_base; 37 struct of_timer_irq of_irq; 38 struct of_timer_clk of_clk; 39 void *private_data; 40 }; 41 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete type
Hi Daniel, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 0a07b238e5f488b459b6113a62e06b6aab017f71 commit: dc11bae78529526605c5c45c369c9512fd012093 clocksource/drivers: Add timer-of common init routine date: 7 weeks ago config: ia64-allyesconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 6.2.0 reproduce: wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout dc11bae78529526605c5c45c369c9512fd012093 # save the attached .config to linux build tree make.cross ARCH=ia64 All errors (new ones prefixed by >>): In file included from drivers/clocksource/timer-of.c:25:0: >> drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete >> type struct clock_event_device clkevt; ^~ In file included from include/linux/clk.h:16:0, from drivers/clocksource/timer-of.c:18: drivers/clocksource/timer-of.h: In function 'to_timer_of': include/linux/kernel.h:854:48: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] const typeof( ((type *)0)->member ) *__mptr = (ptr); \ ^ drivers/clocksource/timer-of.h:44:9: note: in expansion of macro 'container_of' return container_of(clkevt, struct timer_of, clkevt); ^~~~ drivers/clocksource/timer-of.c: In function 'timer_irq_init': drivers/clocksource/timer-of.c:63:8: error: dereferencing pointer to incomplete type 'struct clock_event_device' clkevt->irq = of_irq->irq; ^~ cc1: some warnings being treated as errors vim +/clkevt +35 drivers/clocksource/timer-of.h 32 33 struct timer_of { 34 unsigned int flags; > 35 struct clock_event_device clkevt; 36 struct of_timer_base of_base; 37 struct of_timer_irq of_irq; 38 struct of_timer_clk of_clk; 39 void *private_data; 40 }; 41 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete type
Hi Daniel, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 96080f697786e0a30006fcbcc5b53f350fcb3e9f commit: dc11bae78529526605c5c45c369c9512fd012093 clocksource/drivers: Add timer-of common init routine date: 6 weeks ago config: ia64-allmodconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 6.2.0 reproduce: wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout dc11bae78529526605c5c45c369c9512fd012093 # save the attached .config to linux build tree make.cross ARCH=ia64 All errors (new ones prefixed by >>): In file included from drivers/clocksource/timer-of.c:25:0: >> drivers/clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete >> type struct clock_event_device clkevt; ^~ In file included from include/linux/clk.h:16:0, from drivers/clocksource/timer-of.c:18: drivers/clocksource/timer-of.h: In function 'to_timer_of': include/linux/kernel.h:854:48: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] const typeof( ((type *)0)->member ) *__mptr = (ptr); \ ^ drivers/clocksource/timer-of.h:44:9: note: in expansion of macro 'container_of' return container_of(clkevt, struct timer_of, clkevt); ^~~~ drivers/clocksource/timer-of.c: In function 'timer_irq_init': drivers/clocksource/timer-of.c:63:8: error: dereferencing pointer to incomplete type 'struct clock_event_device' clkevt->irq = of_irq->irq; ^~ cc1: some warnings being treated as errors vim +/clkevt +35 drivers/clocksource/timer-of.h 32 33 struct timer_of { 34 unsigned int flags; > 35 struct clock_event_device clkevt; 36 struct of_timer_base of_base; 37 struct of_timer_irq of_irq; 38 struct of_timer_clk of_clk; 39 void *private_data; 40 }; 41 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
drivers//clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete type
Hi Daniel, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 5771a8c08880cdca3bfb4a3fc6d309d6bba20877 commit: dc11bae78529526605c5c45c369c9512fd012093 clocksource/drivers: Add timer-of common init routine date: 5 weeks ago config: ia64-allmodconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 6.2.0 reproduce: wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout dc11bae78529526605c5c45c369c9512fd012093 # save the attached .config to linux build tree make.cross ARCH=ia64 All errors (new ones prefixed by >>): In file included from drivers//clocksource/timer-of.c:25:0: >> drivers//clocksource/timer-of.h:35:28: error: field 'clkevt' has incomplete >> type struct clock_event_device clkevt; ^~ In file included from include/linux/clk.h:16:0, from drivers//clocksource/timer-of.c:18: drivers//clocksource/timer-of.h: In function 'to_timer_of': include/linux/kernel.h:854:48: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] const typeof( ((type *)0)->member ) *__mptr = (ptr); \ ^ drivers//clocksource/timer-of.h:44:9: note: in expansion of macro 'container_of' return container_of(clkevt, struct timer_of, clkevt); ^~~~ drivers//clocksource/timer-of.c: In function 'timer_irq_init': drivers//clocksource/timer-of.c:63:8: error: dereferencing pointer to incomplete type 'struct clock_event_device' clkevt->irq = of_irq->irq; ^~ cc1: some warnings being treated as errors vim +/clkevt +35 drivers//clocksource/timer-of.h 32 33 struct timer_of { 34 unsigned int flags; > 35 struct clock_event_device clkevt; 36 struct of_timer_base of_base; 37 struct of_timer_irq of_irq; 38 struct of_timer_clk of_clk; 39 void *private_data; 40 }; 41 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip