Skip to contentSkip to conversation

lib/percpu-refcount.c:57: warning: value computed is not used

PATCH New Fengguang Wu 1 participant 1 message Jan 8, 2013 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 50ea52f0.69PJ2c5Grhsxkqtb%[email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

PATCH 212/227 lib/percpu-refcount.c:57: warning: value computed is not used

[CC avr32 maintainers]

Quoted 20 lines · Andrew Morton
Quoted 7 lines · On Mon, 07 Jan 2013 12:45:36 +0800 kbuild test robot <[email protected]>…
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm
head:   e862d51dae9808e394a118ca1692f09bf0751aba
commit: 6311ac08e93b12f1367da092b413dd2434be45f5 [212/227] generic dynamic per cpu refcounting
config: make ARCH=avr32 atngw100_defconfig

All warnings:

Quoted 9 lines

lib/percpu-refcount.c: In function 'percpu_ref_init':
lib/percpu-refcount.c:22: error: 'jiffies' undeclared (first use in this function) lib/percpu-refcount.c:22: error: (Each undeclared identifier is reported only once lib/percpu-refcount.c:22: error: for each function it appears in.) lib/percpu-refcount.c: In function 'percpu_ref_alloc':
lib/percpu-refcount.c:36: error: 'jiffies' undeclared (first use in this function) lib/percpu-refcount.c:41: error: 'HZ' undeclared (first use in this function) lib/percpu-refcount.c:57: warning: value computed is not used

Quoted 3 lines

Confused.
http://ozlabs.org/~akpm/mmotm/broken-out/generic-dynamic-per-cpu-refcounting-fix.patch
added the jiffies.h include.

Oh that patch's linux-next commit is 18bc58821de88e5621cfdaac78c814ea479accab and goes _after_ the current commit 6311ac08e93b12f1367da092b413dd2434be45f5.

So linux-next HEAD no longer has the build errors, however I still got these warnings:

CC lib/percpu-refcount.o
In file included from /c/wfg/linux/include/uapi/linux/param.h:4,
from /c/wfg/linux/include/linux/timex.h:63, from /c/wfg/linux/include/linux/jiffies.h:8, from /c/wfg/linux/lib/percpu-refcount.c:4:
==> /c/wfg/linux/arch/avr32/include/asm/param.h:6:1: warning: "HZ" redefined

That's a trivial avr32 problem.

In file included from /c/wfg/linux/arch/avr32/include/asm/param.h:4,
from /c/wfg/linux/include/uapi/linux/param.h:4,
from /c/wfg/linux/include/linux/timex.h:63,
from /c/wfg/linux/include/linux/jiffies.h:8,
from /c/wfg/linux/lib/percpu-refcount.c:4:
/c/wfg/linux/arch/avr32/include/uapi/asm/param.h:6:1: warning: this is the location of the previous definition /c/wfg/linux/lib/percpu-refcount.c: In function 'percpu_ref_alloc':
==> /c/wfg/linux/lib/percpu-refcount.c:58: warning: value computed is not used

That's perhaps related to how cmpxchg() is expanded in avr32.

/c/wfg/linux/lib/percpu-refcount.c: In function 'percpu_ref_kill':
==> /c/wfg/linux/lib/percpu-refcount.c:114: warning: 'new' may be used uninitialized in this function

Should be a false warning. The code looks fine.

Thanks,
Fengguang