linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linuxppc-dev@lists.ozlabs.org,
	Joe MacDonald <joe.macdonald@windriver.com>
Subject: Re: [PATCH] powerpc/mm: match variable types to API
Date: Wed, 29 Aug 2012 09:57:18 +1000	[thread overview]
Message-ID: <20120828235718.GA11869@bloggs.ozlabs.ibm.com> (raw)
In-Reply-To: <1345573348-28248-1-git-send-email-paul.gortmaker@windriver.com>

On Tue, Aug 21, 2012 at 02:22:28PM -0400, Paul Gortmaker wrote:
> From: Joe MacDonald <joe.macdonald@windriver.com>
> 
> sys_subpage_prot() takes an unsigned long for 'addr' then does some stuff
> with it and the result is stored in a signed int, i, which is eventually
> used as the size parameter in a copy_from_user call.  Update 'i' to be an
> unsigned long as well and since 'nw' is used in a size_t context which,
> depending on whether this is 32- or 64-bit may be unsigned int or unsigned
> long, switch that to a size_t and always be right.
> 
> Finally, since we're in the neighbourhood, make the same changes to
> subpage_prot_clear().
> 
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

This change won't hurt; in fact it won't make any difference since (a)
this code is only ever used on 64-bit and (b) i and nw are restricted
to the range 0 .. PTRS_PER_PTE - 1, but I agree the code is slightly
cleaner this way.

Acked-by: Paul Mackerras <paulus@samba.org>

      reply	other threads:[~2012-08-28 23:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21 18:22 [PATCH] powerpc/mm: match variable types to API Paul Gortmaker
2012-08-28 23:57 ` Paul Mackerras [this message]

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=20120828235718.GA11869@bloggs.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=joe.macdonald@windriver.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paul.gortmaker@windriver.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).