Use linux/io.h instead of asm/io.h
Subsystems (7)
PATCH 1/1 Use linux/io.h instead of asm/io.h
In preparation for moving check_signature, change these users from asm/io.h to linux/io.h
--- drivers/block/xd.c | 2 +- drivers/input/misc/wistron_btns.c | 2 +- drivers/net/eth16i.c | 2 +- drivers/scsi/aha152x.c | 2 +- drivers/scsi/dtc.c | 2 +- drivers/scsi/fdomain.c | 2 +- drivers/scsi/seagate.c | 2 +- drivers/scsi/t128.c | 2 +- drivers/scsi/wd7000.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-)
drivers/block/xd.c +1 -1
@@ -48,9 +48,9 @@ #include <linux/wait.h>#include <linux/blkdev.h> #include <linux/blkpg.h> #include <linux/delay.h> +#include <linux/io.h> #include <asm/system.h> -#include <asm/io.h> #include <asm/uaccess.h> #include <asm/dma.h>
drivers/input/misc/wistron_btns.c +1 -1
@@ -17,7 +17,7 @@* with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place Suite 330, Boston, MA 02111-1307, USA. */ -#include <asm/io.h> +#include <linux/io.h> #include <linux/dmi.h> #include <linux/init.h> #include <linux/input.h>
drivers/net/eth16i.c +1 -1
@@ -162,9 +162,9 @@ #include <linux/etherdevice.h>#include <linux/skbuff.h> #include <linux/bitops.h> #include <linux/jiffies.h> +#include <linux/io.h> #include <asm/system.h> -#include <asm/io.h> #include <asm/dma.h>
drivers/scsi/aha152x.c +1 -1
@@ -238,7 +238,7 @@#include <linux/module.h> #include <linux/sched.h> #include <asm/irq.h> -#include <asm/io.h> +#include <linux/io.h> #include <linux/blkdev.h> #include <asm/system.h> #include <linux/errno.h>
drivers/scsi/dtc.c +1 -1
@@ -82,7 +82,7 @@ #include <linux/stat.h>#include <linux/string.h> #include <linux/init.h> #include <linux/interrupt.h> -#include <asm/io.h> +#include <linux/io.h> #include "scsi.h" #include <scsi/scsi_host.h> #include "dtc.h"
drivers/scsi/fdomain.c +1 -1
@@ -278,9 +278,9 @@ #include <linux/proc_fs.h>#include <linux/pci.h> #include <linux/stat.h> #include <linux/delay.h> +#include <linux/io.h> #include <scsi/scsicam.h> -#include <asm/io.h> #include <asm/system.h> #include <scsi/scsi.h>
drivers/scsi/seagate.c +1 -1
@@ -97,8 +97,8 @@ #include <linux/init.h>#include <linux/blkdev.h> #include <linux/stat.h> #include <linux/delay.h> +#include <linux/io.h> -#include <asm/io.h> #include <asm/system.h> #include <asm/uaccess.h>
drivers/scsi/t128.c +1 -1
@@ -109,7 +109,7 @@ #define PSEUDO_DMA#include <asm/system.h> #include <linux/signal.h> #include <linux/sched.h> -#include <asm/io.h> +#include <linux/io.h> #include <linux/blkdev.h> #include <linux/interrupt.h> #include <linux/stat.h>
drivers/scsi/wd7000.c +1 -1
@@ -178,10 +178,10 @@ #include <linux/proc_fs.h>#include <linux/blkdev.h> #include <linux/init.h> #include <linux/stat.h> +#include <linux/io.h> #include <asm/system.h> #include <asm/dma.h> -#include <asm/io.h> #include <scsi/scsi.h> #include <scsi/scsi_cmnd.h>
Signature · 1 line
1.4.1.1
PATCH 1/1 Consolidate check_signature
There's nothing arch-specific about check_signature(), so move it to <linux/io.h>. Use a cross between the Alpha and i386 implementations as the generic one.
--- include/asm-alpha/io.h | 13 ------------- include/asm-arm/io.h | 17 ----------------- include/asm-frv/io.h | 21 --------------------- include/asm-i386/io.h | 27 --------------------------- include/asm-m32r/io.h | 32 -------------------------------- include/asm-mips/io.h | 26 -------------------------- include/asm-powerpc/io.h | 26 -------------------------- include/asm-ppc/io.h | 16 ---------------- include/asm-sh/io.h | 16 ---------------- include/asm-sh64/io.h | 16 ---------------- include/asm-sparc64/io.h | 15 --------------- include/asm-x86_64/io.h | 27 --------------------------- include/linux/io.h | 27 +++++++++++++++++++++++++++ 13 files changed, 27 insertions(+), 252 deletions(-)
include/asm-alpha/io.h +0 -13
@@ -533,19 +533,6 @@ extern void outsl (unsigned long port, c#define eth_io_copy_and_sum (skb,src,len,unused) \ memcpy_fromio((skb)->data,src,len) -static inline int -check_signature (const volatile void __iomem *io_addr, -const unsigned char *signature,int length) -{ -do { -if (readb (io_addr) != *signature) -return 0 ; - io_addr++; - signature++; - }while (--length); -return 1 ; -} -/* * The Alpha Jensen hardware for some rather strange reason puts * the RTC clock at 0x170 instead of 0x70. Probably due to some
include/asm-arm/io.h +0 -17
@@ -193,23 +193,6 @@ #define memcpy_toio(c,a,l) _memcpy_toio(#define eth_io_copy_and_sum (s,c,l,b) \ eth_copy_and_sum((s),__mem_pci(c),(l),(b)) -static inline int -check_signature (void __iomem *io_addr,const unsigned char *signature, -int length) -{ -int retval =0 ; -do { -if (readb (io_addr) != *signature) - goto out; - io_addr++; - signature++; - length--; - }while (length); - retval =1 ; -out: -return retval; -} -#elif !defined(readb)#define readb (c) (__readwrite_bug("readb"),0)
include/asm-frv/io.h +0 -21
@@ -385,27 +385,6 @@ #define xlate_dev_mem_ptr(p) __va(p)*/ #define xlate_dev_kmem_ptr (p) p -/* -* Check BIOS signature -*/ -static inline int check_signature (volatile void __iomem *io_addr, -const unsigned char *signature,int length) -{ -int retval =0 ; - -do { -if (readb (io_addr) != *signature) - goto out; - io_addr++; - signature++; - length--; - }while (length); - - retval =1 ; -out: -return retval; -} -#endif /* __KERNEL__ */ #endif /* _ASM_IO_H */
include/asm-i386/io.h +0 -27
@@ -224,33 +224,6 @@ #define __ISA_IO_base ((char __iomem *)(#define eth_io_copy_and_sum (a,b,c,d) eth_copy_and_sum((a),(void __force *)(b),(c),(d)) -/** -* check_signature - find BIOS signatures -* @io_addr: mmio address to check -* @signature: signature block -* @length: length of signature -* -* Perform a signature comparison with the mmio address io_addr. This -* address should have been obtained by ioremap. -* Returns 1 on a match. -*/ - -static inline int check_signature (volatile void __iomem * io_addr, -const unsigned char *signature,int length) -{ -int retval =0 ; -do { -if (readb (io_addr) != *signature) - goto out; - io_addr++; - signature++; - length--; - }while (length); - retval =1 ; -out: -return retval; -} -/* * Cache management *
include/asm-m32r/io.h +0 -32
@@ -166,38 +166,6 @@ #define mmiowb()#define flush_write_buffers () do { } while (0)/* M32R_FIXME */ -/** -* check_signature - find BIOS signatures -* @io_addr: mmio address to check -* @signature: signature block -* @length: length of signature -* -* Perform a signature comparison with the ISA mmio address io_addr. -* Returns 1 on a match. -* -* This function is deprecated. New drivers should use ioremap and -* check_signature. -*/ - -static inline int check_signature (void __iomem *io_addr, -const unsigned char *signature,int length) -{ -int retval =0 ; -#if 0 -printk ("check_signature\n" ); -do { -if (readb (io_addr) != *signature) - goto out; - io_addr++; - signature++; - length--; - }while (length); - retval =1 ; -out: -#endif -return retval; -} -static inline void memset_io (volatile void __iomem *addr,unsigned char val,int count) {
include/asm-mips/io.h +0 -26
@@ -562,32 +562,6 @@ #define __ISA_IO_base ((char *)(isa_slot#define eth_io_copy_and_sum (skb,src,len,unused) memcpy_fromio((skb)->data,(src),(len))/* -* check_signature - find BIOS signatures -* @io_addr: mmio address to check -* @signature: signature block -* @length: length of signature -* -* Perform a signature comparison with the mmio address io_addr. This -* address should have been obtained by ioremap. -* Returns 1 on a match. -*/ -static inline int check_signature (char __iomem *io_addr, -const unsigned char *signature,int length) -{ -int retval =0 ; -do { -if (readb (io_addr) != *signature) - goto out; - io_addr++; - signature++; - length--; - }while (length); - retval =1 ; -out: -return retval; -} - -/* * The caches on some architectures aren't dma-coherent and have need to * handle this in software. There are three types of operations that * can be applied to dma buffers.
include/asm-powerpc/io.h +0 -26
@@ -404,32 +404,6 @@ static inline void __out_be64(volatile u#include <asm/eeh.h> -/** -* check_signature - find BIOS signatures -* @io_addr: mmio address to check -* @signature: signature block -* @length: length of signature -* -* Perform a signature comparison with the mmio address io_addr. This -* address should have been obtained by ioremap. -* Returns 1 on a match. -*/ -static inline int check_signature (const volatile void __iomem * io_addr, -const unsigned char *signature,int length) -{ -int retval =0 ; -do { -if (readb (io_addr) != *signature) - goto out; - io_addr++; - signature++; - length--; - }while (length); - retval =1 ; -out: -return retval; -} -/* Nothing to do */ #define dma_cache_inv (_start,_size) do { } while (0)
include/asm-ppc/io.h +0 -16
@@ -439,22 +439,6 @@ #define iobarrier_rw() eieio()#define iobarrier_r () eieio()#define iobarrier_w () eieio() -static inline int check_signature (volatile void __iomem * io_addr, -const unsigned char *signature,int length) -{ -int retval =0 ; -do { -if (readb (io_addr) != *signature) - goto out; - io_addr++; - signature++; - length--; - }while (length); - retval =1 ; -out: -return retval; -} -/* * Here comes the ppc implementation of the IOMAP * interfaces.
include/asm-sh/io.h +0 -16
@@ -304,22 +304,6 @@ #define p3_ioremap(offset, size, flags)#define iounmap (addr) \ __iounmap((addr)) -static inline int check_signature (char __iomem *io_addr, -const unsigned char *signature,int length) -{ -int retval =0 ; -do { -if (readb (io_addr) != *signature) - goto out; - io_addr++; - signature++; - length--; - }while (length); - retval =1 ; -out: -return retval; -} -/* * The caches on some architectures aren't dma-coherent and have need to * handle this in software. There are three types of operations that
include/asm-sh64/io.h +0 -16
@@ -178,22 +178,6 @@ extern void iounmap(void *addr);unsigned long onchip_remap (unsigned long addr,unsigned long size,const char * name);extern void onchip_unmap (unsigned long vaddr); -static __inline__int check_signature (volatile void __iomem *io_addr, -const unsigned char *signature,int length) -{ -int retval =0 ; -do { -if (readb (io_addr) != *signature) - goto out; - io_addr++; - signature++; - length--; - }while (length); - retval =1 ; -out: -return retval; -} -/* * The caches on some architectures aren't dma-coherent and have need to * handle this in software. There are three types of operations that
include/asm-sparc64/io.h +0 -15
@@ -440,21 +440,6 @@ _memcpy_toio(volatile void __iomem *dst,#define memcpy_toio (d,s,sz) _memcpy_toio(d,s,sz) -static inline int check_signature (void __iomem *io_addr, -const unsigned char *signature, -int length) -{ -int retval =0 ; -do { -if (readb (io_addr) != *signature++) - goto out; - io_addr++; - }while (--length); - retval =1 ; -out: -return retval; -} -#define mmiowb ()#ifdef __KERNEL__
include/asm-x86_64/io.h +0 -27
@@ -254,33 +254,6 @@ #define __ISA_IO_base ((char __iomem *)(#define eth_io_copy_and_sum (a,b,c,d) eth_copy_and_sum((a),(void *)(b),(c),(d)) -/** -* check_signature - find BIOS signatures -* @io_addr: mmio address to check -* @signature: signature block -* @length: length of signature -* -* Perform a signature comparison with the mmio address io_addr. This -* address should have been obtained by ioremap. -* Returns 1 on a match. -*/ - -static inline int check_signature (void __iomem *io_addr, -const unsigned char *signature,int length) -{ -int retval =0 ; -do { -if (readb (io_addr) != *signature) - goto out; - io_addr++; - signature++; - length--; - }while (length); - retval =1 ; -out: -return retval; -} -/* Nothing to do */ #define dma_cache_inv (_start,_size) do { } while (0)
include/linux/io.h +27 -0
@@ -27,4 +27,31 @@ void __iowrite64_copy(void __iomem *to,int ioremap_page_range (unsigned long addr,unsigned long end,unsigned long phys_addr,pgprot_t prot); +/** +* check_signature - find BIOS signatures +* @io_addr: mmio address to check +* @signature: signature block +* @length: length of signature +* +* Perform a signature comparison with the mmio address io_addr. This +* address should have been obtained by ioremap. +* Returns 1 on a match. +*/ + +static inline int check_signature (const volatile void __iomem *io_addr, +const unsigned char *signature,int length) +{ +int retval =0 ; +do { +if (readb (io_addr) != *signature) + goto out; + io_addr++; + signature++; + length--; + }while (length); + retval =1 ; +out: +return retval; +} +#endif /* _LINUX_IO_H */
Signature · 1 line
1.4.1.1
Re: [PATCH] Consolidate check_signature
Quoted 5 lines · Matthew Wilcox
There's nothing arch-specific about
check_signature(), so move it to <linux/io.h>. Use a cross between the Alpha and i386 implementations as the generic one.Signed-off-by Matthew Wilcox <[email protected]>
IMO this isn't 2.6.19-rc1 material.
Much more appropriate for 2.6.20, after living in -mm for a while.
Jeff
Re: [PATCH] Consolidate check_signature
In reply to Matthew WilcoxAr Iau, 2006-10-05 am 11:05 -0600, ysgrifennodd Matthew Wilcox:
Quoted 5 lines
There's nothing arch-specific about
check_signature(), so move it to <linux/io.h>. Use a cross between the Alpha and i386 implementations as the generic one.Signed-off-by Matthew Wilcox <[email protected]>
Re: [PATCH] Consolidate check_signature
In reply to Matthew WilcoxQuoted 3 lines · On Thu, 05 Oct 2006 11:05:55 -0600 Matthew Wilcox <[email protected]> wrote:
There's nothing arch-specific about
check_signature(), so move it to <linux/io.h>. Use a cross between the Alpha and i386 implementations as the generic one.
It wuld have been nice to have uninlined it too. And to have given it a less crappy name.
Re: [PATCH] Consolidate check_signature
Quoted 9 lines · Andrew Morton
Quoted 3 lines · On Thu, 05 Oct 2006 11:05:55 -0600 Matthew Wilcox <[email protected]> wrote:
There's nothing arch-specific about
check_signature(), so move it to <linux/io.h>. Use a cross between the Alpha and i386 implementations as the generic one.It wuld have been nice to have uninlined it too. And to have given it a less crappy name.
memcmp_withio(), to follow the general style?
Quoted 4 lines · Matthew Wilcox
In preparation for moving
check_signature, change these users fromasm/io.htolinux/io.hSigned-off-by Matthew Wilcox <[email protected]>
The vast majority of drivers include asm/io.h.
Wouldn't it be better to move check_signature to include/asm-generic/io.h, and include that where needed?
Jeff
Quoted 5 lines · Jeff Garzik
Quoted 2 lines · Matthew Wilcox
In preparation for moving
check_signature, change these users fromasm/io.htolinux/io.hThe vast majority of drivers include
asm/io.h.
Yes. linux/io.h was only created recently. It's proper style to include linux/foo.h when both linux/foo.h and asm/foo.h exist [1] This is just a transition which hasn't been completed yet (indeed, has barely begun).
Quoted 2 lines
Wouldn't it be better to move
check_signaturetoinclude/asm-generic/io.h, and include that where needed?
I really don't think that proliferating header files unnecessarily is a good idea.
[1] Except, of course, <linux/irq.h>, but I thought rmk was going to fix that.
Ar Iau, 2006-10-05 am 11:05 -0600, ysgrifennodd Matthew Wilcox:
Quoted 4 lines
In preparation for moving
check_signature, change these users fromasm/io.htolinux/io.hSigned-off-by Matthew Wilcox <[email protected]>