[lkml]   [2003]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: virt_to_offset()

Yoshifuji> In article <> (at
Yoshifuji> Sun, 10 Aug 2003 01:30:41 -0700), "David S. Miller"
Yoshifuji> <> says:
>> > BTW, we spread ((long) ptr & ~PAGE_MASK); it seems ugly. > Why
>> don't we have vert_to_offset(ptr) or something like this? >
>> #define virt_to_offset(ptr) ((unsigned long) (ptr) & ~PAGE_MASK)
>> > Is this bad idea?

>> With some name like "virt_to_pageoff()" it sounds like a great
>> idea.

Yoshifuji> Okay. How about this? (I'm going to do the actual
Yoshifuji> conversion soon.)

It's a bad choice of name. X_to_Y() normally implies that X and Y are
basically different representations of the same thing (e.g., a page
pointer vs. a virtual address). However, virt_to_pageoff() is a
one-way translation, so it's misleading. In my opinion, it should be
called page_offset() or something like that.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:47    [W:0.154 / U:0.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site