Re: [PATCH] i2c: Remove '-Wno-deprecated-declarations' compiler warning

From: kbuild test robot
Date: Sun Aug 19 2018 - 13:55:41 EST


Hi Sedat,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on wsa/i2c/for-next]
[also build test WARNING on v4.18 next-20180817]
[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/Sedat-Dilek/i2c-Remove-Wno-deprecated-declarations-compiler-warning/20180819-222255
base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: i386-randconfig-x016-201833 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All warnings (new ones prefixed by >>):

drivers//i2c/i2c-core-base.c: In function 'i2c_do_add_adapter':
drivers//i2c/i2c-core-base.c:1128:2: warning: 'attach_adapter' is deprecated [-Wdeprecated-declarations]
if (driver->attach_adapter) {
^~
In file included from drivers//i2c/i2c-core-base.c:31:0:
include/linux/i2c.h:274:8: note: declared here
int (*attach_adapter)(struct i2c_adapter *) __deprecated;
^~~~~~~~~~~~~~
drivers//i2c/i2c-core-base.c:1128:2: warning: 'attach_adapter' is deprecated [-Wdeprecated-declarations]
if (driver->attach_adapter) {
^~
In file included from drivers//i2c/i2c-core-base.c:31:0:
include/linux/i2c.h:274:8: note: declared here
int (*attach_adapter)(struct i2c_adapter *) __deprecated;
^~~~~~~~~~~~~~
In file included from include/linux/ioport.h:13:0,
from include/linux/acpi.h:25,
from drivers//i2c/i2c-core-base.c:24:
>> include/linux/compiler.h:61:17: warning: 'attach_adapter' is deprecated [-Wdeprecated-declarations]
static struct ftrace_branch_data \
^
include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
>> drivers//i2c/i2c-core-base.c:1128:2: note: in expansion of macro 'if'
if (driver->attach_adapter) {
^~
In file included from drivers//i2c/i2c-core-base.c:31:0:
include/linux/i2c.h:274:8: note: declared here
int (*attach_adapter)(struct i2c_adapter *) __deprecated;
^~~~~~~~~~~~~~
drivers//i2c/i2c-core-base.c:1134:3: warning: 'attach_adapter' is deprecated [-Wdeprecated-declarations]
driver->attach_adapter(adap);
^~~~~~
In file included from drivers//i2c/i2c-core-base.c:31:0:
include/linux/i2c.h:274:8: note: declared here
int (*attach_adapter)(struct i2c_adapter *) __deprecated;
^~~~~~~~~~~~~~
Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_read
Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_write
Cyclomatic Complexity 1 include/linux/ioport.h:resource_type
Cyclomatic Complexity 3 arch/x86/include/asm/bitops.h:clear_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:variable_test_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls
Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u32
Cyclomatic Complexity 1 include/linux/list.h:INIT_LIST_HEAD
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/list.h:hlist_empty
Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
Cyclomatic Complexity 1 include/linux/cpumask.h:cpumask_check
Cyclomatic Complexity 1 include/linux/cpumask.h:cpumask_test_cpu
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_read
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_inc
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_dec
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_read
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_inc
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_dec
Cyclomatic Complexity 1 include/linux/jump_label.h:static_key_count
Cyclomatic Complexity 2 include/linux/jump_label.h:static_key_false
Cyclomatic Complexity 1 arch/x86/include/asm/paravirt.h:arch_local_save_flags
Cyclomatic Complexity 1 arch/x86/include/asm/irqflags.h:arch_irqs_disabled_flags
Cyclomatic Complexity 1 arch/x86/include/asm/preempt.h:preempt_count
Cyclomatic Complexity 7 arch/x86/include/asm/preempt.h:__preempt_count_add
Cyclomatic Complexity 7 arch/x86/include/asm/preempt.h:__preempt_count_sub
Cyclomatic Complexity 1 include/linux/rcupdate.h:rcu_read_lock_sched_notrace
Cyclomatic Complexity 1 include/linux/rcupdate.h:rcu_read_unlock_sched_notrace
Cyclomatic Complexity 56 include/linux/slab.h:kmalloc_index
Cyclomatic Complexity 67 include/linux/slab.h:kmalloc_large
Cyclomatic Complexity 9 include/linux/slab.h:kmalloc
Cyclomatic Complexity 1 include/linux/slab.h:kzalloc
Cyclomatic Complexity 1 include/linux/kobject.h:kobject_name
Cyclomatic Complexity 1 include/linux/pm_wakeup.h:device_set_wakeup_capable
Cyclomatic Complexity 1 include/linux/pm_wakeup.h:device_set_wakeup_enable
Cyclomatic Complexity 1 include/linux/pm_wakeup.h:device_init_wakeup
Cyclomatic Complexity 1 include/linux/acpi.h:acpi_device_clear_enumerated
Cyclomatic Complexity 1 include/linux/of.h:of_node_clear_flag
Cyclomatic Complexity 1 include/linux/i2c.h:i2c_lock_bus
Cyclomatic Complexity 1 include/linux/i2c.h:i2c_trylock_bus
Cyclomatic Complexity 1 include/linux/i2c.h:i2c_unlock_bus
Cyclomatic Complexity 1 include/linux/i2c.h:i2c_get_functionality
Cyclomatic Complexity 1 include/linux/i2c.h:i2c_check_functionality
Cyclomatic Complexity 1 include/linux/i2c.h:i2c_adapter_id
Cyclomatic Complexity 1 include/linux/irq.h:irqd_set_trigger_type
Cyclomatic Complexity 1 include/linux/pm_domain.h:dev_pm_domain_attach
Cyclomatic Complexity 1 include/linux/pm_domain.h:dev_pm_domain_detach
Cyclomatic Complexity 1 include/linux/pm_runtime.h:pm_runtime_enable
Cyclomatic Complexity 1 include/linux/pm_runtime.h:__pm_runtime_disable
Cyclomatic Complexity 1 include/linux/pm_runtime.h:pm_suspend_ignore_children
Cyclomatic Complexity 1 include/linux/pm_runtime.h:pm_runtime_no_callbacks
Cyclomatic Complexity 1 include/linux/pm_runtime.h:pm_runtime_disable
Cyclomatic Complexity 1 include/linux/pm_wakeirq.h:dev_pm_set_wake_irq
Cyclomatic Complexity 1 include/linux/pm_wakeirq.h:dev_pm_set_dedicated_wake_irq
Cyclomatic Complexity 1 include/linux/pm_wakeirq.h:dev_pm_clear_wake_irq
Cyclomatic Complexity 1 drivers//i2c/i2c-core.h:i2c_acpi_install_space_handler
Cyclomatic Complexity 1 drivers//i2c/i2c-core.h:i2c_acpi_remove_space_handler
Cyclomatic Complexity 1 include/linux/trace_events.h:bpf_prog_array_valid
Cyclomatic Complexity 1 include/trace/events/i2c.h:trace_event_get_offsets_i2c_write
Cyclomatic Complexity 1 include/trace/events/i2c.h:trace_event_get_offsets_i2c_read
Cyclomatic Complexity 1 include/trace/events/i2c.h:trace_event_get_offsets_i2c_reply
Cyclomatic Complexity 1 include/trace/events/i2c.h:trace_event_get_offsets_i2c_result
Cyclomatic Complexity 1 drivers//i2c/i2c-core-base.c:dummy_probe
Cyclomatic Complexity 1 drivers//i2c/i2c-core-base.c:dummy_remove
Cyclomatic Complexity 11 include/trace/events/i2c.h:trace_event_define_fields_i2c_write
Cyclomatic Complexity 11 include/trace/events/i2c.h:trace_event_define_fields_i2c_read
Cyclomatic Complexity 11 include/trace/events/i2c.h:trace_event_define_fields_i2c_reply
Cyclomatic Complexity 7 include/trace/events/i2c.h:trace_event_define_fields_i2c_result
Cyclomatic Complexity 8 drivers//i2c/i2c-core-base.c:i2c_generic_bus_free
Cyclomatic Complexity 7 drivers//i2c/i2c-core-base.c:i2c_check_addr_validity
Cyclomatic Complexity 5 drivers//i2c/i2c-core-base.c:i2c_encode_flags_to_addr
Cyclomatic Complexity 3 include/linux/device.h:dev_name
Cyclomatic Complexity 1 include/linux/acpi.h:acpi_dev_name
Cyclomatic Complexity 1 arch/x86/include/asm/stacktrace.h:caller_frame_pointer
Cyclomatic Complexity 1 include/linux/perf_event.h:perf_fetch_caller_regs
Cyclomatic Complexity 8 include/trace/events/i2c.h:perf_trace_i2c_write
Cyclomatic Complexity 8 include/trace/events/i2c.h:perf_trace_i2c_read
Cyclomatic Complexity 8 include/trace/events/i2c.h:perf_trace_i2c_reply
Cyclomatic Complexity 8 include/trace/events/i2c.h:perf_trace_i2c_result
--
drivers/i2c/i2c-core-base.c: In function 'i2c_do_add_adapter':
drivers/i2c/i2c-core-base.c:1128:2: warning: 'attach_adapter' is deprecated [-Wdeprecated-declarations]
if (driver->attach_adapter) {
^~
In file included from drivers/i2c/i2c-core-base.c:31:0:
include/linux/i2c.h:274:8: note: declared here
int (*attach_adapter)(struct i2c_adapter *) __deprecated;
^~~~~~~~~~~~~~
drivers/i2c/i2c-core-base.c:1128:2: warning: 'attach_adapter' is deprecated [-Wdeprecated-declarations]
if (driver->attach_adapter) {
^~
In file included from drivers/i2c/i2c-core-base.c:31:0:
include/linux/i2c.h:274:8: note: declared here
int (*attach_adapter)(struct i2c_adapter *) __deprecated;
^~~~~~~~~~~~~~
In file included from include/linux/ioport.h:13:0,
from include/linux/acpi.h:25,
from drivers/i2c/i2c-core-base.c:24:
>> include/linux/compiler.h:61:17: warning: 'attach_adapter' is deprecated [-Wdeprecated-declarations]
static struct ftrace_branch_data \
^
include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
^~~~~~~~~~
drivers/i2c/i2c-core-base.c:1128:2: note: in expansion of macro 'if'
if (driver->attach_adapter) {
^~
In file included from drivers/i2c/i2c-core-base.c:31:0:
include/linux/i2c.h:274:8: note: declared here
int (*attach_adapter)(struct i2c_adapter *) __deprecated;
^~~~~~~~~~~~~~
drivers/i2c/i2c-core-base.c:1134:3: warning: 'attach_adapter' is deprecated [-Wdeprecated-declarations]
driver->attach_adapter(adap);
^~~~~~
In file included from drivers/i2c/i2c-core-base.c:31:0:
include/linux/i2c.h:274:8: note: declared here
int (*attach_adapter)(struct i2c_adapter *) __deprecated;
^~~~~~~~~~~~~~
Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_read
Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_write
Cyclomatic Complexity 1 include/linux/ioport.h:resource_type
Cyclomatic Complexity 3 arch/x86/include/asm/bitops.h:clear_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:variable_test_bit
Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls
Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u32
Cyclomatic Complexity 1 include/linux/list.h:INIT_LIST_HEAD
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/list.h:hlist_empty
Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
Cyclomatic Complexity 1 include/linux/cpumask.h:cpumask_check
Cyclomatic Complexity 1 include/linux/cpumask.h:cpumask_test_cpu
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_read
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_inc
Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_dec
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_read
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_inc
Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_dec
Cyclomatic Complexity 1 include/linux/jump_label.h:static_key_count
Cyclomatic Complexity 2 include/linux/jump_label.h:static_key_false
Cyclomatic Complexity 1 arch/x86/include/asm/paravirt.h:arch_local_save_flags
Cyclomatic Complexity 1 arch/x86/include/asm/irqflags.h:arch_irqs_disabled_flags
Cyclomatic Complexity 1 arch/x86/include/asm/preempt.h:preempt_count
Cyclomatic Complexity 7 arch/x86/include/asm/preempt.h:__preempt_count_add
Cyclomatic Complexity 7 arch/x86/include/asm/preempt.h:__preempt_count_sub
Cyclomatic Complexity 1 include/linux/rcupdate.h:rcu_read_lock_sched_notrace
Cyclomatic Complexity 1 include/linux/rcupdate.h:rcu_read_unlock_sched_notrace
Cyclomatic Complexity 56 include/linux/slab.h:kmalloc_index
Cyclomatic Complexity 67 include/linux/slab.h:kmalloc_large
Cyclomatic Complexity 9 include/linux/slab.h:kmalloc
Cyclomatic Complexity 1 include/linux/slab.h:kzalloc
Cyclomatic Complexity 1 include/linux/kobject.h:kobject_name
Cyclomatic Complexity 1 include/linux/pm_wakeup.h:device_set_wakeup_capable
Cyclomatic Complexity 1 include/linux/pm_wakeup.h:device_set_wakeup_enable
Cyclomatic Complexity 1 include/linux/pm_wakeup.h:device_init_wakeup
Cyclomatic Complexity 1 include/linux/acpi.h:acpi_device_clear_enumerated
Cyclomatic Complexity 1 include/linux/of.h:of_node_clear_flag
Cyclomatic Complexity 1 include/linux/i2c.h:i2c_lock_bus
Cyclomatic Complexity 1 include/linux/i2c.h:i2c_trylock_bus
Cyclomatic Complexity 1 include/linux/i2c.h:i2c_unlock_bus
Cyclomatic Complexity 1 include/linux/i2c.h:i2c_get_functionality
Cyclomatic Complexity 1 include/linux/i2c.h:i2c_check_functionality
Cyclomatic Complexity 1 include/linux/i2c.h:i2c_adapter_id
Cyclomatic Complexity 1 include/linux/irq.h:irqd_set_trigger_type
Cyclomatic Complexity 1 include/linux/pm_domain.h:dev_pm_domain_attach
Cyclomatic Complexity 1 include/linux/pm_domain.h:dev_pm_domain_detach
Cyclomatic Complexity 1 include/linux/pm_runtime.h:pm_runtime_enable
Cyclomatic Complexity 1 include/linux/pm_runtime.h:__pm_runtime_disable
Cyclomatic Complexity 1 include/linux/pm_runtime.h:pm_suspend_ignore_children
Cyclomatic Complexity 1 include/linux/pm_runtime.h:pm_runtime_no_callbacks
Cyclomatic Complexity 1 include/linux/pm_runtime.h:pm_runtime_disable
Cyclomatic Complexity 1 include/linux/pm_wakeirq.h:dev_pm_set_wake_irq
Cyclomatic Complexity 1 include/linux/pm_wakeirq.h:dev_pm_set_dedicated_wake_irq
Cyclomatic Complexity 1 include/linux/pm_wakeirq.h:dev_pm_clear_wake_irq
Cyclomatic Complexity 1 drivers/i2c/i2c-core.h:i2c_acpi_install_space_handler
Cyclomatic Complexity 1 drivers/i2c/i2c-core.h:i2c_acpi_remove_space_handler
Cyclomatic Complexity 1 include/linux/trace_events.h:bpf_prog_array_valid
Cyclomatic Complexity 1 include/trace/events/i2c.h:trace_event_get_offsets_i2c_write
Cyclomatic Complexity 1 include/trace/events/i2c.h:trace_event_get_offsets_i2c_read
Cyclomatic Complexity 1 include/trace/events/i2c.h:trace_event_get_offsets_i2c_reply
Cyclomatic Complexity 1 include/trace/events/i2c.h:trace_event_get_offsets_i2c_result
Cyclomatic Complexity 1 drivers/i2c/i2c-core-base.c:dummy_probe
Cyclomatic Complexity 1 drivers/i2c/i2c-core-base.c:dummy_remove
Cyclomatic Complexity 11 include/trace/events/i2c.h:trace_event_define_fields_i2c_write
Cyclomatic Complexity 11 include/trace/events/i2c.h:trace_event_define_fields_i2c_read
Cyclomatic Complexity 11 include/trace/events/i2c.h:trace_event_define_fields_i2c_reply
Cyclomatic Complexity 7 include/trace/events/i2c.h:trace_event_define_fields_i2c_result
Cyclomatic Complexity 8 drivers/i2c/i2c-core-base.c:i2c_generic_bus_free
Cyclomatic Complexity 7 drivers/i2c/i2c-core-base.c:i2c_check_addr_validity
Cyclomatic Complexity 5 drivers/i2c/i2c-core-base.c:i2c_encode_flags_to_addr
Cyclomatic Complexity 3 include/linux/device.h:dev_name
Cyclomatic Complexity 1 include/linux/acpi.h:acpi_dev_name

vim +/attach_adapter +61 include/linux/compiler.h

2bcd521a Steven Rostedt 2008-11-21 50
2bcd521a Steven Rostedt 2008-11-21 51 #ifdef CONFIG_PROFILE_ALL_BRANCHES
2bcd521a Steven Rostedt 2008-11-21 52 /*
2bcd521a Steven Rostedt 2008-11-21 53 * "Define 'is'", Bill Clinton
2bcd521a Steven Rostedt 2008-11-21 54 * "Define 'if'", Steven Rostedt
2bcd521a Steven Rostedt 2008-11-21 55 */
ab3c9c68 Linus Torvalds 2009-04-07 56 #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
ab3c9c68 Linus Torvalds 2009-04-07 57 #define __trace_if(cond) \
b33c8ff4 Arnd Bergmann 2016-02-12 58 if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
2bcd521a Steven Rostedt 2008-11-21 59 ({ \
2bcd521a Steven Rostedt 2008-11-21 60 int ______r; \
2bcd521a Steven Rostedt 2008-11-21 @61 static struct ftrace_branch_data \
2bcd521a Steven Rostedt 2008-11-21 62 __attribute__((__aligned__(4))) \
2bcd521a Steven Rostedt 2008-11-21 63 __attribute__((section("_ftrace_branch"))) \
2bcd521a Steven Rostedt 2008-11-21 64 ______f = { \
2bcd521a Steven Rostedt 2008-11-21 65 .func = __func__, \
2bcd521a Steven Rostedt 2008-11-21 66 .file = __FILE__, \
2bcd521a Steven Rostedt 2008-11-21 67 .line = __LINE__, \
2bcd521a Steven Rostedt 2008-11-21 68 }; \
2bcd521a Steven Rostedt 2008-11-21 69 ______r = !!(cond); \
97e7e4f3 Witold Baryluk 2009-03-17 70 ______f.miss_hit[______r]++; \
2bcd521a Steven Rostedt 2008-11-21 71 ______r; \
2bcd521a Steven Rostedt 2008-11-21 72 }))
2bcd521a Steven Rostedt 2008-11-21 73 #endif /* CONFIG_PROFILE_ALL_BRANCHES */
2bcd521a Steven Rostedt 2008-11-21 74

:::::: The code at line 61 was first introduced by commit
:::::: 2bcd521a684cc94befbe2ce7d5b613c841b0d304 trace: profile all if conditionals

:::::: TO: Steven Rostedt <srostedt@xxxxxxxxxx>
:::::: CC: Ingo Molnar <mingo@xxxxxxx>

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

Attachment: .config.gz
Description: application/gzip