Re: PATCH 2.3.23.5: physical address typedef

Jes Sorensen (Jes.Sorensen@cern.ch)
22 Oct 1999 00:03:47 +0200


>>>>> "Jeff" == Jeff Garzik <jgarzik@mandrakesoft.com> writes:

Jeff> Linus, Attached is a patch against 2.3.23 pre5 which adds
Jeff> 'kphysaddr_t' type.

Jeff> The idea is to migrate code to using this type to store physical
Jeff> addresses. This will help flag problematic iomap code via a
Jeff> warning -- since a lot of code uses char* instead of long to
Jeff> store physical addresses. Also, IMHO it would be nice if the
Jeff> source code told us it was storing a physical address, via the C
Jeff> type system. (same idea as kdev_t, etc.)

One word: YUCK!

Type typedef's are a pain when there is no real reason for them,
ie. for atomic types and spin locks there is a good reason, for simple
pointers there aren't. The term 'physaddr' referring to things to be
used with ioremap() is just bogus, ioremap takes a bus address not a
physical one.

Addind yet another random typedef just makes the code even more
obfuscated. You will be able to do just as much damage with this new
type as you can do with unsigned long's. Basic rule is that you need
to know what you are doing anyway.

Jes

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