[PATCH] hugetlb: remove repeated code