linux/include/trace/events
Geert Uytterhoeven e0914e5a05 neighbor: tracing: Move pin6 inside CONFIG_IPV6=y section
commit 2915240edd upstream.

When CONFIG_IPV6=n, and building with W=1:

    In file included from include/trace/define_trace.h:102,
		     from include/trace/events/neigh.h:255,
		     from net/core/net-traces.c:51:
    include/trace/events/neigh.h: In function ‘trace_event_raw_event_neigh_create’:
    include/trace/events/neigh.h:42:34: error: variable ‘pin6’ set but not used [-Werror=unused-but-set-variable]
       42 |                 struct in6_addr *pin6;
	  |                                  ^~~~
    include/trace/trace_events.h:402:11: note: in definition of macro ‘DECLARE_EVENT_CLASS’
      402 |         { assign; }                                                     \
	  |           ^~~~~~
    include/trace/trace_events.h:44:30: note: in expansion of macro ‘PARAMS’
       44 |                              PARAMS(assign),                   \
	  |                              ^~~~~~
    include/trace/events/neigh.h:23:1: note: in expansion of macro ‘TRACE_EVENT’
       23 | TRACE_EVENT(neigh_create,
	  | ^~~~~~~~~~~
    include/trace/events/neigh.h:41:9: note: in expansion of macro ‘TP_fast_assign’
       41 |         TP_fast_assign(
	  |         ^~~~~~~~~~~~~~
    In file included from include/trace/define_trace.h:103,
		     from include/trace/events/neigh.h:255,
		     from net/core/net-traces.c:51:
    include/trace/events/neigh.h: In function ‘perf_trace_neigh_create’:
    include/trace/events/neigh.h:42:34: error: variable ‘pin6’ set but not used [-Werror=unused-but-set-variable]
       42 |                 struct in6_addr *pin6;
	  |                                  ^~~~
    include/trace/perf.h:51:11: note: in definition of macro ‘DECLARE_EVENT_CLASS’
       51 |         { assign; }                                                     \
	  |           ^~~~~~
    include/trace/trace_events.h:44:30: note: in expansion of macro ‘PARAMS’
       44 |                              PARAMS(assign),                   \
	  |                              ^~~~~~
    include/trace/events/neigh.h:23:1: note: in expansion of macro ‘TRACE_EVENT’
       23 | TRACE_EVENT(neigh_create,
	  | ^~~~~~~~~~~
    include/trace/events/neigh.h:41:9: note: in expansion of macro ‘TP_fast_assign’
       41 |         TP_fast_assign(
	  |         ^~~~~~~~~~~~~~

Indeed, the variable pin6 is declared and initialized unconditionally,
while it is only used and needlessly re-initialized when support for
IPv6 is enabled.

Fix this by dropping the unused variable initialization, and moving the
variable declaration inside the existing section protected by a check
for CONFIG_IPV6.

Fixes: fc651001d2 ("neighbor: Add tracepoint to __neigh_create")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Simon Horman <horms@kernel.org> # build-tested
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-25 12:03:07 +02:00
..
9p.h
afs.h afs: Fix access after dec in put functions 2022-08-02 18:21:29 +01:00
alarmtimer.h
asoc.h
avc.h
bcache.h
block.h
bpf_test_run.h
bridge.h
btrfs.h btrfs: fix trace event name typo for FLUSH_DELAYED_REFS 2023-01-24 07:24:30 +01:00
cachefiles.h
cgroup.h
clk.h
cma.h
compaction.h
context_tracking.h
cpuhp.h
damon.h
devfreq.h
devlink.h devlink: Fix TP_STRUCT_entry in trace of devlink health report 2023-03-10 09:33:54 +01:00
dlm.h fd: dlm: trace send/recv of dlm message and rcom 2023-03-17 08:50:18 +01:00
dma_fence.h
erofs.h erofs: simplify iloc() 2023-07-19 16:20:59 +02:00
error_report.h
ext4.h ext4: disable fast-commit of encrypted dir operations 2023-01-07 11:12:00 +01:00
f2fs.h f2fs: refactor extent_cache to support for read and more 2023-05-17 11:53:52 +02:00
fib.h ipv6: Remove in6addr_any alternatives. 2023-09-19 12:28:10 +02:00
fib6.h ipv6: Remove in6addr_any alternatives. 2023-09-19 12:28:10 +02:00
filelock.h
filemap.h
fs_dax.h
fs.h
fscache.h fscache: Fix oops due to race with cookie_lru and use_cookie 2022-12-07 11:49:18 -08:00
fsi_master_aspeed.h
fsi_master_ast_cf.h
fsi_master_gpio.h
fsi.h
gpio.h
gpu_mem.h
habanalabs.h habanalabs: trace DMA allocations 2022-09-18 13:29:53 +03:00
host1x.h
huge_memory.h mm/khugepaged: refactor mm_khugepaged_scan_file tracepoint to remove filename from function call 2022-11-22 18:50:41 -08:00
hwmon.h
i2c_slave.h
i2c.h
ib_mad.h IB/mad: Don't call to function that might sleep while in atomic context 2022-12-31 13:32:32 +01:00
ib_umad.h
initcall.h
intel_ifs.h
intel_ish.h
intel-sst.h
io_uring.h io_uring: trace local task work run 2022-09-21 10:30:42 -06:00
iocost.h
iommu.h
ipi.h
irq_matrix.h
irq.h
iscsi.h
jbd2.h jbd2: remove journal_clean_one_cp_list() 2023-08-30 16:10:58 +02:00
kmem.h mm/slab_common: drop kmem_alloc & avoid dereferencing fields when not using 2022-09-01 11:44:26 +02:00
kvm.h KVM: x86/mmu: rename trace function name for asynchronous page fault 2022-08-10 15:08:26 -04:00
kyber.h
libata.h
lock.h
maple_tree.h Maple Tree: add new data structure 2022-09-26 19:46:13 -07:00
mce.h
mctp.h
mdio.h
migrate.h
mlxsw.h
mmap_lock.h
mmap.h mm: start tracking VMAs with maple tree 2022-09-26 19:46:14 -07:00
mmc.h
mmflags.h
module.h
mptcp.h
napi.h
nbd.h
neigh.h neighbor: tracing: Move pin6 inside CONFIG_IPV6=y section 2023-10-25 12:03:07 +02:00
net_probe_common.h
net.h net: fix net_dev_start_xmit trace event vs skb_transport_offset() 2023-07-19 16:22:05 +02:00
netfs.h
netlink.h
nfs.h
nilfs2.h
nmi.h
objagg.h
oom.h
osnoise.h
page_isolation.h
page_pool.h
page_ref.h
pagemap.h
percpu.h
power_cpu_migrate.h
power.h cpuidle: Add cpu_idle_miss trace event 2022-08-03 17:50:58 +02:00
preemptirq.h
printk.h
pwc.h
pwm.h
qdisc.h
qla.h
qrtr.h net: qrtr: correct types of trace event parameters 2023-05-11 23:03:20 +09:00
rcu.h rcu: Fix rcu_torture_read ftrace event 2023-04-06 12:10:55 +02:00
rdma_core.h
rdma.h
regulator.h
rpcgss.h
rpcrdma.h
rpm.h
rseq.h
rtc.h
rv.h rv/monitor: Add the wwnr monitor 2022-07-30 14:01:30 -04:00
rwmmio.h
rxrpc.h
sched.h
scmi.h firmware: arm_scmi: Harmonize SCMI tracing message format 2022-08-23 12:21:37 +01:00
scsi.h
sctp.h
signal.h
siox.h
skb.h net: skb: export skb drop reaons to user by TRACE_DEFINE_ENUM 2022-09-07 15:28:08 +01:00
smbus.h
sock.h
sof_intel.h ASoC: SOF: Intel: replace dev_vdbg with tracepoints 2022-09-19 15:44:06 +01:00
sof.h ASoC: SOF: replace ipc4-loader dev_vdbg with tracepoints 2022-09-19 15:44:08 +01:00
spi.h
spmi.h
sunrpc_base.h
sunrpc.h NFS client updates for Linux 5.20 2022-08-10 14:04:32 -07:00
sunvnet.h
swiotlb.h
syscalls.h
target.h
task.h
tcp.h tcp: add missing family to tcp_set_ca_state() tracepoint 2023-08-16 18:27:27 +02:00
tegra_apb_dma.h
thermal_power_allocator.h
thermal_pressure.h
thermal.h
thp.h
timer.h tracing/timer: Add missing hrtimer modes to decode_hrtimer_mode(). 2023-07-19 16:20:59 +02:00
tlb.h
udp.h
ufs.h
v4l2.h
vb2.h
vmscan.h
vsock_virtio_transport_common.h
watchdog.h watchdog: Add tracing events for the most usual watchdog events 2022-10-12 09:47:02 +02:00
wbt.h
workqueue.h
writeback.h writeback: fix dereferencing NULL mapping->host on writeback_page_template 2023-06-28 11:12:22 +02:00
xdp.h
xen.h