lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 17 Nov 2014 00:11:51 +0000
From:	Naoya Horiguchi <n-horiguchi@...jp.nec.com>
To:	Luiz Capitulino <lcapitulino@...hat.com>
CC:	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"andi@...stfloor.org" <andi@...stfloor.org>,
	"rientjes@...gle.com" <rientjes@...gle.com>,
	"riel@...hat.com" <riel@...hat.com>,
	"isimatu.yasuaki@...fujitsu.com" <isimatu.yasuaki@...fujitsu.com>,
	"yinghai@...nel.org" <yinghai@...nel.org>,
	"davidlohr@...com" <davidlohr@...com>
Subject: Re: [PATCH 2/3] hugetlb: alloc_bootmem_huge_page(): use IS_ALIGNED()

On Wed, Nov 12, 2014 at 05:33:12PM -0500, Luiz Capitulino wrote:
> No reason to duplicate the code of an existing macro.
> 
> Signed-off-by: Luiz Capitulino <lcapitulino@...hat.com>

I think that we can apply the same macro for the following two lines in
__unmap_hugepage_range():

	BUG_ON(start & ~huge_page_mask(h));
	BUG_ON(end & ~huge_page_mask(h));

Anyway, this makes the code more readable.

Acked-by: Naoya Horiguchi <n-horiguchi@...jp.nec.com>

> ---
>  mm/hugetlb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 9fd7227..a10fd57 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1457,7 +1457,7 @@ int __weak alloc_bootmem_huge_page(struct hstate *h)
>  	return 0;
>  
>  found:
> -	BUG_ON((unsigned long)virt_to_phys(m) & (huge_page_size(h) - 1));
> +	BUG_ON(!IS_ALIGNED(virt_to_phys(m), huge_page_size(h)));
>  	/* Put them into a private list first because mem_map is not up yet */
>  	list_add(&m->list, &huge_boot_pages);
>  	m->hstate = h;
> -- 
> 1.9.3
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ