Re: [PATCH] HPET driver

From: Jeff Garzik
Date: Mon May 17 2004 - 18:21:38 EST


Andrew Morton wrote:
+static inline u64 readq(void *addr)
+{
+ return readl(addr) | (((u64)readl(addr + 4)) << 32);
+}
+
+static inline void writeq(u64 v, void *addr)
+{
+ writel(v & 0xffffffff, addr);
+ writel(v >> 32, addr + 4);
+}


Seems sane, though I wonder about two things:

* better home is probably asm-generic

* It seems to me that a poorly-written writel() macro might prefer some guarantee that it's argument is pre-cast to u32. I dunno if this is just paranoia or not.


-
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/