[PATCH] remove unnecessary check code for hole_align

Simon Horman horms at verge.net.au
Tue Nov 8 02:22:08 EST 2011


On Tue, Nov 08, 2011 at 01:26:23PM +0800, Dave Young wrote:
> hole_align == 0 check is not neccesary, because it will be set to
> pagesize if it's zero. Just remove it here.
> 

Hi Dave,

it looks like the if condition can never be true due
to hole_base being set to a non-zero value on the
previous line.

Which is a long way of saying, I like your patch.

> Signed-off-by: Dave Young <dyoung at redhat.com>
> ---
>  kexec/kexec.c |    4 ----
>  1 file changed, 4 deletions(-)
> 
> Index: kexec-tools/kexec/kexec.c
> ===================================================================
> --- kexec-tools.orig/kexec/kexec.c
> +++ kexec-tools/kexec/kexec.c
> @@ -203,10 +203,6 @@ unsigned long locate_hole(struct kexec_i
>  	/* Set an intial invalid value for the hole base */
>  	hole_base = ULONG_MAX;
>  
> -	/* Ensure I have a sane alignment value */
> -	if (hole_align == 0) {
> -		hole_align = 1;
> -	}
>  	/* Align everything to at least a page size boundary */
>  	if (hole_align < (unsigned long)getpagesize()) {
>  		hole_align = getpagesize();
> 
> _______________________________________________
> kexec mailing list
> kexec at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
> 



More information about the kexec mailing list