Skip to contentSkip to conversation

linux-next: arm allmodconfig

DISCUSSION Andrew Morton 8 participants 10 messages Oct 29, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw
Quoted 2 lines

arch/arm/mm/dma-mapping.c: In function `dma_sync_sg_for_cpu':
arch/arm/mm/dma-mapping.c:588: warning: statement with no effect

Something in here:

dmabounce_sync_for_cpu(dev, sg_dma_address(s), 0,
sg_dma_len(s), dir);

Quoted 8 lines

kernel/sched.c: In function `add_preempt_count':
kernel/sched.c:4294: warning: unsupported arg to __builtin_return_address' kernel/sched.c:4296: warning: unsupported arg to __builtin_return_address' kernel/sched.c:4298: warning: unsupported arg to __builtin_return_address' kernel/sched.c: In function sub_preempt_count':
kernel/sched.c:4294: warning: unsupported arg to __builtin_return_address' kernel/sched.c:4296: warning: unsupported arg to __builtin_return_address' kernel/sched.c:4298: warning: unsupported arg to `__builtin_return_address'

Related to CALLER_ADDR2, etc.

Quoted 3 lines

drivers/atm/zatm.c: In function `refill_pool':
drivers/atm/zatm.c:226: warning: `virt_to_bus' is deprecated (declared at /usr/src/devel/arch/arm/include/asm/memory.h:184)

<50ish similar warnings snipped>

Quoted 13 lines

drivers/atm/ambassador.h:257:1: warning: "FLASH_BASE" redefined
In file included from arch/arm/mach-versatile/include/mach/irqs.h:22,
from /usr/src/devel/arch/arm/include/asm/irq.h:4,
from /usr/src/devel/arch/arm/include/asm/hardirq.h:6,
from include/linux/hardirq.h:7,
from include/asm-generic/local.h:5,
from /usr/src/devel/arch/arm/include/asm/local.h:1,
from include/linux/module.h:20,
from drivers/atm/ambassador.c:25:
arch/arm/mach-versatile/include/mach/platform.h:443:1: warning: this is the location of the previous definition In file included from drivers/atm/ambassador.c:44:
drivers/atm/ambassador.h:258:1: warning: "FLASH_SIZE" redefined
In file included from arch/arm/mach-versatile/include/mach/irqs.h:22,

Quoted 8 lines

from /usr/src/devel/arch/arm/include/asm/irq.h:4,
from /usr/src/devel/arch/arm/include/asm/hardirq.h:6,
from include/linux/hardirq.h:7,
from include/asm-generic/local.h:5,
from /usr/src/devel/arch/arm/include/asm/local.h:1,
from include/linux/module.h:20,
from drivers/atm/ambassador.c:25:
arch/arm/mach-versatile/include/mach/platform.h:444:1: warning: this is the location of the previous definition

This has been there for ages. FLASH_BASE and FLASH_SIZE are silly identifier for any code to use anywhere, really.

Quoted 2 lines

drivers/atm/ambassador.c: In function `check_area':
drivers/atm/ambassador.c:425: warning: `virt_to_bus' is deprecated (declared at /usr/src/devel/arch/arm/include/asm/memory.h:184)

<zillions more of these>

Quoted 11 lines

In file included from drivers/atm/iphase.c:65:
drivers/atm/iphase.h:332:1: warning: "EPROM_SIZE" redefined
In file included from arch/arm/mach-versatile/include/mach/irqs.h:22,
from /usr/src/devel/arch/arm/include/asm/irq.h:4,
from /usr/src/devel/arch/arm/include/asm/hardirq.h:6,
from include/linux/hardirq.h:7,
from include/asm-generic/local.h:5,
from /usr/src/devel/arch/arm/include/asm/local.h:1,
from include/linux/module.h:20,
from drivers/atm/iphase.c:43:
arch/arm/mach-versatile/include/mach/platform.h:453:1: warning: this is the location of the previous definition

EPROM_SIZE namespace clash.

Quoted 2 lines

crypto/testmgr.c: In function `alg_test_comp':
crypto/testmgr.c:829: warning: 'ret' might be used uninitialized in this function

There's no way for the compiler to know that this code isn't buggy.

Suggest that this be fixed via uninitialized_var() or, better, convert to a do{}while() loop.

I notice that test_comp() also has two locals called `ret' - one shadowing the other.

Quoted 2 lines

mm/mlock.c: In function `__mlock_vma_pages_range':
mm/mlock.c:169: warning: 'ret' might be used uninitialized in this function

Again, gcc can't know this is unbuggy. a do{}while() conversion would fix it, I guess.

Quoted 11 lines

In file included from drivers/atm/eni.c:29:
drivers/atm/midway.h:19:1: warning: "EPROM_SIZE" redefined
In file included from arch/arm/mach-versatile/include/mach/irqs.h:22,
from /usr/src/devel/arch/arm/include/asm/irq.h:4,
from /usr/src/devel/arch/arm/include/asm/hardirq.h:6,
from include/linux/hardirq.h:7,
from include/asm-generic/local.h:5,
from /usr/src/devel/arch/arm/include/asm/local.h:1,
from include/linux/module.h:20,
from drivers/atm/eni.c:6:
arch/arm/mach-versatile/include/mach/platform.h:453:1: warning: this is the location of the previous definition

Zzzz..

Quoted 2 lines

drivers/atm/firestream.c: In function `submit_qentry':
drivers/atm/firestream.c:608: warning: `bus_to_virt' is deprecated (declared at /usr/src/devel/arch/arm/include/asm/memory.h:189)

zillions more snipped

Quoted 8 lines

include/asm-generic/cmpxchg-local.h:15: warning: 'prev' might be used uninitialized in this function drivers/gpu/drm/drm_lock.c: In function `drm_lock_free':
include/asm-generic/cmpxchg-local.h:15: warning: 'prev' might be used uninitialized in this function include/asm-generic/cmpxchg-local.h:15: warning: 'prev' might be used uninitialized in this function drivers/gpu/drm/drm_lock.c: In function `drm_notifier':
include/asm-generic/cmpxchg-local.h:15: warning: 'prev' might be used uninitialized in this function drivers/gpu/drm/drm_lock.c: In function `drm_idlelock_release':
include/asm-generic/cmpxchg-local.h:15: warning: 'prev' might be used uninitialized in this function

didn't look.

Quoted 5 lines

drivers/gpu/drm/drm_agpsupport.c:36:21: asm/agp.h: No such file or directory make[3]: *** [drivers/gpu/drm/drm_agpsupport.o] Error 1
make[2]: *** [drivers/gpu/drm] Error 2
make[1]: *** [drivers/gpu] Error 2
make[1]: *** Waiting for unfinished jobs....

DRM has been breaking arm allmodconfig for at least a year.

Quoted 5 lines

include/asm-generic/cmpxchg-local.h:15: warning: 'prev' might be used uninitialized in this function kernel/trace/trace_irqsoff.c: In function `start_critical_timings':
kernel/trace/trace_irqsoff.c:185: warning: unsupported arg to __builtin_return_address' kernel/trace/trace_irqsoff.c: In function stop_critical_timings':
kernel/trace/trace_irqsoff.c:222: warning: unsupported arg to `__builtin_return_address'

Quoted 8 lines

sound/soc/codecs/tlv320aic23.c: In function `tlv320aic23_set_dai_sysclk':
sound/soc/codecs/tlv320aic23.c:424: warning: unused variable codec' kernel/trace/trace_sched_wakeup.c: In function probe_wakeup_sched_switch':
kernel/trace/trace_sched_wakeup.c:163: warning: unsupported arg to __builtin_return_address' kernel/trace/trace_sched_wakeup.c:163: warning: unsupported arg to __builtin_return_address' kernel/trace/trace_sched_wakeup.c: In function `probe_wakeup':
kernel/trace/trace_sched_wakeup.c:265: warning: unsupported arg to __builtin_return_address' kernel/trace/trace_sched_wakeup.c:265: warning: unsupported arg to __builtin_return_address'

More CALLER_ADDR stuff.

Quoted 2 lines

net/netlabel/netlabel_mgmt.c: In function `netlbl_mgmt_listentry':
net/netlabel/netlabel_mgmt.c:268: warning: 'ret_val' might be used uninitialized in this function

Assumes that netlbl_af4list_foreach_rcu() will never iterate zero times.

Assumes that entry->type can never have an unexpected value.

gcc cannot get this right, and C-level changes will be needed to shut this up.

Quoted 2 lines

net/phonet/pn_dev.c: In function `phonet_device_get':
net/phonet/pn_dev.c:72: warning: 'dev' might be used uninitialized in this function

Assumes that pndevs.list can enver be empty. Only fixable at the C level. uninitialized_var(), or initialize it to NULL or whatever.

Quoted 2 lines

include/asm-generic/xor.h:696: warning: 'xor_block_8regs_p' defined but not used include/asm-generic/xor.h:704: warning: 'xor_block_32regs_p' defined but not used

Statically defined storage in a header file. Puke.

Quoted 2 lines

crypto/async_tx/async_tx.c: In function `async_trigger_callback':
crypto/async_tx/async_tx.c:584: warning: 'chan' might be used uninitialized in this function

I suppose that if gcc was genius enough they might make this go away. But I expect the code could be reorganised to fix this.

Quoted 2 lines

sound/pci/hda/patch_sigmatel.c: In function `stac92xx_smux_enum_put':
sound/pci/hda/patch_sigmatel.c:571: warning: 'val' might be used uninitialized in this function

This looks like a bug.

Quoted 2 lines

fs/ntfs/compress.c: In function `ntfs_read_compressed_block':
fs/ntfs/compress.c:521: warning: 'pages' might be used uninitialized in this function

Well that's weird.

Quoted 8 lines

include/linux/slub_def.h:231: warning: 'ret' might be used uninitialized in this function include/linux/slub_def.h:231: warning: 'ret' might be used uninitialized in this function fs/xfs/quota/xfs_qm_syscalls.c: In function `xfs_qm_dqrele_inodes_ag':
fs/xfs/quota/xfs_qm_syscalls.c:1039: warning: 'inode_refed' might be used uninitialized in this function fs/xfs/xfs_rtalloc.c: In function `xfs_growfs_rt':
fs/xfs/xfs_rtalloc.c:1875: warning: 'tp' might be used uninitialized in this function fs/udf/super.c: In function `udf_process_sequence':
fs/udf/super.c:1240: warning: 'map' might be used uninitialized in this function

I lost interest here.

Quoted 3 lines

fs/quota_v2.c: In function `v2_read_file_info':
fs/quota_v2.c:119: warning: integer constant is too large for "unsigned long" type fs/quota_v2.c:120: warning: integer constant is too large for "unsigned long" type

That's the new quota stuff. I thought I fixed that...

#1 lore raw

At Tue, 28 Oct 2008 17:56:04 -0700,

Quoted 3 lines · Andrew Morton
Quoted 3 lines

sound/soc/codecs/tlv320aic23.c: In function `tlv320aic23_set_dai_sysclk':
sound/soc/codecs/tlv320aic23.c:424: warning: unused variable `codec'

This will be either removed or used with other codes. Waiting for a patch of the original author right now.

Quoted 4 lines
Quoted 2 lines

sound/pci/hda/patch_sigmatel.c: In function `stac92xx_smux_enum_put':
sound/pci/hda/patch_sigmatel.c:571: warning: 'val' might be used uninitialized in this function

This looks like a bug.

Yep, indeed. Fixed now on sound git tree. (Wondering why this warning doesn't hit on my machine with
gcc-4.3.3...)

Thanks!

Takashi

#2 lore raw
In reply to Andrew Morton
Quoted 2 lines · Andrew Morton
Quoted 2 lines

fs/xfs/quota/xfs_qm_syscalls.c: In function `xfs_qm_dqrele_inodes_ag':
fs/xfs/quota/xfs_qm_syscalls.c:1039: warning: 'inode_refed' might be used uninitialized in this function

I haven't seen this one before. And it's a real bug, too. gcc-4.3.1 on x86_64 is not picking this warning up:

$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.1-9' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-cld --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.1 (Debian 4.3.1-9)
$
$
$ touch fs/xfs/quota/xfs_qm_syscalls.c
$ make -j2 ARCH=um
  SYMLINK arch/um/include/shared/kern_constants.h
make[1]: `arch/um/sys-x86_64/user-offsets.s' is up to date.
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHK     include/linux/compile.h
  CC      fs/xfs/quota/xfs_qm_syscalls.o
  LD      fs/xfs/xfs.o
  LD      fs/xfs/built-in.o
  LD      fs/built-in.o

What compiler version are you using?

I'll send out a patch to fix this in a minute.

Quoted 2 lines
Quoted 2 lines

fs/xfs/xfs_rtalloc.c: In function `xfs_growfs_rt':
fs/xfs/xfs_rtalloc.c:1875: warning: 'tp' might be used uninitialized in this function

False positive, and I don't get this reported, either.

Hold on - the above gcc binary only emits a warning for the xfs_growfs_rt issue when CONFIG_CC_OPTIMIZE_FOR_SIZE=y is set. It still doesn't catch the quota bug, though. This is so fucked up....

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#3 lore raw
Quoted 8 lines · Dave Chinner
Quoted 2 lines
Quoted 2 lines

fs/xfs/xfs_rtalloc.c: In function `xfs_growfs_rt':
fs/xfs/xfs_rtalloc.c:1875: warning: 'tp' might be used uninitialized in this function

False positive, and I don't get this reported, either.

Hold on - the above gcc binary only emits a warning for the xfs_growfs_rt issue when CONFIG_CC_OPTIMIZE_FOR_SIZE=y is set. It still doesn't catch the quota bug, though. This is so fucked up....

FYI, i've got 3 XFS warnings mapped in tip/auto-warnings-next:

earth4:~/tip> gll linus..auto-warnings-next | grep xfs

ec2f37c: work around warning in fs/xfs/xfs_mount.c 8501db3: work around warning in fs/xfs/xfs_rtalloc.c 8077af8: warnings: fix xfs posix acl

you can find those commits in the auto-warnings-next branch of -tip:

http://people.redhat.com/mingo/tip.git/README

the rtalloc annotation is below. I went through the flow and the code seems to be correct and GCC is wrong.

Ingo

------------->
From 8501db35588df4f35d67d8ba207422006a214ae7 Mon Sep 17 00:00:00 2001
From: Ingo Molnar <[email protected]>
Date: Mon, 18 Aug 2008 15:21:19 +0200
Subject: [PATCH] work around warning in fs/xfs/xfs_rtalloc.c
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

fix warning:

fs/xfs/xfs_rtalloc.c: In function ‘xfs_growfs_rt’:
fs/xfs/xfs_rtalloc.c:1875: warning: ‘tp’ may be used uninitialized in this function

This is a spurious gcc warning - it does not realize the correct/bug-free flow of logic regarding the 'error' and 'tp' variables.

No code changed:
7c10fd959065115c8e252ff5a861a01e xfs_rtalloc.o.before.asm 7c10fd959065115c8e252ff5a861a01e xfs_rtalloc.o.after.asm

---
 fs/xfs/xfs_rtalloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/xfs/xfs_rtalloc.c +1 -1
index e2f68de..fe5de08 100644
@@ -1872,7 +1872,7 @@ xfs_growfs_rt(
 	xfs_extlen_t	rsumblocks;	/* current number of rt summary blks */
 	xfs_sb_t	*sbp;		/* old superblock */
 	xfs_fsblock_t	sumbno;		/* summary block number */
-	xfs_trans_t	*tp;		/* transaction pointer */
+	xfs_trans_t	*uninitialized_var(tp);	/* transaction pointer */
 
 	sbp = &mp->m_sb;
 	cancelflags = 0;
#4 lore raw
Quoted 12 lines · Ingo Molnar
Quoted 8 lines · Dave Chinner
Quoted 2 lines
Quoted 2 lines

fs/xfs/xfs_rtalloc.c: In function `xfs_growfs_rt':
fs/xfs/xfs_rtalloc.c:1875: warning: 'tp' might be used uninitialized in this function

False positive, and I don't get this reported, either.

Hold on - the above gcc binary only emits a warning for the xfs_growfs_rt issue when CONFIG_CC_OPTIMIZE_FOR_SIZE=y is set. It still doesn't catch the quota bug, though. This is so fucked up....

Quoted 5 lines

FYI, i've got 3 XFS warnings mapped in tip/auto-warnings-next:

earth4:~/tip> gll linus..auto-warnings-next | grep xfs

ec2f37c: work around warning in fs/xfs/xfs_mount.c

Can't say I've ever seen that warning. What gcc version is generating it?

Quoted 1 line

8501db3: work around warning in fs/xfs/xfs_rtalloc.c

Yeah, that's bogus.

Quoted 1 line

8077af8: warnings: fix xfs posix acl

Should be fixed in the -next tree.

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#5 lore raw
In reply to Andrew Morton
Quoted 7 lines · Andrew Morton
Quoted 2 lines

arch/arm/mm/dma-mapping.c: In function `dma_sync_sg_for_cpu':
arch/arm/mm/dma-mapping.c:588: warning: statement with no effect

Something in here:

dmabounce_sync_for_cpu(dev, sg_dma_address(s), 0,
sg_dma_len(s), dir);

That's because dmabounce_sync_for_xxx() functions return whether they did anything, so in the case where the buffer isn't bounced, we fall through to the standard DMA cache maintainence methods.

When there's no dmabounce, we define these functions to (1), which of course causes the warning. I'll eventually convert them to inline functions instead.

Quoted 10 lines
Quoted 8 lines

kernel/sched.c: In function `add_preempt_count':
kernel/sched.c:4294: warning: unsupported arg to __builtin_return_address' kernel/sched.c:4296: warning: unsupported arg to __builtin_return_address' kernel/sched.c:4298: warning: unsupported arg to __builtin_return_address' kernel/sched.c: In function sub_preempt_count':
kernel/sched.c:4294: warning: unsupported arg to __builtin_return_address' kernel/sched.c:4296: warning: unsupported arg to __builtin_return_address' kernel/sched.c:4298: warning: unsupported arg to `__builtin_return_address'

Related to CALLER_ADDR2, etc.

Later ARM toolchains seem to have dropped support for non-zero arguments to __builtin_return_address() - presumably to support this new fangled EABI stuff. Not much can be done about that without screaming at the toolchain people.

Quoted 4 lines
Quoted 3 lines

drivers/atm/zatm.c: In function `refill_pool':
drivers/atm/zatm.c:226: warning: `virt_to_bus' is deprecated (declared at /usr/src/devel/arch/arm/include/asm/memory.h:184)

<50ish similar warnings snipped>

We really really want to see the end of virt_to_bus() in the kernel - since ARM is a non-cache coherent architecture, every usage of it is a bug since there'll be no cache maintainence.

So, essentially, these warnings are saying that this driver is buggy on ARM.

Quoted 4 lines
Quoted 4 lines

drivers/atm/ambassador.h:257:1: warning: "FLASH_BASE" redefined In file included from arch/arm/mach-versatile/include/mach/irqs.h:22,
from /usr/src/devel/arch/arm/include/asm/irq.h:4, from /usr/src/devel/arch/arm/include/asm/hardirq.h:6,

Quoted 8 lines
Quoted 8 lines

from include/linux/hardirq.h:7,
from include/asm-generic/local.h:5,
from /usr/src/devel/arch/arm/include/asm/local.h:1,
from include/linux/module.h:20,
from drivers/atm/ambassador.c:25:
arch/arm/mach-versatile/include/mach/platform.h:443:1: warning: this is the location of the previous definition In file included from drivers/atm/ambassador.c:44:
drivers/atm/ambassador.h:258:1: warning: "FLASH_SIZE" redefined

Here we go again...

I do wish that people wouldn't include "platform.h" headers defining lots of generically named constants into a header file used by most of the kernel build. It's stupid for several reasons:

1. see the above warnings.
2. if you change anything in that header, you're going to get a needless full kernel rebuild
3. and that causes additional strain on kautobuild's build caches

We've had this in the past with sa1100-regs.h and similar, and we solved it there.

Unfortunately, people persist in including their platform includes into lots of header files rather than having just the relevent C files include them. Eg, arch/arm/plat-omap/include/mach/hardware.h:

/*
* ---------------------------------------------------------------------------
* Board specific defines
* --------------------------------------------------------------------------- */

#ifdef CONFIG_MACH_OMAP_INNOVATOR
#include "board-innovator.h"
#endif

#ifdef CONFIG_MACH_OMAP_H2
#include "board-h2.h"
#endif
...
#ifdef CONFIG_MACH_SX1
#include "board-sx1.h"
#endif

which is included via asm/io.h, asm/irq.h, asm/pci.h, asm/vga.h.

As long as this idiocracy, we're going to see these kinds of clashes. This stuff needs to die. I've a good idea to do a sweep of all ARM includes, and commit a patch to my devel tree for linux-next to remove such includes as an encouragement to fixing this stuff properly.

People will then have a couple of months to sort out their mess.

Quoted 10 lines
Quoted 2 lines

crypto/testmgr.c: In function `alg_test_comp':
crypto/testmgr.c:829: warning: 'ret' might be used uninitialized in this function

There's no way for the compiler to know that this code isn't buggy.

Suggest that this be fixed via uninitialized_var() or, better, convert to a do{}while() loop.

I notice that test_comp() also has two locals called `ret' - one shadowing the other.

Here's a question: Why do we have to have the test manager built in if we build some crypto modules? What if you're building an embedded target and don't want to test the crypto modules on every boot? (Think code size, boot time, etc.)

Quoted 10 lines
Quoted 8 lines

include/asm-generic/cmpxchg-local.h:15: warning: 'prev' might be used uninitialized in this function drivers/gpu/drm/drm_lock.c: In function `drm_lock_free':
include/asm-generic/cmpxchg-local.h:15: warning: 'prev' might be used uninitialized in this function include/asm-generic/cmpxchg-local.h:15: warning: 'prev' might be used uninitialized in this function drivers/gpu/drm/drm_lock.c: In function `drm_notifier':
include/asm-generic/cmpxchg-local.h:15: warning: 'prev' might be used uninitialized in this function drivers/gpu/drm/drm_lock.c: In function `drm_idlelock_release':
include/asm-generic/cmpxchg-local.h:15: warning: 'prev' might be used uninitialized in this function

didn't look.

No idea.

Quoted 7 lines
Quoted 5 lines

drivers/gpu/drm/drm_agpsupport.c:36:21: asm/agp.h: No such file or directory make[3]: *** [drivers/gpu/drm/drm_agpsupport.o] Error 1
make[2]: *** [drivers/gpu/drm] Error 2
make[1]: *** [drivers/gpu] Error 2
make[1]: *** Waiting for unfinished jobs....

DRM has been breaking arm allmodconfig for at least a year.

I've no idea what asm/agp.h is supposed to have in it, no idea what DRM actually is other than "Digital Rights Management" ;)

I suspect the right answer is to make DRM depend on !ARM - I know of no ARM platform with AGP.

#6 lore raw
Quoted 1 line · Russell King - ARM Linux

On Tue, Oct 28, 2008 at 05:56:04PM -0700, Andrew Morton wrote:

<snip>

Quoted 50 lines
Quoted 13 lines
Quoted 13 lines

drivers/atm/ambassador.h:257:1: warning: "FLASH_BASE" redefined
In file included from arch/arm/mach-versatile/include/mach/irqs.h:22,
from /usr/src/devel/arch/arm/include/asm/irq.h:4,
from /usr/src/devel/arch/arm/include/asm/hardirq.h:6,
from include/linux/hardirq.h:7,
from include/asm-generic/local.h:5,
from /usr/src/devel/arch/arm/include/asm/local.h:1,
from include/linux/module.h:20,
from drivers/atm/ambassador.c:25:
arch/arm/mach-versatile/include/mach/platform.h:443:1: warning: this is the location of the previous definition In file included from drivers/atm/ambassador.c:44:
drivers/atm/ambassador.h:258:1: warning: "FLASH_SIZE" redefined

Here we go again...

I do wish that people wouldn't include "platform.h" headers defining lots of generically named constants into a header file used by most of the kernel build. It's stupid for several reasons:

1. see the above warnings.
2. if you change anything in that header, you're going to get a needless full kernel rebuild
3. and that causes additional strain on kautobuild's build caches

We've had this in the past with sa1100-regs.h and similar, and we solved it there.

Unfortunately, people persist in including their platform includes into lots of header files rather than having just the relevent C files include them. Eg, arch/arm/plat-omap/include/mach/hardware.h:

/*
* ---------------------------------------------------------------------------
* Board specific defines
* --------------------------------------------------------------------------- */

#ifdef CONFIG_MACH_OMAP_INNOVATOR
#include "board-innovator.h"
#endif

#ifdef CONFIG_MACH_OMAP_H2
#include "board-h2.h"
#endif
...
#ifdef CONFIG_MACH_SX1
#include "board-sx1.h"
#endif

Quoted 8 lines

which is included via asm/io.h, asm/irq.h, asm/pci.h, asm/vga.h.

As long as this idiocracy, we're going to see these kinds of clashes. This stuff needs to die. I've a good idea to do a sweep of all ARM includes, and commit a patch to my devel tree for linux-next to remove such includes as an encouragement to fixing this stuff properly.

People will then have a couple of months to sort out their mess.

I'll remove those omap includes, I have few other patches pending before I get to that though.

Cheers,

Tony

#7 lore raw
In reply to Andrew Morton
Quoted 4 lines · Andrew Morton
Quoted 2 lines

include/linux/slub_def.h:231: warning: 'ret' might be used uninitialized in this function include/linux/slub_def.h:231: warning: 'ret' might be used uninitialized in this function

I lost interest here.

Looks like a bogus warning to me. But we might as well clean it up a bit and maybe the compiler is less confused that way.

Pekka

Quoted 1 line

From 48724e2995a0fd292d326f79caebe61f4f115021 Mon Sep 17 00:00:00 2001

From: Pekka Enberg <[email protected]>
Date: Wed, 29 Oct 2008 12:13:37 +0200
Subject: [PATCH] slub: avoid bogus warning on arm

Move the ret variable to where we actually need it in an attempt to avoid a bugs warning when compiling for ARM.

---
 include/linux/slub_def.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
include/linux/slub_def.h +1 -2
index dc28432..4d3de0c 100644
@@ -228,14 +228,13 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags)
 
 static __always_inline void *kmalloc(size_t size, gfp_t flags)
 {
-	void *ret;
-
 	if (__builtin_constant_p(size)) {
 		if (size > PAGE_SIZE)
 			return kmalloc_large(size, flags);
 
 		if (!(flags & SLUB_DMA)) {
 			struct kmem_cache *s = kmalloc_slab(size);
+			void *ret;
 
 			if (!s)
 				return ZERO_SIZE_PTR;
Signature · 1 line
1.5.4.3
#8 lore raw
In reply to Andrew Morton
Quoted 11 lines · Andrew Morton
Quoted 3 lines

net/netlabel/netlabel_mgmt.c: In function `netlbl_mgmt_listentry':
net/netlabel/netlabel_mgmt.c:268: warning: 'ret_val' might be used uninitialized in this function

Assumes that netlbl_af4list_foreach_rcu() will never iterate zero times.

Assumes that entry->type can never have an unexpected value.

gcc cannot get this right, and C-level changes will be needed to shut this up.

No idea why this didn't come up when I was compiling this ... oh well, good thing I'm not a proud guy :) I'll get this fixed and post a patch later today.

Thanks.

Signature · 2 lines
paul moore
linux @ hp
#9 lore raw
Quoted 8 lines · Paul Moore
Quoted 7 lines · Andrew Morton
Quoted 3 lines

net/netlabel/netlabel_mgmt.c: In function `netlbl_mgmt_listentry': net/netlabel/netlabel_mgmt.c:268:
warning: 'ret_val' might be used uninitialized in this function

Assumes that netlbl_af4list_foreach_rcu() will never iterate zero times.

Quoted 8 lines
Quoted 4 lines

Assumes that entry->type can never have an unexpected value.

gcc cannot get this right, and C-level changes will be needed to shut this up.

No idea why this didn't come up when I was compiling this ... oh well, good thing I'm not a proud guy :) I'll get this fixed and post a patch later today.

I updated my lblnet-2.6_next tree with a fix as well as another patch from Roel Kluin to fix a signed/unsigned mistake. I'll post the patches to the relevant lists but I'm waiting one more patch from someone first.

In the meantime, interested parties can find the git tree here:

* git://git.infradead.org/users/pcmoore/lblnet-2.6_next

Signature · 2 lines
paul moore
linux @ hp