Skip to content

Fix gcc 4.6 set but unused variable warnings

Andi Kleen kvm linux-acpi linux-btrfs linux-ext4 linux-nfs linux-xfs lkml 1 version Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest23 patches 35 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/23x86: percpu: Avoid warnings of unused variables in per cpuarch/x86/include/asm/percpu.h+2 -07 replies
2/23IRQ: Move alloc_desk_mask variables inside ifdefinclude/linux/irq.h+1 -10 replies
3/23x86: Avoid unused by set variables in rdmsrarch/x86/include/asm/msr.h+2 -20 replies
4/23pagemap: Avoid unused-but-set variableinclude/linux/pagemap.h+3 -12 replies
5/23x86 boot: Set ax register in boot vga queryarch/x86/boot/video-vga.c+1 -22 replies
6/23perf: Fix set but unused variables in perfarch/x86/kernel/cpu/perf_event.c+0 -50 replies
7/23x86: fix set but not read variablesarch/x86/kernel/aperture_64.c arch/x86/kernel/cpu/mtrr/generic.c+3 -40 replies
8/23KGDB: Remove set but unused newPCarch/x86/kernel/kgdb.c+0 -31 reply
9/23PRINTK: Use stable variable to dump kmsg bufferkernel/printk.c+5 -50 replies
10/23SCHED: Only allocate per cpu cpu mask buffer with offstack cpumaskskernel/sched.c+4 -16 replies
11/23KVM: Fix KVM_SET_SIGNAL_MASKvirt/kvm/kvm_main.c+1 -11 reply
12/23BTRFS: Clean up unused variables -- bugsfs/btrfs/dir-item.c fs/btrfs/extent-tree.c fs/btrfs/extent_io.c +3 more+11 -80 replies
13/23BTRFS: Clean up unused variables -- nonbugsfs/btrfs/compression.c fs/btrfs/ctree.c fs/btrfs/disk-io.c +12 more+4 -940 replies
14/23NFSD: Fix initialized but not read warningsfs/nfsd/nfs4state.c fs/nfsd/nfsctl.c fs/nfsd/nfsproc.c +1 more+3 -141 reply
15/23EXT4: Fix initialized but not read variablesfs/ext4/balloc.c fs/ext4/extents.c fs/ext4/inode.c +5 more+10 -511 reply
16/23XFS: Fix gcc 4.6 set but not read and unused statement warningsfs/xfs/linux-2.6/xfs_sync.c fs/xfs/support/debug.h fs/xfs/xfs_alloc.c +9 more+33 -4710 replies
17/23EXT3: Fix set but unused variablesfs/ext3/namei.c fs/ext3/resize.c fs/jbd/journal.c +1 more+1 -183 replies
18/23ACPI: Fix unused but set variables in ACPIdrivers/acpi/acpica/utmutex.c drivers/acpi/numa.c drivers/acpi/osl.c +5 more+14 -290 replies
19/23KVM: Fix unused but set warningsarch/x86/kvm/paging_tmpl.h arch/x86/kvm/vmx.c virt/kvm/assigned-dev.c+2 -41 reply
20/23MM: Fix unused but set warningsarch/x86/include/asm/pgtable_64.h include/linux/highmem.h include/linux/mmdebug.h +3 more+9 -90 replies
21/23kernel/*: Fix unused but set warningskernel/debug/kdb/kdb_bp.c kernel/hrtimer.c kernel/sched_fair.c +2 more+3 -120 replies
22/23BLOCK: Fix unused but set variables in blk-mergeblock/blk-merge.c+1 -20 replies
23/23FS: Fix unused but set warningsfs/notify/inotify/inotify.c fs/splice.c include/linux/audit.h+1 -70 replies

Reviews trailers per patch

2 of 23 patches have a Reviewed-by or Acked-by.

PatchTejun HeoTheodore Ts'o
1/23A-b A-b
2/23
3/23
4/23
5/23
6/23
7/23
8/23
9/23
10/23
11/23
12/23
13/23
14/23
15/23
16/23
17/23A-b
18/23
19/23
20/23
21/23
22/23
23/23

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH] [0/23] Fix gcc 4.6 set but unused variable warnings

gcc 4.6 -Wall gained a new set but unused variable warning.

First it was incredibly noisy, but when looking at it in detail it actually found some bugs.

I haven't tried to fix all occurrences, but
at least the major ones for my configuration.

If someone is interested more work would be possible on this.

There are still some warnings left, but no flood
and there's really usually some code improvement.

In a few cases I simply shut up the compiler, but
in many other cases dead code is gone or a real
problem has been fixed.

Some of the changes need more review (especially marked and with suitable cc), but most are straight forward.

I did not fix all bugs -- those that were too hard are just commented with the warning left in. I also marked areas that need more attention in the individual patches.

Andrew, something for your tree?

-Andi