• X
    arm64: ilp32: fix compile warning cause by 'VA_BITS' · 77611efc
    Xiongfeng Wang 提交于
    hulk inclusion
    category: feature
    bugzilla: NA
    CVE: NA
    ---------------------------
    
    Compiling with 'CONFIG_ARM64_ILP32' enabled display the following
    warning.
    
    ./arch/arm64/include/asm/memory.h: In function ‘kaslr_offset’:
    ./arch/arm64/include/asm/memory.h:61:9: warning: left shift count >= width of type [-Wshift-count-overflow]
      (UL(1) << VA_BITS) + 1)
             ^
    ./arch/arm64/include/asm/memory.h:66:25: note: in expansion of macro ‘VA_START’
     #define MODULES_VADDR  (VA_START + KASAN_SHADOW_SIZE)
                             ^~~~~~~~
    ./arch/arm64/include/asm/memory.h: In function ‘virt_to_phys’:
    ./include/linux/bits.h:6:24: warning: left shift count >= width of type [-Wshift-count-overflow]
     #define BIT(nr)   (1UL << (nr))
                            ^
    ./arch/arm64/include/asm/memory.h:228:44: note: in expansion of macro ‘BIT’
     #define __is_lm_address(addr) (!!((addr) & BIT(VA_BITS - 1)))
                                                ^~~
    
    ./arch/arm64/include/asm/memory.h: In function ‘phys_to_virt’:
    ./arch/arm64/include/asm/memory.h:63:9: warning: left shift count >= width of type [-Wshift-count-overflow]
      (UL(1) << (VA_BITS - 1)) + 1)
             ^
    ./arch/arm64/include/asm/memory.h:249:65: note: in expansion of macro ‘PAGE_OFFSET’
     #define __phys_to_virt(x) ((unsigned long)((x) - PHYS_OFFSET) | PAGE_OFFSET)
                                                                     ^~~~~~~~~~~
    
    Fix it by excluding these three function when __ILP32__ is not defined
    since they are not used in 'gettimeofday.c'.
    Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
    Reviewed-by: NHanjun Guo &lt;guohanjun@huawei.com <mailto:guohanjun@huawei.com&gt;>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    77611efc
memory.h 9.4 KB