linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: vgoyal@in.ibm.com
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org,
	Fastboot mailing list <fastboot@lists.osdl.org>
Subject: Re: [Fastboot] [PATCH] kdump: don't call __ioremap() for pfn = 0
Date: Fri, 22 Sep 2006 16:55:46 +1000	[thread overview]
Message-ID: <1158908146.9761.23.camel@localhost.localdomain> (raw)
In-Reply-To: <20060921141049.GB1542@in.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 1256 bytes --]

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

  reply	other threads:[~2006-09-22  6:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-21  4:37 [PATCH] kdump: don't call __ioremap() for pfn = 0 Sachin P. Sant
2006-09-21 11:02 ` Michael Ellerman
2006-09-21 14:10   ` [Fastboot] " Vivek Goyal
2006-09-22  6:55     ` Michael Ellerman [this message]
2006-09-22  4:22   ` Sachin P. Sant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1158908146.9761.23.camel@localhost.localdomain \
    --to=michael@ellerman.id.au \
    --cc=fastboot@lists.osdl.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=vgoyal@in.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).