[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57773.1240857915@turing-police.cc.vt.edu>
Date: Mon, 27 Apr 2009 14:45:15 -0400
From: Valdis.Kletnieks@...edu
To: Nick Piggin <npiggin@...e.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, mm-commits@...r.kernel.org
Subject: Re: mmotm 2009-04-24-18-14 uploaded - NVidia indigestion
On Sat, 25 Apr 2009 07:24:34 +0200, Nick Piggin said:
> > #include <linux/version.h>
> > #include <linux/utsname.h>
> > int main() {
> > if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) {
> > return 0;
> > } else {
> > return 1;
> > }
> Yeah BUILD_BUG_ON does work like that. I can't for the life of me
> understand why it triggered though. Is anything in your external
> code calling kmalloc_slab directly?
See above - I didn't think LINUX_VERSION_CODE cared about kmalloc, but
I could be wrong on this. ;)
> What's the preprocessor output look like?
The problem appears to be that if you only include version.h and utsname.h,
and *don't* actually reference kmalloc_slab, it doesn't know that the size_t
is actually a constant, so it whinges. Most modules end up doing at least
one kmalloc(), so kmalloc() and kmalloc_slab() get inlined, the constant 'size'
gets propogated, and life is good. If you *don't* call kmalloc(), bad things
happen. ;)
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists