Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI / osl: replace custom implementation of readq / writeq

The readq() and writeq() helpers are available in the
asm-generic/io-64-nonatomic-hi-lo.h and asm-generic/io-64-nonatomic-lo-hi.h
headers. Replace custom implementation by the generic helpers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Andy Shevchenko and committed by
Rafael J. Wysocki
3277b4ea c13dcf9f

+3 -30
+3 -30
drivers/acpi/osl.c
··· 47 47 48 48 #include <asm/io.h> 49 49 #include <asm/uaccess.h> 50 + #include <asm-generic/io-64-nonatomic-lo-hi.h> 50 51 51 52 #include "internal.h" 52 53 ··· 948 947 949 948 EXPORT_SYMBOL(acpi_os_write_port); 950 949 951 - #ifdef readq 952 - static inline u64 read64(const volatile void __iomem *addr) 953 - { 954 - return readq(addr); 955 - } 956 - #else 957 - static inline u64 read64(const volatile void __iomem *addr) 958 - { 959 - u64 l, h; 960 - l = readl(addr); 961 - h = readl(addr+4); 962 - return l | (h << 32); 963 - } 964 - #endif 965 - 966 950 acpi_status 967 951 acpi_os_read_memory(acpi_physical_address phys_addr, u64 *value, u32 width) 968 952 { ··· 980 994 *(u32 *) value = readl(virt_addr); 981 995 break; 982 996 case 64: 983 - *(u64 *) value = read64(virt_addr); 997 + *(u64 *) value = readq(virt_addr); 984 998 break; 985 999 default: 986 1000 BUG(); ··· 993 1007 994 1008 return AE_OK; 995 1009 } 996 - 997 - #ifdef writeq 998 - static inline void write64(u64 val, volatile void __iomem *addr) 999 - { 1000 - writeq(val, addr); 1001 - } 1002 - #else 1003 - static inline void write64(u64 val, volatile void __iomem *addr) 1004 - { 1005 - writel(val, addr); 1006 - writel(val>>32, addr+4); 1007 - } 1008 - #endif 1009 1010 1010 1011 acpi_status 1011 1012 acpi_os_write_memory(acpi_physical_address phys_addr, u64 value, u32 width) ··· 1022 1049 writel(value, virt_addr); 1023 1050 break; 1024 1051 case 64: 1025 - write64(value, virt_addr); 1052 + writeq(value, virt_addr); 1026 1053 break; 1027 1054 default: 1028 1055 BUG();