From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 29 Aug 2012 09:57:18 +1000 From: Paul Mackerras To: Paul Gortmaker Subject: Re: [PATCH] powerpc/mm: match variable types to API Message-ID: <20120828235718.GA11869@bloggs.ozlabs.ibm.com> References: <1345573348-28248-1-git-send-email-paul.gortmaker@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <1345573348-28248-1-git-send-email-paul.gortmaker@windriver.com> Cc: linuxppc-dev@lists.ozlabs.org, Joe MacDonald List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, Aug 21, 2012 at 02:22:28PM -0400, Paul Gortmaker wrote: > From: Joe MacDonald > > 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 > Cc: Benjamin Herrenschmidt > Signed-off-by: Joe MacDonald > Signed-off-by: Paul Gortmaker 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