mirror of
https://github.com/torvalds/linux.git
synced 2025-04-09 14:45:27 +00:00
xtensa: remove the get_order() implementation
As the get_order() implemented by xtensa supporting 'nsau' instruction seems be the same as the generic implementation in include/asm-generic/getorder.h when size is not a constant value as the generic implementation calling the fls*() is also utilizing the 'nsau' instruction for xtensa. So remove the get_order() implemented by xtensa, as using the generic implementation may enable the compiler to do the computing when size is a constant value instead of runtime computing and enable the using of get_order() in BUILD_BUG_ON() macro in next patch. CC: Andrew Morton <akpm@linux-foundation.org> CC: Linux-MM <linux-mm@kvack.org> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Acked-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Alexander Duyck <alexanderduyck@fb.com> Link: https://patch.msgid.link/20241028115343.3405838-6-linyunsheng@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
3d18dfe69c
commit
49e302be73
@ -109,26 +109,8 @@ typedef struct page *pgtable_t;
|
||||
#define __pgd(x) ((pgd_t) { (x) } )
|
||||
#define __pgprot(x) ((pgprot_t) { (x) } )
|
||||
|
||||
/*
|
||||
* Pure 2^n version of get_order
|
||||
* Use 'nsau' instructions if supported by the processor or the generic version.
|
||||
*/
|
||||
|
||||
#if XCHAL_HAVE_NSA
|
||||
|
||||
static inline __attribute_const__ int get_order(unsigned long size)
|
||||
{
|
||||
int lz;
|
||||
asm ("nsau %0, %1" : "=r" (lz) : "r" ((size - 1) >> PAGE_SHIFT));
|
||||
return 32 - lz;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
# include <asm-generic/getorder.h>
|
||||
|
||||
#endif
|
||||
|
||||
struct page;
|
||||
struct vm_area_struct;
|
||||
extern void clear_page(void *page);
|
||||
|
Loading…
x
Reference in New Issue
Block a user