Re: 2.6.12-rc5-mm1 - missing #define SECTIONS_SHIFT in sparsemem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 30 May 2005 00:27:19 BST, Andy Whitcroft said:
> [email protected] wrote:
> > sparsemem-memory-model.patch references SECTIONS_SHIFT without defining it.
> > 
> > Caught this while compiling with -Wundef, causes lots of warnings
> > when it gets used in include/linux/mm.h.  The appended patch Works For Me,
> > although I wonder if the *real* problem isn't a missing '#ifdef CONFIG_SPARSEMEM'
> > around the code that uses it in mm.h.  
> >  
> > Signed-Off-By: [email protected]
> > 
> > --- linux-2.6.12-rc5-mm1/include/linux/mmzone.h.ifdef	2005-05-27 15:1
2:26.000000000 -0400
> > +++ linux-2.6.12-rc5-mm1/include/linux/mmzone.h	2005-05-27 16:26:40.000
000000 -0400
> > @@ -568,6 +568,7 @@ static inline int pfn_valid(unsigned lon
> >  void sparse_init(void);
> >  #else
> >  #define sparse_init()	do {} while (0)
> > +#define SECTIONS_SHIFT	0
> >  #endif /* CONFIG_SPARSEMEM */
> >  
> >  #ifdef CONFIG_NODES_SPAN_OTHER_NODES
> 
> Odd.  I guess there must be a reference from an unused function to this
> define when SPARSEMEM is off.  Can you send me your .config please and
> I'll have a look.

The warning comes out of *every* kernel module that #includes kernel/mm.h
and reaches line 424:

 #if SECTIONS_SHIFT+NODES_SHIFT+ZONES_SHIFT <= FLAGS_RESERVED
 #define NODES_WIDTH             NODES_SHIFT
 #else
 #define NODES_WIDTH             0
 #endif

That's not wrapped in a #ifdef CONFIG_DISCONTIGMEM or SPARSEMEN or HIGHMEM or
any of the other obvious candidates.  You only see the warning if you add
-Wundef to your CFLAGS.

I'll send the .config privately in a separate message. Pretty standard stock
defaults for a laptop with only 256M of memory. The quick quick
synopsis for the rest of you:

[/usr/src/linux-2.6.12-rc5-mm1]2 grep MEM .config
CONFIG_SHMEM=y
# CONFIG_TINY_SHMEM is not set
CONFIG_NOHIGHMEM=y
# CONFIG_HIGHMEM4G is not set
# CONFIG_HIGHMEM64G is not set
CONFIG_SELECT_MEMORY_MODEL=y
CONFIG_FLATMEM_MANUAL=y
# CONFIG_DISCONTIGMEM_MANUAL is not set
# CONFIG_SPARSEMEM_MANUAL is not set
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_BLK_DEV_UMEM is not set
CONFIG_SND_DEBUG_MEMORY=y


Attachment: pgp6tKARj1I0T.pgp
Description: PGP signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux