LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] kernel/module: silence a gcc warning
@ 2018-04-11 19:05 Mathieu Malaterre
  2018-04-13  1:42 ` kbuild test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mathieu Malaterre @ 2018-04-11 19:05 UTC (permalink / raw)
  To: Jessica Yu; +Cc: Mathieu Malaterre, linux-kernel

In commit 8c8ef42aee8f ("module: include other structures in module version
check"), the function `struct_module` was renamed to `module_layout` but no
prototype was added to `include/linux/module.h`. Remove warning triggered
at W=1:

  kernel/module.c:4378:6: warning: no previous prototype for ‘module_layout’ [-Wmissing-prototypes]

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 include/linux/module.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/linux/module.h b/include/linux/module.h
index d44df9b2c131..28046e8b7e9d 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -786,6 +786,14 @@ extern int module_sysfs_initialized;
 
 #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)
 
+#ifdef CONFIG_MODVERSIONS
+void module_layout(struct module *mod,
+		   struct modversion_info *ver,
+		   struct kernel_param *kp,
+		   struct kernel_symbol *ks,
+		   struct tracepoint * const *tp);
+#endif /* CONFIG_MODVERSIONS */
+
 /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */
 
 #define __MODULE_STRING(x) __stringify(x)
-- 
2.11.0

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

* Re: [PATCH] kernel/module: silence a gcc warning
  2018-04-11 19:05 [PATCH] kernel/module: silence a gcc warning Mathieu Malaterre
@ 2018-04-13  1:42 ` kbuild test robot
  2018-04-13  3:08 ` kbuild test robot
  2018-04-16 17:11 ` Jessica Yu
  2 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2018-04-13  1:42 UTC (permalink / raw)
  To: Mathieu Malaterre; +Cc: kbuild-all, Jessica Yu, Mathieu Malaterre, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 27788 bytes --]

Hi Mathieu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.16 next-20180412]
[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/Mathieu-Malaterre/kernel-module-silence-a-gcc-warning/20180413-044304
config: x86_64-randconfig-u0-04130525 (attached as .config)
compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   In file included from drivers/net/ethernet/cavium/common/cavium_ptp.c:7:0:
>> include/linux/module.h:794:13: warning: 'struct tracepoint' declared inside parameter list
         struct tracepoint * const *tp);
                ^
>> include/linux/module.h:794:13: warning: its scope is only this definition or declaration, which is probably not what you want
   Cyclomatic Complexity 1 include/linux/err.h:ERR_PTR
   Cyclomatic Complexity 1 include/linux/err.h:PTR_ERR
   Cyclomatic Complexity 1 include/linux/err.h:IS_ERR
   Cyclomatic Complexity 3 include/linux/err.h:IS_ERR_OR_NULL
   Cyclomatic Complexity 1 include/linux/math64.h:div_u64_rem
   Cyclomatic Complexity 1 include/linux/math64.h:div_u64
   Cyclomatic Complexity 1 include/linux/spinlock.h:spinlock_check
   Cyclomatic Complexity 1 include/linux/spinlock.h:spin_unlock_irqrestore
   Cyclomatic Complexity 1 include/linux/time64.h:timespec64_to_ns
   Cyclomatic Complexity 1 include/linux/timekeeping.h:ktime_get_real
   Cyclomatic Complexity 1 arch/x86/include/asm/io.h:readq
   Cyclomatic Complexity 1 arch/x86/include/asm/io.h:writeq
   Cyclomatic Complexity 1 include/linux/kobject.h:kobject_name
   Cyclomatic Complexity 1 include/linux/device.h:devm_kzalloc
   Cyclomatic Complexity 2 include/linux/device.h:dev_name
   Cyclomatic Complexity 1 include/linux/device.h:dev_get_drvdata
   Cyclomatic Complexity 1 include/linux/device.h:dev_set_drvdata
   Cyclomatic Complexity 1 include/linux/timecounter.h:timecounter_adjtime
   Cyclomatic Complexity 1 include/linux/pci.h:pci_get_drvdata
   Cyclomatic Complexity 1 include/linux/pci.h:pci_set_drvdata
   Cyclomatic Complexity 1 include/linux/pci.h:pci_name
   Cyclomatic Complexity 1 include/linux/ptp_clock_kernel.h:ptp_clock_register
   Cyclomatic Complexity 1 include/linux/ptp_clock_kernel.h:ptp_clock_unregister
   Cyclomatic Complexity 1 drivers/net/ethernet/cavium/common/cavium_ptp.c:cavium_ptp_enable
   Cyclomatic Complexity 2 drivers/net/ethernet/cavium/common/cavium_ptp.c:cavium_ptp_remove
   Cyclomatic Complexity 4 drivers/net/ethernet/cavium/common/cavium_ptp.c:cavium_ptp_get
   Cyclomatic Complexity 2 drivers/net/ethernet/cavium/common/cavium_ptp.c:cavium_ptp_put
   Cyclomatic Complexity 1 drivers/net/ethernet/cavium/common/cavium_ptp.c:cavium_ptp_driver_init
   Cyclomatic Complexity 2 drivers/net/ethernet/cavium/common/cavium_ptp.c:cavium_ptp_settime
   Cyclomatic Complexity 2 drivers/net/ethernet/cavium/common/cavium_ptp.c:cavium_ptp_gettime
   Cyclomatic Complexity 2 drivers/net/ethernet/cavium/common/cavium_ptp.c:cavium_ptp_adjtime
   Cyclomatic Complexity 4 drivers/net/ethernet/cavium/common/cavium_ptp.c:cavium_ptp_adjfine
   Cyclomatic Complexity 2 drivers/net/ethernet/cavium/common/cavium_ptp.c:cavium_ptp_cc_read
   Cyclomatic Complexity 3 drivers/net/ethernet/cavium/common/cavium_ptp.c:ptp_cavium_clock_get
   Cyclomatic Complexity 6 drivers/net/ethernet/cavium/common/cavium_ptp.c:cavium_ptp_probe
   Cyclomatic Complexity 1 drivers/net/ethernet/cavium/common/cavium_ptp.c:cavium_ptp_driver_exit
--
   In file included from drivers/ntb/ntb.c:58:0:
>> include/linux/module.h:794:13: warning: 'struct tracepoint' declared inside parameter list
         struct tracepoint * const *tp);
                ^
>> include/linux/module.h:794:13: warning: its scope is only this definition or declaration, which is probably not what you want
   Cyclomatic Complexity 1 include/linux/spinlock.h:spinlock_check
   Cyclomatic Complexity 1 include/linux/spinlock.h:spin_unlock_irqrestore
   Cyclomatic Complexity 1 include/linux/completion.h:__init_completion
   Cyclomatic Complexity 1 include/linux/kobject.h:kobject_name
   Cyclomatic Complexity 2 include/linux/device.h:dev_name
   Cyclomatic Complexity 3 include/linux/ntb.h:ntb_client_ops_is_valid
   Cyclomatic Complexity 1 include/linux/ntb.h:ntb_ctx_ops_is_valid
   Cyclomatic Complexity 29 include/linux/ntb.h:ntb_dev_ops_is_valid
   Cyclomatic Complexity 1 include/linux/pci.h:pci_name
   Cyclomatic Complexity 3 drivers/ntb/ntb.c:ntb_set_ctx
   Cyclomatic Complexity 1 drivers/ntb/ntb.c:ntb_clear_ctx
   Cyclomatic Complexity 3 drivers/ntb/ntb.c:ntb_link_event
   Cyclomatic Complexity 3 drivers/ntb/ntb.c:ntb_db_event
   Cyclomatic Complexity 3 drivers/ntb/ntb.c:ntb_msg_event
   Cyclomatic Complexity 3 drivers/ntb/ntb.c:ntb_default_port_number
   Cyclomatic Complexity 1 drivers/ntb/ntb.c:ntb_default_peer_port_count
   Cyclomatic Complexity 4 drivers/ntb/ntb.c:ntb_default_peer_port_number
   Cyclomatic Complexity 2 drivers/ntb/ntb.c:ntb_default_peer_port_idx
   Cyclomatic Complexity 3 drivers/ntb/ntb.c:__ntb_register_client
   Cyclomatic Complexity 4 drivers/ntb/ntb.c:ntb_remove
   Cyclomatic Complexity 4 drivers/ntb/ntb.c:ntb_probe
   Cyclomatic Complexity 1 drivers/ntb/ntb.c:ntb_unregister_client
   Cyclomatic Complexity 5 drivers/ntb/ntb.c:ntb_register_device
   Cyclomatic Complexity 2 drivers/ntb/ntb.c:ntb_dev_release
   Cyclomatic Complexity 1 drivers/ntb/ntb.c:ntb_unregister_device
   Cyclomatic Complexity 1 drivers/ntb/ntb.c:ntb_driver_init
   Cyclomatic Complexity 1 drivers/ntb/ntb.c:ntb_driver_exit
--
   In file included from drivers/ntb/hw/amd/ntb_hw_amd.c:55:0:
>> include/linux/module.h:794:13: warning: 'struct tracepoint' declared inside parameter list
         struct tracepoint * const *tp);
                ^
>> include/linux/module.h:794:13: warning: its scope is only this definition or declaration, which is probably not what you want
   Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls64
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u64
   Cyclomatic Complexity 1 include/linux/list.h:INIT_LIST_HEAD
   Cyclomatic Complexity 1 arch/x86/include/asm/mem_encrypt.h:sme_active
   Cyclomatic Complexity 1 include/linux/mem_encrypt.h:sme_get_me_mask
   Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
   Cyclomatic Complexity 1 include/linux/spinlock.h:spinlock_check
   Cyclomatic Complexity 1 include/linux/spinlock.h:spin_unlock_irqrestore
   Cyclomatic Complexity 1 include/linux/jiffies.h:_msecs_to_jiffies
   Cyclomatic Complexity 3 include/linux/jiffies.h:msecs_to_jiffies
   Cyclomatic Complexity 1 include/linux/workqueue.h:__init_work
   Cyclomatic Complexity 1 include/linux/workqueue.h:queue_delayed_work
   Cyclomatic Complexity 1 include/linux/workqueue.h:schedule_delayed_work
   Cyclomatic Complexity 1 arch/x86/include/asm/io.h:readw
   Cyclomatic Complexity 1 arch/x86/include/asm/io.h:readl
   Cyclomatic Complexity 1 arch/x86/include/asm/io.h:writew
   Cyclomatic Complexity 1 arch/x86/include/asm/io.h:writel
   Cyclomatic Complexity 1 arch/x86/include/asm/io.h:readq
   Cyclomatic Complexity 1 arch/x86/include/asm/io.h:writeq
   Cyclomatic Complexity 1 include/linux/kasan.h:kasan_kmalloc
   Cyclomatic Complexity 28 include/linux/slab.h:kmalloc_index
   Cyclomatic Complexity 1 include/linux/slab.h:__kmalloc_node
   Cyclomatic Complexity 1 include/linux/slab.h:kmem_cache_alloc_node
   Cyclomatic Complexity 1 include/linux/slab.h:kmem_cache_alloc_trace
   Cyclomatic Complexity 1 include/linux/slab.h:kmem_cache_alloc_node_trace
   Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_order_trace
   Cyclomatic Complexity 68 include/linux/slab.h:kmalloc_large
   Cyclomatic Complexity 5 include/linux/slab.h:kmalloc
   Cyclomatic Complexity 5 include/linux/slab.h:kmalloc_node
   Cyclomatic Complexity 1 include/linux/slab.h:kzalloc_node
   Cyclomatic Complexity 1 include/linux/kobject.h:kobject_name
   Cyclomatic Complexity 1 include/linux/interrupt.h:request_irq
   Cyclomatic Complexity 2 include/linux/device.h:dev_name
   Cyclomatic Complexity 1 include/linux/device.h:dev_to_node
   Cyclomatic Complexity 1 include/linux/device.h:dev_get_drvdata
   Cyclomatic Complexity 1 include/linux/device.h:dev_set_drvdata
   Cyclomatic Complexity 1 include/linux/pci.h:pci_dev_msi_enabled
   Cyclomatic Complexity 1 include/linux/pci.h:pci_get_drvdata
   Cyclomatic Complexity 1 include/linux/pci.h:pci_set_drvdata
   Cyclomatic Complexity 1 include/linux/pci.h:pci_name
   Cyclomatic Complexity 1 arch/x86/include/asm/dma-mapping.h:get_arch_dma_ops
   Cyclomatic Complexity 4 include/linux/dma-mapping.h:get_dma_ops
   Cyclomatic Complexity 3 include/linux/dma-mapping.h:dma_check_mask
   Cyclomatic Complexity 4 include/linux/dma-mapping.h:dma_supported
   Cyclomatic Complexity 3 include/linux/dma-mapping.h:dma_set_mask
   Cyclomatic Complexity 4 include/linux/dma-mapping.h:dma_get_mask
   Cyclomatic Complexity 2 include/linux/dma-mapping.h:dma_set_coherent_mask
   Cyclomatic Complexity 2 include/linux/dma-mapping.h:dma_set_mask_and_coherent
   Cyclomatic Complexity 1 include/linux/dma-mapping.h:dma_coerce_mask_and_coherent
   Cyclomatic Complexity 1 include/linux/pci-dma-compat.h:pci_set_dma_mask
   Cyclomatic Complexity 1 include/linux/pci-dma-compat.h:pci_set_consistent_dma_mask
   Cyclomatic Complexity 8 include/linux/ntb.h:ntb_topo_string
   Cyclomatic Complexity 3 drivers/ntb/hw/amd/ntb_hw_amd.c:ndev_mw_to_bar
   Cyclomatic Complexity 5 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_link_is_up
   Cyclomatic Complexity 1 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ack_smu
   Cyclomatic Complexity 1 drivers/ntb/hw/amd/ntb_hw_amd.c:ndev_init_struct
   Cyclomatic Complexity 2 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_init_side_info
   Cyclomatic Complexity 2 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_deinit_side_info
   Cyclomatic Complexity 2 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_get_topo
   Cyclomatic Complexity 2 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_pci_driver_init
   Cyclomatic Complexity 1 drivers/ntb/hw/amd/ntb_hw_amd.c:ndev_deinit_debugfs
   Cyclomatic Complexity 4 drivers/ntb/hw/amd/ntb_hw_amd.c:ndev_deinit_isr
   Cyclomatic Complexity 1 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_deinit_dev
   Cyclomatic Complexity 1 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_deinit_pci
   Cyclomatic Complexity 1 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_pci_remove
   Cyclomatic Complexity 9 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_mw_get_align
   Cyclomatic Complexity 4 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_link_disable
   Cyclomatic Complexity 3 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_mw_count
   Cyclomatic Complexity 4 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_spad_write
   Cyclomatic Complexity 2 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_db_valid_mask
   Cyclomatic Complexity 2 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_db_read
   Cyclomatic Complexity 2 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_peer_db_set
   Cyclomatic Complexity 3 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_db_clear_mask
   Cyclomatic Complexity 7 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_peer_mw_get_addr
   Cyclomatic Complexity 5 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_db_vector_mask
   Cyclomatic Complexity 4 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_peer_spad_read
   Cyclomatic Complexity 2 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_peer_mw_count
   Cyclomatic Complexity 9 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_link_is_up
   Cyclomatic Complexity 2 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_db_vector_count
   Cyclomatic Complexity 4 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_spad_read
   Cyclomatic Complexity 3 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_db_set_mask
   Cyclomatic Complexity 4 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_peer_spad_write
   Cyclomatic Complexity 12 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_mw_set_trans
   Cyclomatic Complexity 4 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_link_enable
   Cyclomatic Complexity 2 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_db_clear
   Cyclomatic Complexity 2 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_spad_count
   Cyclomatic Complexity 9 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_init_pci
   Cyclomatic Complexity 3 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_init_ntb
   Cyclomatic Complexity 8 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_handle_event
   Cyclomatic Complexity 15 drivers/ntb/hw/amd/ntb_hw_amd.c:ndev_init_isr
   Cyclomatic Complexity 1 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_init_isr
   Cyclomatic Complexity 4 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_init_dev
   Cyclomatic Complexity 5 drivers/ntb/hw/amd/ntb_hw_amd.c:ndev_interrupt
   Cyclomatic Complexity 1 drivers/ntb/hw/amd/ntb_hw_amd.c:ndev_irq_isr
   Cyclomatic Complexity 1 drivers/ntb/hw/amd/ntb_hw_amd.c:ndev_vec_isr
   Cyclomatic Complexity 4 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_poll_link
   Cyclomatic Complexity 4 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_link_hb
   Cyclomatic Complexity 3 drivers/ntb/hw/amd/ntb_hw_amd.c:ndev_init_debugfs
   Cyclomatic Complexity 5 drivers/ntb/hw/amd/ntb_hw_amd.c:amd_ntb_pci_probe
--
   In file included from drivers/ntb/hw/idt/ntb_hw_idt.c:47:0:
>> include/linux/module.h:794:13: warning: 'struct tracepoint' declared inside parameter list
         struct tracepoint * const *tp);
                ^
>> include/linux/module.h:794:13: warning: its scope is only this definition or declaration, which is probably not what you want
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls64
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u64
   Cyclomatic Complexity 1 arch/x86/include/asm/mem_encrypt.h:sme_active
   Cyclomatic Complexity 1 include/linux/mem_encrypt.h:sme_get_me_mask
   Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
   Cyclomatic Complexity 1 include/linux/err.h:ERR_PTR
   Cyclomatic Complexity 1 include/linux/err.h:PTR_ERR
   Cyclomatic Complexity 1 include/linux/err.h:IS_ERR
   Cyclomatic Complexity 3 include/linux/err.h:IS_ERR_OR_NULL
   Cyclomatic Complexity 1 include/linux/spinlock.h:spinlock_check
   Cyclomatic Complexity 1 include/linux/spinlock.h:spin_unlock_irqrestore
   Cyclomatic Complexity 1 include/linux/kobject.h:kobject_name
   Cyclomatic Complexity 1 include/linux/kasan.h:kasan_kmalloc
   Cyclomatic Complexity 28 include/linux/slab.h:kmalloc_index
   Cyclomatic Complexity 1 include/linux/slab.h:kmem_cache_alloc_trace
   Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_order_trace
   Cyclomatic Complexity 68 include/linux/slab.h:kmalloc_large
   Cyclomatic Complexity 5 include/linux/slab.h:kmalloc
   Cyclomatic Complexity 1 include/linux/device.h:devm_kzalloc
   Cyclomatic Complexity 3 include/linux/device.h:devm_kmalloc_array
   Cyclomatic Complexity 1 include/linux/device.h:devm_kcalloc
   Cyclomatic Complexity 2 include/linux/device.h:dev_name
   Cyclomatic Complexity 1 include/linux/device.h:dev_get_drvdata
   Cyclomatic Complexity 1 include/linux/device.h:dev_set_drvdata
   Cyclomatic Complexity 1 include/linux/pci.h:pci_alloc_irq_vectors
   Cyclomatic Complexity 1 include/linux/pci.h:pci_get_drvdata
   Cyclomatic Complexity 1 include/linux/pci.h:pci_set_drvdata
   Cyclomatic Complexity 1 include/linux/pci.h:pci_name
   Cyclomatic Complexity 1 arch/x86/include/asm/dma-mapping.h:get_arch_dma_ops
   Cyclomatic Complexity 4 include/linux/dma-mapping.h:get_dma_ops
   Cyclomatic Complexity 3 include/linux/dma-mapping.h:dma_check_mask
   Cyclomatic Complexity 4 include/linux/dma-mapping.h:dma_supported
   Cyclomatic Complexity 3 include/linux/dma-mapping.h:dma_set_mask
   Cyclomatic Complexity 4 include/linux/dma-mapping.h:dma_get_mask
   Cyclomatic Complexity 2 include/linux/dma-mapping.h:dma_set_coherent_mask
   Cyclomatic Complexity 2 include/linux/dma-mapping.h:dma_set_mask_and_coherent
   Cyclomatic Complexity 1 include/linux/dma-mapping.h:dma_coerce_mask_and_coherent
   Cyclomatic Complexity 1 include/linux/pci-dma-compat.h:pci_set_dma_mask
   Cyclomatic Complexity 1 include/linux/pci-dma-compat.h:pci_set_consistent_dma_mask
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_reg_set_bits
   Cyclomatic Complexity 1 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_reg_clear_bits
   Cyclomatic Complexity 4 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_get_mw_count
   Cyclomatic Complexity 4 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_get_mw_name
   Cyclomatic Complexity 1 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_db_valid_mask
   Cyclomatic Complexity 1 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_msg_count
   Cyclomatic Complexity 1 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_msg_inbits
   Cyclomatic Complexity 1 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_msg_outbits
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_pci_driver_init
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_deinit_dbgfs
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_unregister_device
   Cyclomatic Complexity 5 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_nt_read
   Cyclomatic Complexity 5 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_nt_write
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_deinit_isr
   Cyclomatic Complexity 3 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_local_link_is_up
   Cyclomatic Complexity 5 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_sw_write
   Cyclomatic Complexity 1 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_local_link_disable
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_deinit_link
   Cyclomatic Complexity 1 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_local_link_enable
   Cyclomatic Complexity 5 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_sw_read
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_read_temp
   Cyclomatic Complexity 4 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_peer_link_is_up
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_deinit_pci
   Cyclomatic Complexity 1 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_pci_remove
   Cyclomatic Complexity 6 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_check_setup
   Cyclomatic Complexity 3 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_create_dev
   Cyclomatic Complexity 3 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_init_link
   Cyclomatic Complexity 3 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_init_msg
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_temp_isr
   Cyclomatic Complexity 10 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_init_pci
   Cyclomatic Complexity 9 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_scan_ports
   Cyclomatic Complexity 10 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_scan_mws
   Cyclomatic Complexity 5 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_init_mws
   Cyclomatic Complexity 5 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_init_isr
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_msg_isr
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_db_isr
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_se_isr
   Cyclomatic Complexity 6 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_thread_isr
   Cyclomatic Complexity 3 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_register_device
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_msg_clear_mask
   Cyclomatic Complexity 5 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_msg_read
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_port_number
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_msg_clear_sts
   Cyclomatic Complexity 9 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_mw_get_align
   Cyclomatic Complexity 5 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_peer_msg_write
   Cyclomatic Complexity 3 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_link_disable
   Cyclomatic Complexity 4 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_mw_count
   Cyclomatic Complexity 8 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_peer_mw_clear_trans
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_db_read
   Cyclomatic Complexity 11 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_peer_mw_set_trans
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_peer_port_count
   Cyclomatic Complexity 3 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_peer_db_set
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_db_clear_mask
   Cyclomatic Complexity 6 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_peer_mw_get_addr
   Cyclomatic Complexity 4 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_peer_port_number
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_peer_mw_count
   Cyclomatic Complexity 3 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_peer_port_idx
   Cyclomatic Complexity 8 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_link_is_up
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_db_set_mask
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_db_read_mask
   Cyclomatic Complexity 2 drivers/ntb/hw/idt/ntb_hw_idt.c:idt_ntb_msg_read_sts
--
   In file included from drivers/nvmem/core.c:22:0:
>> include/linux/module.h:794:13: warning: 'struct tracepoint' declared inside parameter list
         struct tracepoint * const *tp);
                ^
>> include/linux/module.h:794:13: warning: its scope is only this definition or declaration, which is probably not what you want
   Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls64
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u64
   Cyclomatic Complexity 1 include/linux/list.h:__list_add_valid
   Cyclomatic Complexity 1 include/linux/list.h:__list_del_entry_valid
   Cyclomatic Complexity 2 include/linux/list.h:__list_add
   Cyclomatic Complexity 1 include/linux/list.h:list_add_tail
   Cyclomatic Complexity 1 include/linux/list.h:__list_del
   Cyclomatic Complexity 2 include/linux/list.h:__list_del_entry
   Cyclomatic Complexity 1 include/linux/list.h:list_del
   Cyclomatic Complexity 1 include/linux/err.h:ERR_PTR
   Cyclomatic Complexity 1 include/linux/err.h:PTR_ERR
   Cyclomatic Complexity 1 include/linux/err.h:IS_ERR
   Cyclomatic Complexity 1 include/linux/err.h:ERR_CAST
   Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
   Cyclomatic Complexity 1 include/linux/device.h:devres_alloc
   Cyclomatic Complexity 1 include/linux/module.h:module_is_live
   Cyclomatic Complexity 3 include/linux/module.h:try_module_get
   Cyclomatic Complexity 1 include/linux/module.h:module_put
   Cyclomatic Complexity 1 include/linux/nvmem-consumer.h:of_nvmem_cell_get
   Cyclomatic Complexity 1 include/linux/nvmem-consumer.h:of_nvmem_device_get
   Cyclomatic Complexity 1 include/linux/kasan.h:kasan_kmalloc
   Cyclomatic Complexity 28 include/linux/slab.h:kmalloc_index
   Cyclomatic Complexity 1 include/linux/slab.h:kmem_cache_alloc_trace
   Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_order_trace
   Cyclomatic Complexity 68 include/linux/slab.h:kmalloc_large
   Cyclomatic Complexity 5 include/linux/slab.h:kmalloc
   Cyclomatic Complexity 5 include/linux/slab.h:kmalloc_array
   Cyclomatic Complexity 1 include/linux/slab.h:kcalloc
   Cyclomatic Complexity 1 include/linux/slab.h:kzalloc
   Cyclomatic Complexity 2 drivers/nvmem/core.c:nvmem_reg_read
   Cyclomatic Complexity 2 drivers/nvmem/core.c:nvmem_reg_write
   Cyclomatic Complexity 1 drivers/nvmem/core.c:of_nvmem_match
   Cyclomatic Complexity 1 drivers/nvmem/core.c:devm_nvmem_match
   Cyclomatic Complexity 4 drivers/nvmem/core.c:nvmem_shift_read_buffer_in_place
   Cyclomatic Complexity 4 drivers/nvmem/core.c:__nvmem_cell_read
   Cyclomatic Complexity 3 drivers/nvmem/core.c:nvmem_device_read
   Cyclomatic Complexity 3 drivers/nvmem/core.c:nvmem_device_write
   Cyclomatic Complexity 4 drivers/nvmem/core.c:nvmem_cell_read
   Cyclomatic Complexity 5 drivers/nvmem/core.c:devm_nvmem_device_match
   Cyclomatic Complexity 5 drivers/nvmem/core.c:devm_nvmem_cell_match
   Cyclomatic Complexity 8 drivers/nvmem/core.c:bin_attr_nvmem_write
   Cyclomatic Complexity 8 drivers/nvmem/core.c:bin_attr_nvmem_read
   Cyclomatic Complexity 2 drivers/nvmem/core.c:nvmem_release
   Cyclomatic Complexity 4 drivers/nvmem/core.c:nvmem_setup_compat
   Cyclomatic Complexity 3 drivers/nvmem/core.c:nvmem_cell_info_to_nvmem_cell
   Cyclomatic Complexity 4 drivers/nvmem/core.c:nvmem_device_cell_read
   Cyclomatic Complexity 1 drivers/nvmem/core.c:nvmem_cell_add
   Cyclomatic Complexity 1 drivers/nvmem/core.c:nvmem_cell_drop
   Cyclomatic Complexity 6 drivers/nvmem/core.c:nvmem_add_cells
   Cyclomatic Complexity 20 drivers/nvmem/core.c:nvmem_register
   Cyclomatic Complexity 1 drivers/nvmem/core.c:__nvmem_device_put
   Cyclomatic Complexity 1 drivers/nvmem/core.c:nvmem_device_put
   Cyclomatic Complexity 1 drivers/nvmem/core.c:devm_nvmem_device_release
   Cyclomatic Complexity 1 drivers/nvmem/core.c:nvmem_cell_put
   Cyclomatic Complexity 1 drivers/nvmem/core.c:devm_nvmem_cell_release
   Cyclomatic Complexity 4 drivers/nvmem/core.c:nvmem_device_remove_all_cells
   Cyclomatic Complexity 3 drivers/nvmem/core.c:nvmem_unregister
   Cyclomatic Complexity 2 drivers/nvmem/core.c:devm_nvmem_release
   Cyclomatic Complexity 3 drivers/nvmem/core.c:devm_nvmem_register
   Cyclomatic Complexity 1 drivers/nvmem/core.c:devm_nvmem_unregister
   Cyclomatic Complexity 2 drivers/nvmem/core.c:devm_nvmem_device_put
   Cyclomatic Complexity 2 drivers/nvmem/core.c:devm_nvmem_cell_put
   Cyclomatic Complexity 3 drivers/nvmem/core.c:nvmem_find
   Cyclomatic Complexity 4 drivers/nvmem/core.c:nvmem_device_get
   Cyclomatic Complexity 3 drivers/nvmem/core.c:devm_nvmem_device_get
   Cyclomatic Complexity 4 drivers/nvmem/core.c:of_nvmem_find
   Cyclomatic Complexity 5 drivers/nvmem/core.c:nvmem_find_cell
   Cyclomatic Complexity 6 drivers/nvmem/core.c:__nvmem_device_get
   Cyclomatic Complexity 2 drivers/nvmem/core.c:nvmem_cell_get_from_list
   Cyclomatic Complexity 4 drivers/nvmem/core.c:nvmem_cell_get
   Cyclomatic Complexity 3 drivers/nvmem/core.c:devm_nvmem_cell_get
   Cyclomatic Complexity 4 drivers/nvmem/core.c:nvmem_cell_read_u32
   Cyclomatic Complexity 5 drivers/nvmem/core.c:nvmem_cell_prepare_write_buffer
   Cyclomatic Complexity 9 drivers/nvmem/core.c:nvmem_cell_write
   Cyclomatic Complexity 3 drivers/nvmem/core.c:nvmem_device_cell_write
   Cyclomatic Complexity 1 drivers/nvmem/core.c:nvmem_exit
   Cyclomatic Complexity 1 drivers/nvmem/core.c:nvmem_init
..

vim +/module_layout +4378 kernel/module.c

^1da177e Linus Torvalds    2005-04-16  4374  
^1da177e Linus Torvalds    2005-04-16  4375  #ifdef CONFIG_MODVERSIONS
8c8ef42a Rusty Russell     2009-03-31  4376  /* Generate the signature for all relevant module structures here.
8c8ef42a Rusty Russell     2009-03-31  4377   * If these change, we don't want to try to parse the module. */
8c8ef42a Rusty Russell     2009-03-31 @4378  void module_layout(struct module *mod,
8c8ef42a Rusty Russell     2009-03-31  4379  		   struct modversion_info *ver,
8c8ef42a Rusty Russell     2009-03-31  4380  		   struct kernel_param *kp,
8c8ef42a Rusty Russell     2009-03-31  4381  		   struct kernel_symbol *ks,
65498646 Mathieu Desnoyers 2011-01-26  4382  		   struct tracepoint * const *tp)
8c8ef42a Rusty Russell     2009-03-31  4383  {
8c8ef42a Rusty Russell     2009-03-31  4384  }
8c8ef42a Rusty Russell     2009-03-31 @4385  EXPORT_SYMBOL(module_layout);

:::::: The code at line 4378 was first introduced by commit
:::::: 8c8ef42aee8fcfb4128bb94c50d55c9f80ade525 module: include other structures in module version check

:::::: TO: Rusty Russell <rusty@rustcorp.com.au>
:::::: CC: Rusty Russell <rusty@rustcorp.com.au>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25034 bytes --]

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

* Re: [PATCH] kernel/module: silence a gcc warning
  2018-04-11 19:05 [PATCH] kernel/module: silence a gcc warning Mathieu Malaterre
  2018-04-13  1:42 ` kbuild test robot
@ 2018-04-13  3:08 ` kbuild test robot
  2018-04-16 17:11 ` Jessica Yu
  2 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2018-04-13  3:08 UTC (permalink / raw)
  To: Mathieu Malaterre; +Cc: kbuild-all, Jessica Yu, Mathieu Malaterre, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 25480 bytes --]

Hi Mathieu,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.16 next-20180412]
[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/Mathieu-Malaterre/kernel-module-silence-a-gcc-warning/20180413-044304
config: x86_64-randconfig-h0-04130701 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from drivers//of/base.c:22:0:
>> include/linux/module.h:794:13: warning: 'struct tracepoint' declared inside parameter list will not be visible outside of this definition or declaration
         struct tracepoint * const *tp);
                ^~~~~~~~~~
   Cyclomatic Complexity 1 include/linux/ctype.h:isdigit
   Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls64
   Cyclomatic Complexity 1 include/uapi/linux/swab.h:__swab32p
   Cyclomatic Complexity 1 include/uapi/linux/byteorder/little_endian.h:__be32_to_cpup
   Cyclomatic Complexity 1 include/linux/bitops.h:fls_long
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u32
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u64
   Cyclomatic Complexity 1 include/linux/log2.h:__roundup_pow_of_two
   Cyclomatic Complexity 2 include/linux/list.h:__list_add
   Cyclomatic Complexity 1 include/linux/list.h:list_add_tail
   Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
   Cyclomatic Complexity 2 include/linux/string.h:kbasename
   Cyclomatic Complexity 3 include/linux/string.h:strncpy
   Cyclomatic Complexity 1 include/linux/string.h:strnlen
   Cyclomatic Complexity 4 include/linux/string.h:strlen
   Cyclomatic Complexity 6 include/linux/string.h:strlcpy
   Cyclomatic Complexity 3 include/linux/string.h:memset
   Cyclomatic Complexity 2 include/linux/of.h:of_read_number
   Cyclomatic Complexity 1 include/linux/of.h:of_find_node_by_path
   Cyclomatic Complexity 2 include/linux/of.h:of_property_read_u32_array
   Cyclomatic Complexity 1 include/linux/of.h:of_property_read_bool
   Cyclomatic Complexity 1 include/linux/of.h:of_property_read_u32
   Cyclomatic Complexity 2 include/linux/of_device.h:of_cpu_device_node_get
   Cyclomatic Complexity 1 include/linux/kasan.h:kasan_kmalloc
   Cyclomatic Complexity 28 include/linux/slab.h:kmalloc_index
   Cyclomatic Complexity 1 include/linux/slab.h:kmem_cache_alloc_trace
   Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_order_trace
   Cyclomatic Complexity 68 include/linux/slab.h:kmalloc_large
   Cyclomatic Complexity 5 include/linux/slab.h:kmalloc
   Cyclomatic Complexity 5 include/linux/slab.h:kmalloc_array
   Cyclomatic Complexity 1 include/linux/slab.h:kcalloc
   Cyclomatic Complexity 1 drivers//of/base.c:of_alias_add
   Cyclomatic Complexity 5 drivers//of/base.c:__of_find_property
   Cyclomatic Complexity 5 drivers//of/base.c:__of_get_next_child
   Cyclomatic Complexity 14 drivers//of/base.c:__of_device_is_compatible
   Cyclomatic Complexity 6 drivers//of/base.c:__of_match_node
   Cyclomatic Complexity 4 drivers//of/base.c:of_n_addr_cells
   Cyclomatic Complexity 4 drivers//of/base.c:of_n_size_cells
   Cyclomatic Complexity 1 drivers//of/base.c:of_find_property
   Cyclomatic Complexity 5 drivers//of/base.c:__of_find_all_nodes
   Cyclomatic Complexity 71 drivers//of/base.c:of_populate_phandle_cache
   Cyclomatic Complexity 4 drivers//of/base.c:of_core_init
   Cyclomatic Complexity 1 drivers//of/base.c:of_find_all_nodes
   Cyclomatic Complexity 2 drivers//of/base.c:__of_get_property
   Cyclomatic Complexity 6 drivers//of/base.c:__of_device_is_available
   Cyclomatic Complexity 2 drivers//of/base.c:of_get_property
   Cyclomatic Complexity 1 drivers//of/base.c:arch_match_cpu_phys_id
   Cyclomatic Complexity 5 drivers//of/base.c:__of_find_n_match_cpu_property
   Cyclomatic Complexity 1 drivers//of/base.c:arch_find_n_match_cpu_physical_id
   Cyclomatic Complexity 3 drivers//of/base.c:of_cpu_node_to_id
   Cyclomatic Complexity 1 drivers//of/base.c:of_device_is_compatible
   Cyclomatic Complexity 4 drivers//of/base.c:of_device_compatible_match
   Cyclomatic Complexity 2 drivers//of/base.c:of_machine_is_compatible
   Cyclomatic Complexity 1 drivers//of/base.c:of_device_is_available
   Cyclomatic Complexity 2 drivers//of/base.c:of_device_is_big_endian
   Cyclomatic Complexity 2 drivers//of/base.c:of_get_parent
   Cyclomatic Complexity 2 drivers//of/base.c:of_get_next_parent
   Cyclomatic Complexity 1 drivers//of/base.c:of_get_next_child
   Cyclomatic Complexity 6 drivers//of/base.c:of_get_next_available_child
   Cyclomatic Complexity 4 drivers//of/base.c:of_get_child_by_name
   Cyclomatic Complexity 5 drivers//of/base.c:__of_find_node_by_path
   Cyclomatic Complexity 4 drivers//of/base.c:__of_find_node_by_full_path
   Cyclomatic Complexity 12 drivers//of/base.c:of_find_node_opts_by_path
   Cyclomatic Complexity 5 drivers//of/base.c:of_find_node_by_name
   Cyclomatic Complexity 5 drivers//of/base.c:of_find_node_by_type
   Cyclomatic Complexity 3 drivers//of/base.c:of_get_cpu_node
   Cyclomatic Complexity 4 drivers//of/base.c:of_find_compatible_node
   Cyclomatic Complexity 4 drivers//of/base.c:of_find_node_with_property
   Cyclomatic Complexity 1 drivers//of/base.c:of_match_node
   Cyclomatic Complexity 6 drivers//of/base.c:of_find_matching_node_and_match
   Cyclomatic Complexity 4 drivers//of/base.c:of_modalias_node
   Cyclomatic Complexity 9 drivers//of/base.c:of_find_node_by_phandle
   Cyclomatic Complexity 3 drivers//of/base.c:of_print_phandle_args
   Cyclomatic Complexity 2 drivers//of/base.c:of_phandle_iterator_init
   Cyclomatic Complexity 10 drivers//of/base.c:of_phandle_iterator_next
   Cyclomatic Complexity 4 drivers//of/base.c:of_phandle_iterator_args
   Cyclomatic Complexity 5 drivers//of/base.c:__of_parse_phandle_with_args
   Cyclomatic Complexity 3 drivers//of/base.c:of_parse_phandle
   Cyclomatic Complexity 2 drivers//of/base.c:of_parse_phandle_with_args
   Cyclomatic Complexity 25 drivers//of/base.c:of_parse_phandle_with_args_map
   Cyclomatic Complexity 2 drivers//of/base.c:of_parse_phandle_with_fixed_args
   Cyclomatic Complexity 4 drivers//of/base.c:of_count_phandle_with_args
   Cyclomatic Complexity 3 drivers//of/base.c:__of_add_property
   Cyclomatic Complexity 3 drivers//of/base.c:of_add_property
   Cyclomatic Complexity 4 drivers//of/base.c:__of_remove_property
   Cyclomatic Complexity 4 drivers//of/base.c:of_remove_property
   Cyclomatic Complexity 4 drivers//of/base.c:__of_update_property
   Cyclomatic Complexity 4 drivers//of/base.c:of_update_property
   Cyclomatic Complexity 15 drivers//of/base.c:of_alias_scan
   Cyclomatic Complexity 6 drivers//of/base.c:of_alias_get_id
   Cyclomatic Complexity 6 drivers//of/base.c:of_alias_get_highest_id
   Cyclomatic Complexity 4 drivers//of/base.c:of_console_check
   Cyclomatic Complexity 6 drivers//of/base.c:of_find_next_cache_node
   Cyclomatic Complexity 2 drivers//of/base.c:of_find_last_cache_level
   Cyclomatic Complexity 1 drivers//of/base.c:_GLOBAL__sub_I_00100_0_aliases_lookup
   Cyclomatic Complexity 1 drivers//of/base.c:_GLOBAL__sub_D_00100_1_aliases_lookup
--
   In file included from drivers//of/platform.c:13:0:
>> include/linux/module.h:794:13: warning: 'struct tracepoint' declared inside parameter list will not be visible outside of this definition or declaration
         struct tracepoint * const *tp);
                ^~~~~~~~~~
   Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:set_bit
   Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:clear_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:test_and_set_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:constant_test_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:variable_test_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls64
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u64
   Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
   Cyclomatic Complexity 2 include/linux/string.h:kbasename
   Cyclomatic Complexity 2 include/linux/notifier.h:notifier_from_errno
   Cyclomatic Complexity 1 include/linux/kobject.h:kobject_name
   Cyclomatic Complexity 1 include/linux/device.h:devres_alloc
   Cyclomatic Complexity 2 include/linux/device.h:dev_name
   Cyclomatic Complexity 1 include/linux/kasan.h:kasan_kmalloc
   Cyclomatic Complexity 28 include/linux/slab.h:kmalloc_index
   Cyclomatic Complexity 1 include/linux/slab.h:kmem_cache_alloc_trace
   Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_order_trace
   Cyclomatic Complexity 68 include/linux/slab.h:kmalloc_large
   Cyclomatic Complexity 5 include/linux/slab.h:kmalloc
   Cyclomatic Complexity 1 include/linux/slab.h:kzalloc
   Cyclomatic Complexity 1 include/linux/of.h:of_have_populated_dt
   Cyclomatic Complexity 2 include/linux/of.h:of_node_check_flag
   Cyclomatic Complexity 1 include/linux/of.h:of_node_test_and_set_flag
   Cyclomatic Complexity 1 include/linux/of.h:of_node_set_flag
   Cyclomatic Complexity 1 include/linux/of.h:of_node_clear_flag
   Cyclomatic Complexity 1 include/linux/of.h:of_find_node_by_path
   Cyclomatic Complexity 1 include/linux/of.h:of_find_matching_node
   Cyclomatic Complexity 1 drivers//of/platform.c:of_dev_node_match
   Cyclomatic Complexity 1 drivers//of/platform.c:of_amba_device_create
   Cyclomatic Complexity 3 drivers//of/platform.c:devm_of_platform_match
   Cyclomatic Complexity 6 drivers//of/platform.c:of_device_make_bus_id
   Cyclomatic Complexity 11 drivers//of/platform.c:of_dev_lookup
   Cyclomatic Complexity 6 drivers//of/platform.c:of_platform_device_destroy
   Cyclomatic Complexity 3 drivers//of/platform.c:of_find_device_by_node
   Cyclomatic Complexity 10 drivers//of/platform.c:of_device_alloc
   Cyclomatic Complexity 5 drivers//of/platform.c:of_platform_device_create_pdata
   Cyclomatic Complexity 10 drivers//of/platform.c:of_platform_bus_create
   Cyclomatic Complexity 1 drivers//of/platform.c:of_platform_device_create
   Cyclomatic Complexity 9 drivers//of/platform.c:of_platform_notify
   Cyclomatic Complexity 7 drivers//of/platform.c:of_platform_bus_probe
   Cyclomatic Complexity 5 drivers//of/platform.c:of_platform_populate
   Cyclomatic Complexity 1 drivers//of/platform.c:of_platform_default_populate
   Cyclomatic Complexity 4 drivers//of/platform.c:of_platform_default_populate_init
   Cyclomatic Complexity 3 drivers//of/platform.c:of_platform_depopulate
   Cyclomatic Complexity 1 drivers//of/platform.c:devm_of_platform_populate_release
   Cyclomatic Complexity 4 drivers//of/platform.c:devm_of_platform_populate
   Cyclomatic Complexity 2 drivers//of/platform.c:devm_of_platform_depopulate
   Cyclomatic Complexity 2 drivers//of/platform.c:of_platform_register_reconfig_notifier
   Cyclomatic Complexity 1 drivers//of/platform.c:_GLOBAL__sub_I_00100_0_of_default_bus_match_table
   Cyclomatic Complexity 1 drivers//of/platform.c:_GLOBAL__sub_D_00100_1_of_default_bus_match_table
--
   In file included from drivers//of/address.c:9:0:
>> include/linux/module.h:794:13: warning: 'struct tracepoint' declared inside parameter list will not be visible outside of this definition or declaration
         struct tracepoint * const *tp);
                ^~~~~~~~~~
   Cyclomatic Complexity 1 include/linux/ioport.h:resource_size
   Cyclomatic Complexity 1 include/uapi/linux/swab.h:__swab32p
   Cyclomatic Complexity 1 include/uapi/linux/byteorder/little_endian.h:__be32_to_cpup
   Cyclomatic Complexity 1 include/linux/err.h:ERR_PTR
   Cyclomatic Complexity 3 include/linux/string.h:memset
   Cyclomatic Complexity 4 include/linux/string.h:memcpy
   Cyclomatic Complexity 1 arch/x86/include/asm/io.h:ioremap
   Cyclomatic Complexity 2 include/linux/of.h:of_read_number
   Cyclomatic Complexity 1 include/linux/of.h:of_find_matching_node
   Cyclomatic Complexity 1 include/linux/of.h:of_property_read_string_index
   Cyclomatic Complexity 1 include/linux/of.h:of_property_read_bool
   Cyclomatic Complexity 1 drivers//of/address.c:of_dump_addr
   Cyclomatic Complexity 3 drivers//of/address.c:of_bus_default_map
   Cyclomatic Complexity 1 drivers//of/address.c:of_bus_default_get_flags
   Cyclomatic Complexity 3 drivers//of/address.c:of_bus_pci_count_cells
   Cyclomatic Complexity 4 drivers//of/address.c:of_bus_pci_get_flags
   Cyclomatic Complexity 4 drivers//of/address.c:of_bus_pci_map
   Cyclomatic Complexity 3 drivers//of/address.c:of_bus_isa_count_cells
   Cyclomatic Complexity 4 drivers//of/address.c:of_bus_isa_map
   Cyclomatic Complexity 2 drivers//of/address.c:of_bus_isa_get_flags
   Cyclomatic Complexity 1 drivers//of/address.c:of_empty_ranges_quirk
   Cyclomatic Complexity 1 drivers//of/address.c:of_bus_isa_match
   Cyclomatic Complexity 5 drivers//of/address.c:of_bus_pci_match
   Cyclomatic Complexity 8 drivers//of/address.c:of_translate_one
   Cyclomatic Complexity 2 drivers//of/address.c:of_bus_default_translate
   Cyclomatic Complexity 1 drivers//of/address.c:of_bus_isa_translate
   Cyclomatic Complexity 1 drivers//of/address.c:of_bus_pci_translate
   Cyclomatic Complexity 3 drivers//of/address.c:of_match_bus
   Cyclomatic Complexity 2 drivers//of/address.c:parser_init
   Cyclomatic Complexity 3 drivers//of/address.c:of_bus_default_count_cells
   Cyclomatic Complexity 10 drivers//of/address.c:__of_translate_address
   Cyclomatic Complexity 3 drivers//of/address.c:of_translate_ioport
   Cyclomatic Complexity 9 drivers//of/address.c:of_get_pci_address
   Cyclomatic Complexity 1 drivers//of/address.c:of_pci_range_parser_init
   Cyclomatic Complexity 1 drivers//of/address.c:of_pci_dma_range_parser_init
   Cyclomatic Complexity 4 drivers//of/address.c:of_pci_range_to_resource
   Cyclomatic Complexity 2 drivers//of/address.c:of_translate_address
   Cyclomatic Complexity 5 drivers//of/address.c:__of_address_to_resource
   Cyclomatic Complexity 2 drivers//of/address.c:of_pci_address_to_resource
   Cyclomatic Complexity 8 drivers//of/address.c:of_pci_range_parser_one
   Cyclomatic Complexity 2 drivers//of/address.c:of_translate_dma_address
   Cyclomatic Complexity 8 drivers//of/address.c:of_get_address
   Cyclomatic Complexity 2 drivers//of/address.c:of_address_to_resource
   Cyclomatic Complexity 4 drivers//of/address.c:of_find_matching_node_by_address
   Cyclomatic Complexity 2 drivers//of/address.c:of_iomap
   Cyclomatic Complexity 4 drivers//of/address.c:of_io_request_and_map
   Cyclomatic Complexity 8 drivers//of/address.c:of_dma_get_range
   Cyclomatic Complexity 3 drivers//of/address.c:of_dma_is_coherent
   Cyclomatic Complexity 1 drivers//of/address.c:_GLOBAL__sub_I_00100_0_of_get_pci_address
   Cyclomatic Complexity 1 drivers//of/address.c:_GLOBAL__sub_D_00100_1_of_get_pci_address
--
   In file included from drivers//of/irq.c:22:0:
>> include/linux/module.h:794:13: warning: 'struct tracepoint' declared inside parameter list will not be visible outside of this definition or declaration
         struct tracepoint * const *tp);
                ^~~~~~~~~~
   Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
   Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
   Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:set_bit
   Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:clear_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls64
   Cyclomatic Complexity 1 include/uapi/linux/swab.h:__swab32p
   Cyclomatic Complexity 1 include/uapi/linux/byteorder/little_endian.h:__be32_to_cpup
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u64
   Cyclomatic Complexity 1 include/linux/list.h:INIT_LIST_HEAD
   Cyclomatic Complexity 2 include/linux/list.h:__list_add
   Cyclomatic Complexity 1 include/linux/list.h:list_add_tail
   Cyclomatic Complexity 1 include/linux/list.h:__list_del
   Cyclomatic Complexity 2 include/linux/list.h:__list_del_entry
   Cyclomatic Complexity 1 include/linux/list.h:list_del
   Cyclomatic Complexity 1 include/linux/list.h:list_empty
   Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
   Cyclomatic Complexity 3 include/linux/string.h:memset
   Cyclomatic Complexity 1 include/linux/device.h:dev_set_msi_domain
   Cyclomatic Complexity 1 include/linux/of.h:of_node_set_flag
   Cyclomatic Complexity 1 include/linux/of.h:of_node_clear_flag
   Cyclomatic Complexity 2 include/linux/of.h:of_node_full_name
   Cyclomatic Complexity 2 include/linux/of.h:of_property_read_u32_array
   Cyclomatic Complexity 1 include/linux/of.h:of_property_read_string_index
   Cyclomatic Complexity 1 include/linux/of.h:of_property_read_bool
   Cyclomatic Complexity 1 include/linux/of.h:of_property_read_u32
   Cyclomatic Complexity 1 include/linux/kasan.h:kasan_kmalloc
   Cyclomatic Complexity 28 include/linux/slab.h:kmalloc_index
   Cyclomatic Complexity 1 include/linux/slab.h:kmem_cache_alloc_trace
   Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_order_trace
   Cyclomatic Complexity 68 include/linux/slab.h:kmalloc_large
   Cyclomatic Complexity 5 include/linux/slab.h:kmalloc
   Cyclomatic Complexity 1 include/linux/slab.h:kzalloc
   Cyclomatic Complexity 1 include/linux/irq.h:irqd_get_trigger_type
   Cyclomatic Complexity 2 include/linux/irqdomain.h:of_node_to_fwnode
   Cyclomatic Complexity 1 include/linux/irqdomain.h:irq_find_matching_fwnode
   Cyclomatic Complexity 1 include/linux/irqdomain.h:irq_find_matching_host
   Cyclomatic Complexity 1 include/linux/irqdomain.h:irq_find_host
   Cyclomatic Complexity 3 drivers//of/irq.c:__of_msi_map_rid
   Cyclomatic Complexity 5 drivers//of/irq.c:of_irq_find_parent
   Cyclomatic Complexity 29 drivers//of/irq.c:of_irq_parse_raw
   Cyclomatic Complexity 6 drivers//of/irq.c:of_irq_parse_one
   Cyclomatic Complexity 2 drivers//of/irq.c:irq_of_parse_and_map
   Cyclomatic Complexity 3 drivers//of/irq.c:of_irq_get
   Cyclomatic Complexity 4 drivers//of/irq.c:of_irq_to_resource
   Cyclomatic Complexity 3 drivers//of/irq.c:of_irq_get_byname
   Cyclomatic Complexity 2 drivers//of/irq.c:of_irq_count
   Cyclomatic Complexity 3 drivers//of/irq.c:of_irq_to_resource_table
   Cyclomatic Complexity 27 drivers//of/irq.c:of_irq_init
   Cyclomatic Complexity 1 drivers//of/irq.c:of_msi_map_rid
   Cyclomatic Complexity 1 drivers//of/irq.c:of_msi_map_get_device_domain
   Cyclomatic Complexity 7 drivers//of/irq.c:of_msi_get_domain
   Cyclomatic Complexity 1 drivers//of/irq.c:of_msi_configure
   Cyclomatic Complexity 1 drivers//of/irq.c:_GLOBAL__sub_I_00100_0_irq_of_parse_and_map
   Cyclomatic Complexity 1 drivers//of/irq.c:_GLOBAL__sub_D_00100_1_irq_of_parse_and_map
--
   In file included from drivers//of/resolver.c:12:0:
>> include/linux/module.h:794:13: warning: 'struct tracepoint' declared inside parameter list will not be visible outside of this definition or declaration
         struct tracepoint * const *tp);
                ^~~~~~~~~~
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:constant_test_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:variable_test_bit
   Cyclomatic Complexity 1 include/uapi/linux/swab.h:__swab32p
   Cyclomatic Complexity 1 include/uapi/linux/byteorder/little_endian.h:__be32_to_cpup
   Cyclomatic Complexity 1 include/linux/byteorder/generic.h:be32_add_cpu
   Cyclomatic Complexity 2 include/linux/string.h:kbasename
   Cyclomatic Complexity 1 include/linux/string.h:strnlen
   Cyclomatic Complexity 4 include/linux/string.h:strlen
   Cyclomatic Complexity 3 include/linux/string.h:kmemdup
   Cyclomatic Complexity 2 include/linux/of.h:of_node_check_flag
   Cyclomatic Complexity 1 include/linux/of.h:of_find_node_by_path
   Cyclomatic Complexity 1 drivers//of/resolver.c:node_name_cmp
   Cyclomatic Complexity 4 drivers//of/resolver.c:live_tree_max_phandle
   Cyclomatic Complexity 8 drivers//of/resolver.c:adjust_overlay_phandles
   Cyclomatic Complexity 18 drivers//of/resolver.c:adjust_local_phandle_references
   Cyclomatic Complexity 10 drivers//of/resolver.c:update_usages_of_a_phandle_reference
   Cyclomatic Complexity 16 drivers//of/resolver.c:of_resolve_phandles
   Cyclomatic Complexity 1 drivers//of/resolver.c:_GLOBAL__sub_I_00100_0_of_resolve_phandles
   Cyclomatic Complexity 1 drivers//of/resolver.c:_GLOBAL__sub_D_00100_1_of_resolve_phandles
--
   In file included from drivers//of/overlay.c:12:0:
>> include/linux/module.h:794:13: warning: 'struct tracepoint' declared inside parameter list will not be visible outside of this definition or declaration
         struct tracepoint * const *tp);
                ^~~~~~~~~~
   Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
   Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:set_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:constant_test_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:variable_test_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls64
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u64
   Cyclomatic Complexity 1 include/linux/list.h:INIT_LIST_HEAD
   Cyclomatic Complexity 2 include/linux/list.h:__list_add
   Cyclomatic Complexity 1 include/linux/list.h:list_add_tail
   Cyclomatic Complexity 1 include/linux/list.h:__list_del
   Cyclomatic Complexity 2 include/linux/list.h:__list_del_entry
   Cyclomatic Complexity 1 include/linux/list.h:list_del
   Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
   Cyclomatic Complexity 2 include/linux/string.h:kbasename
   Cyclomatic Complexity 1 include/linux/string.h:strnlen
   Cyclomatic Complexity 4 include/linux/string.h:strlen
   Cyclomatic Complexity 4 include/linux/string.h:memcpy
   Cyclomatic Complexity 3 include/linux/string.h:kmemdup
   Cyclomatic Complexity 2 include/linux/string.h:strcpy
   Cyclomatic Complexity 2 include/linux/notifier.h:notifier_to_errno
   Cyclomatic Complexity 3 include/linux/of.h:of_node_is_root
   Cyclomatic Complexity 2 include/linux/of.h:of_node_check_flag
   Cyclomatic Complexity 1 include/linux/of.h:of_property_set_flag
   Cyclomatic Complexity 1 include/linux/of.h:of_find_node_by_path
   Cyclomatic Complexity 2 include/linux/of.h:of_property_read_u32_array
   Cyclomatic Complexity 1 include/linux/of.h:of_property_read_u32
   Cyclomatic Complexity 1 include/linux/of.h:of_changeset_attach_node
   Cyclomatic Complexity 1 include/linux/of.h:of_changeset_add_property
   Cyclomatic Complexity 1 include/linux/of.h:of_changeset_update_property
   Cyclomatic Complexity 1 include/linux/kasan.h:kasan_kmalloc
   Cyclomatic Complexity 28 include/linux/slab.h:kmalloc_index
   Cyclomatic Complexity 1 include/linux/slab.h:kmem_cache_alloc_trace
   Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_order_trace
   Cyclomatic Complexity 68 include/linux/slab.h:kmalloc_large
   Cyclomatic Complexity 5 include/linux/slab.h:kmalloc
   Cyclomatic Complexity 5 include/linux/slab.h:kmalloc_array
   Cyclomatic Complexity 1 include/linux/slab.h:kcalloc
   Cyclomatic Complexity 1 include/linux/slab.h:kzalloc
   Cyclomatic Complexity 1 drivers//of/overlay.c:devicetree_corrupt
   Cyclomatic Complexity 4 drivers//of/overlay.c:find_node
   Cyclomatic Complexity 5 drivers//of/overlay.c:find_target_node
   Cyclomatic Complexity 15 drivers//of/overlay.c:init_overlay_changeset
   Cyclomatic Complexity 12 drivers//of/overlay.c:dup_and_fixup_symbol_prop
   Cyclomatic Complexity 9 drivers//of/overlay.c:add_changeset_property
   Cyclomatic Complexity 3 drivers//of/overlay.c:build_changeset_symbols_node
   Cyclomatic Complexity 8 drivers//of/overlay.c:add_changeset_node
   Cyclomatic Complexity 5 drivers//of/overlay.c:build_changeset_next_level
   Cyclomatic Complexity 6 drivers//of/overlay.c:build_changeset
   Cyclomatic Complexity 4 drivers//of/overlay.c:overlay_notify
   Cyclomatic Complexity 4 drivers//of/overlay.c:free_overlay_changeset
   Cyclomatic Complexity 10 drivers//of/overlay.c:node_overlaps_later_cs
   Cyclomatic Complexity 5 drivers//of/overlay.c:overlay_removal_is_ok
   Cyclomatic Complexity 1 drivers//of/overlay.c:of_overlay_mutex_lock
   Cyclomatic Complexity 1 drivers//of/overlay.c:of_overlay_mutex_unlock
   Cyclomatic Complexity 12 drivers//of/overlay.c:of_overlay_apply
   Cyclomatic Complexity 1 drivers//of/overlay.c:of_overlay_notifier_register
   Cyclomatic Complexity 1 drivers//of/overlay.c:of_overlay_notifier_unregister
   Cyclomatic Complexity 7 drivers//of/overlay.c:of_overlay_fdt_apply
   Cyclomatic Complexity 10 drivers//of/overlay.c:of_overlay_remove
   Cyclomatic Complexity 6 drivers//of/overlay.c:of_overlay_remove_all
   Cyclomatic Complexity 1 drivers//of/overlay.c:_GLOBAL__sub_I_00100_0_of_overlay_mutex_lock
   Cyclomatic Complexity 1 drivers//of/overlay.c:_GLOBAL__sub_D_00100_1_of_overlay_mutex_lock
..

vim +794 include/linux/module.h

   788	
   789	#ifdef CONFIG_MODVERSIONS
   790	void module_layout(struct module *mod,
   791			   struct modversion_info *ver,
   792			   struct kernel_param *kp,
   793			   struct kernel_symbol *ks,
 > 794			   struct tracepoint * const *tp);
   795	#endif /* CONFIG_MODVERSIONS */
   796	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 24113 bytes --]

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

* Re: [PATCH] kernel/module: silence a gcc warning
  2018-04-11 19:05 [PATCH] kernel/module: silence a gcc warning Mathieu Malaterre
  2018-04-13  1:42 ` kbuild test robot
  2018-04-13  3:08 ` kbuild test robot
@ 2018-04-16 17:11 ` Jessica Yu
  2018-04-19 17:15   ` Mathieu Malaterre
  2 siblings, 1 reply; 6+ messages in thread
From: Jessica Yu @ 2018-04-16 17:11 UTC (permalink / raw)
  To: Mathieu Malaterre; +Cc: linux-kernel

+++ Mathieu Malaterre [11/04/18 21:05 +0200]:
>In commit 8c8ef42aee8f ("module: include other structures in module version
>check"), the function `struct_module` was renamed to `module_layout` but no
>prototype was added to `include/linux/module.h`. Remove warning triggered
>at W=1:
>
>  kernel/module.c:4378:6: warning: no previous prototype for ‘module_layout’ [-Wmissing-prototypes]
>
>Signed-off-by: Mathieu Malaterre <malat@debian.org>
>---
> include/linux/module.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
>diff --git a/include/linux/module.h b/include/linux/module.h
>index d44df9b2c131..28046e8b7e9d 100644
>--- a/include/linux/module.h
>+++ b/include/linux/module.h
>@@ -786,6 +786,14 @@ extern int module_sysfs_initialized;
>
> #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)
>
>+#ifdef CONFIG_MODVERSIONS
>+void module_layout(struct module *mod,
>+		   struct modversion_info *ver,
>+		   struct kernel_param *kp,
>+		   struct kernel_symbol *ks,
>+		   struct tracepoint * const *tp);
>+#endif /* CONFIG_MODVERSIONS */
>+

Hi Mathieu,

We're going to need a forward declaration in module.h for struct tracepoint
to address the kbuild warnings.

Thanks,

Jessica

> /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */
>
> #define __MODULE_STRING(x) __stringify(x)
>-- 
>2.11.0
>

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

* Re: [PATCH] kernel/module: silence a gcc warning
  2018-04-16 17:11 ` Jessica Yu
@ 2018-04-19 17:15   ` Mathieu Malaterre
  2018-04-23 18:41     ` Mathieu Malaterre
  0 siblings, 1 reply; 6+ messages in thread
From: Mathieu Malaterre @ 2018-04-19 17:15 UTC (permalink / raw)
  To: Jessica Yu; +Cc: LKML

Hi Jessica,

On Mon, Apr 16, 2018 at 7:11 PM, Jessica Yu <jeyu@kernel.org> wrote:
> +++ Mathieu Malaterre [11/04/18 21:05 +0200]:
>>
>> In commit 8c8ef42aee8f ("module: include other structures in module
>> version
>> check"), the function `struct_module` was renamed to `module_layout` but
>> no
>> prototype was added to `include/linux/module.h`. Remove warning triggered
>> at W=1:
>>
>>  kernel/module.c:4378:6: warning: no previous prototype for
>> ‘module_layout’ [-Wmissing-prototypes]
>>
>> Signed-off-by: Mathieu Malaterre <malat@debian.org>
>> ---
>> include/linux/module.h | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/include/linux/module.h b/include/linux/module.h
>> index d44df9b2c131..28046e8b7e9d 100644
>> --- a/include/linux/module.h
>> +++ b/include/linux/module.h
>> @@ -786,6 +786,14 @@ extern int module_sysfs_initialized;
>>
>> #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:"
>> #x)
>>
>> +#ifdef CONFIG_MODVERSIONS
>> +void module_layout(struct module *mod,
>> +                  struct modversion_info *ver,
>> +                  struct kernel_param *kp,
>> +                  struct kernel_symbol *ks,
>> +                  struct tracepoint * const *tp);
>> +#endif /* CONFIG_MODVERSIONS */
>> +
>
>
> Hi Mathieu,
>
> We're going to need a forward declaration in module.h for struct tracepoint
> to address the kbuild warnings.

Well that what I also thought at first. But since line 433 already does:

struct tracepoint * const *tracepoints_ptrs;

I suspect I should instead add sentinels: #ifdef CONFIG_TRACEPOINTS/#endif

Will try out shortly.

> Thanks,
>
> Jessica
>
>
>> /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */
>>
>> #define __MODULE_STRING(x) __stringify(x)
>> --
>> 2.11.0
>>
>

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

* Re: [PATCH] kernel/module: silence a gcc warning
  2018-04-19 17:15   ` Mathieu Malaterre
@ 2018-04-23 18:41     ` Mathieu Malaterre
  0 siblings, 0 replies; 6+ messages in thread
From: Mathieu Malaterre @ 2018-04-23 18:41 UTC (permalink / raw)
  To: Jessica Yu; +Cc: LKML

On Thu, Apr 19, 2018 at 7:15 PM, Mathieu Malaterre <malat@debian.org> wrote:
> Hi Jessica,
>
> On Mon, Apr 16, 2018 at 7:11 PM, Jessica Yu <jeyu@kernel.org> wrote:
>> +++ Mathieu Malaterre [11/04/18 21:05 +0200]:
>>>
>>> In commit 8c8ef42aee8f ("module: include other structures in module
>>> version
>>> check"), the function `struct_module` was renamed to `module_layout` but
>>> no
>>> prototype was added to `include/linux/module.h`. Remove warning triggered
>>> at W=1:
>>>
>>>  kernel/module.c:4378:6: warning: no previous prototype for
>>> ‘module_layout’ [-Wmissing-prototypes]
>>>
>>> Signed-off-by: Mathieu Malaterre <malat@debian.org>
>>> ---
>>> include/linux/module.h | 8 ++++++++
>>> 1 file changed, 8 insertions(+)
>>>
>>> diff --git a/include/linux/module.h b/include/linux/module.h
>>> index d44df9b2c131..28046e8b7e9d 100644
>>> --- a/include/linux/module.h
>>> +++ b/include/linux/module.h
>>> @@ -786,6 +786,14 @@ extern int module_sysfs_initialized;
>>>
>>> #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:"
>>> #x)
>>>
>>> +#ifdef CONFIG_MODVERSIONS
>>> +void module_layout(struct module *mod,
>>> +                  struct modversion_info *ver,
>>> +                  struct kernel_param *kp,
>>> +                  struct kernel_symbol *ks,
>>> +                  struct tracepoint * const *tp);
>>> +#endif /* CONFIG_MODVERSIONS */
>>> +
>>
>>
>> Hi Mathieu,
>>
>> We're going to need a forward declaration in module.h for struct tracepoint
>> to address the kbuild warnings.
>
> Well that what I also thought at first. But since line 433 already does:
>
> struct tracepoint * const *tracepoints_ptrs;
>
> I suspect I should instead add sentinels: #ifdef CONFIG_TRACEPOINTS/#endif

No that's missing totally the point.

> Will try out shortly.

Please drop the patch, fix is uglier than leaving the warning.

>> Thanks,
>>
>> Jessica
>>
>>
>>> /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */
>>>
>>> #define __MODULE_STRING(x) __stringify(x)
>>> --
>>> 2.11.0
>>>
>>

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

end of thread, other threads:[~2018-04-23 18:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-11 19:05 [PATCH] kernel/module: silence a gcc warning Mathieu Malaterre
2018-04-13  1:42 ` kbuild test robot
2018-04-13  3:08 ` kbuild test robot
2018-04-16 17:11 ` Jessica Yu
2018-04-19 17:15   ` Mathieu Malaterre
2018-04-23 18:41     ` Mathieu Malaterre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).