Question: locomo_{read/write}l macros

H Hartley Sweeten hartleys at visionengravers.com
Wed Jan 20 16:33:08 EST 2010


Hello all,

Is there a reason why the locomo stuff is using custom
macros for {read/write}l access?

In arch/arm/include/asm/hardware/locomo.h:

#define locomo_writel(val,addr)	({ *(volatile u16 *)(addr) = (val); })
#define locomo_readl(addr)	(*(volatile u16 *)(addr))

It appears that these are just non-typesafe versions of the
__raw_{read/write}w macros in arch/arm/include/asm/io.h:

#define __raw_writew(v,a)	(__chk_io_ptr(a), *(volatile unsigned short __force *)(a) = (v))
#define __raw_readw(a)		(__chk_io_ptr(a), *(volatile unsigned short __force *)(a))

Is there any reason not to change them all (other than
having to then fix all the callers to be typesafe)?

It appears the only users are in:

arch/arm/common/locomo.c
arch/arm/include/asm/hardware/locomo.h
drivers/input/keyboard/locomokbd.c
drivers/leds/leds-locomo.c
drivers/video/backlight/locomolcd.c

Thanks,
Hartley


More information about the linux-arm-kernel mailing list