Re: [PATCH] MIPS: fix pfn_valid() for FLAGMEM

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

 



Hello,

> > > 
> > > Looks mostly ok, small comments below. 
> > > 
> > > > @@ -168,13 +168,10 @@ typedef struct { unsigned long pgprot; } pgprot_t;
> > > >  
> > > >  #ifdef CONFIG_FLATMEM
> > > >  
> > > > -#define pfn_valid(pfn)							\
> > > > -({									\
> > > > -	unsigned long __pfn = (pfn);					\
> > > > -	/* avoid <linux/bootmem.h> include hell */			\
> > > > -	extern unsigned long min_low_pfn;				\
> > > > -									\
> > > > -	__pfn >= min_low_pfn && __pfn < max_mapnr;			\
> > > > +#define pfn_valid(pfn)				\
> > > > +({						\
> > > > +	extern int is_pfn_valid(unsigned long); \
> > > > +	is_pfn_valid(pfn);			\
> > > >  })
> > > 
> > > "extern int pfn_valid here"
> > > 
> > > ...and get away without the ugly macro?
> > > 
> > 
> > Perhaps need to move the whole "#ifdef CONFIG_FLATMEM" to #ifndef
> > ASSEMBLY, otherwise,
> > 
> > "arch/mips/include/asm/page.h:170: Error: unrecognized opcode `extern
> > int pfn_valid(unsigned long)'". 
> 
> I guess so. pfn_valid() will not work from assembly, anywa, so...

Seems pfn_valid() is only called in non-ASSEMBLY source code, so, we are
safe to move it to "#ifndef ASSEMBLY", just tested it, works.

Regards,
	Wu Zhangjin



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux