Re: [patch -mm] Make check_signature() depend on CONFIG_HAS_IOMEM

Geert Uytterhoeven
2007-06-29T13:09:28Z

On Thu, 28 Jun 2007, Alan Cox wrote:
> > check_signature() needs readb() but with some setups (s390, m68k allmodconfig)
> > there is no implementation of readb. This causes build errors with
> > -Werror-implicit-function-declaration.
>
> This completely bogus. readb() should be present on M68K, fix the
> platform to implement readb() for MMIO, even if your MMIO readb is a
> moveb instruction.
>
> check_signature is relevant for anything with MMIO space (for example you
> can legitimately want to check_signature a MAC68K Nubus ROM).

To make it more generic, it should probably use the raw*() version, and
the caller should handle bus address conversion. But even that
isn't possible, as there's no guarantee readb(x+1) == raw_readb(x+1).

Anyway, here's a list of its users, as I responded to Andrew in a private
mail before this thread was started:

| drivers/block/xd.c: config BLK_DEV_XD depends on ISA && ISA_DMA_API
| drivers/input/misc/wistron_btns.c: config INPUT_WISTRON_BTNS depends on X86 && !X86_64

That should be X86_32 these days?

| drivers/scsi/aha152x.c: config SCSI_AHA152X depends on ISA && SCSI && !64BIT
| drivers/scsi/dtc.c: config SCSI_DTC3280 depends on ISA && SCSI
| drivers/scsi/fdomain.c: config SCSI_FUTURE_DOMAIN depends on (ISA || PCI) && SCSI
| drivers/scsi/seagate.c: config SCSI_SEAGATE depends on X86 && ISA && SCSI
| drivers/scsi/t128.c: config SCSI_T128 depends on ISA && SCSI
| drivers/scsi/wd7000.c: config SCSI_7000FASST depends on ISA && SCSI && ISA_DMA_API

BTW, include/asm-arm/io.h looks interesting:

| #elif !defined(readb)
|
| #define readb(c) (__readwrite_bug("readb"),0)
| #define readw(c) (__readwrite_bug("readw"),0)
| #define readl(c) (__readwrite_bug("readl"),0)
| #define writeb(v,c) __readwrite_bug("writeb")
| #define writew(v,c) __readwrite_bug("writew")
| #define writel(v,c) __readwrite_bug("writel")
|
| #define check_signature(io,sig,len) (0)
|
| #endif /* __mem_pci */

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds