[Fastboot] [PATCH] kdump: don't call __ioremap() for pfn = 0

Michael Ellerman michael at ellerman.id.au
Fri Sep 22 16:55:46 EST 2006


On Thu, 2006-09-21 at 10:10 -0400, Vivek Goyal wrote:
> On Thu, Sep 21, 2006 at 09:02:37PM +1000, Michael Ellerman wrote:
> > +
> > +static size_t copy_oldmem_vaddr(void *vaddr, char *buf, size_t csize,
> > +				unsigned long offset, int userbuf)
> > +{
> > +	if (userbuf) {
> > +		if (copy_to_user((char __user *)buf, (vaddr + offset), csize)) {
> > +			return -EFAULT;
> > +		}
> 
> Probably you can get rid of above pair of braces as there is only single
> statement under if.

Yep.

> >  
> > -	if (userbuf) {
> > -		if (copy_to_user((char __user *)buf, (vaddr + offset), csize)) {
> > -			iounmap(vaddr);
> > -			return -EFAULT;
> > -		}
> > -	} else
> > -		memcpy(buf, (vaddr + offset), csize);
> > +	if (pfn < max_pfn) {
> 
> Should this be (pfn <= max_pfn) ?

No, max_pfn is badly named. It seems to actually be the total number of
pages == the first pfn past the end of the linear mapping.

But it'd be cleaner to use page_is_ram(), I'll do a new patch.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20060922/af6fa433/attachment.pgp>


More information about the Linuxppc-dev mailing list