Re: Add sparse "__iomem" infrastructure to check PCI address usage

From: Jeff Garzik
Date: Sun Sep 12 2004 - 21:43:06 EST


Linus Torvalds wrote:
On Sun, 12 Sep 2004, Jeff Garzik wrote:
1) what does force do? it doesn't appear to be in gcc 3.3.3 docs.

It doesn't do anything for gcc. You're looking at the sparse-only code.

doh, and thanks for the info.


2) is "volatile ... __force" redundant?

No, although it's likely to be a strange combination. If you want to force a static address space conversion to a volatile pointer, you can do so. I don't see _why_ you'd want to do it ;)

Well the reason I ask....

static inline void writeb(unsigned char b, volatile void __iomem *addr)
{
*(volatile unsigned char __force *) addr = b;
}
static inline void writew(unsigned short b, volatile void __iomem *addr)
{
*(volatile unsigned short __force *) addr = b;
}
static inline void writel(unsigned int b, volatile void __iomem *addr)
{
*(volatile unsigned int __force *) addr = b;
}


3) can we use 'malloc' attribute on kmalloc?

Since we can't use the gcc alias analysis anyway (it's too broken until
very late gcc versions), the gcc 'malloc' attribute shouldn't make any
difference that I can tell.

But there wouldn't be anything _wrong_ in adding it to kmalloc(), if that's what you're asking.

That's what I'm asking.

Thanks,

Jeff


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/