linux-mips
[Top] [All Lists]

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

To: Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH] MIPS: fix pfn_valid() for FLAGMEM
From: Wu Zhangjin <wuzhangjin@gmail.com>
Date: Thu, 08 Oct 2009 18:57:43 +0800
Cc: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>, "Rafael J. Wysocki" <rjw@sisk.pl>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:reply-to:to:cc :in-reply-to:references:content-type:organization:date:message-id :mime-version:x-mailer:content-transfer-encoding; bh=eHMSSzz9HjcZONNxzvPtn1yUimn+ys6pozSD64FXavQ=; b=QXrXIzvE0kcToTyZpKOk6QKyI/DFCt/FwZ92Q55NR5kmcTvs2fy6vmlVsPNKu7hnH0 XJfhZfzEtfJnIi3tIEKoub7El9nLTLzvlgcqa7P2BFVf7oO65LOPanpKA+VzncHa3Tfl +2EZiFJ3Pzrgi9HUQW8jpFNHlJP1nJ9pxkgRE=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:reply-to:to:cc:in-reply-to:references:content-type :organization:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=aYuULraivpXenZPcLAGbFUQQPe3OP7t3O8rVURAYc2TpLUI7jzfm52ME/y4P7umVCk jU3fwwbovJb2wLzPTQCYyght/641pG45UrAJCCa2NzatQocv+GTIUgaArwxQiDMfvBBY i5A0T/Ub1tkZG5bzeBMvOeUkuzwb5nBSrXm4g=
In-reply-to: <20091008103614.GA27323@elf.ucw.cz>
Organization: DSLab, Lanzhou University, China
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1254992252-15923-1-git-send-email-wuzhangjin@gmail.com> <20091008092903.GA27054@elf.ucw.cz> <1254998019.14496.21.camel@falcon> <20091008103614.GA27323@elf.ucw.cz>
Reply-to: wuzhangjin@gmail.com
Sender: linux-mips-bounce@linux-mips.org
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


<Prev in Thread] Current Thread [Next in Thread>