lkml.org 
[lkml]   [2001]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: unsigned long ioremap()?
At 8:55 AM +0200 2001-05-03, Geert Uytterhoeven wrote:
>Since you're not allowed to use direct memory dereferencing on ioremapped
>areas, wouldn't it be more logical to let ioremap() return an unsigned long
>instead of a void *?
>
>Of course we then have to change readb() and friends to take a long as well,
>but at least we'd get compiler warnings when someone tries to do a direct
>dereference.

Better yet, seems to me, its own type. Say: typedef unsigned long io_ref_t;

It's already done for dma_addr_t, and this seems like an analogous case.

The bigger job would be to fix all the direct dereferences (a
worthwhile thing, I guess; a quick scan shows at least a few), as
well as to fix uncast assignments of ioremap(). Or ideally to get rid
of the casts (most that I see are casts to unsigned long) and type
the receiving buffer appropriately.

It'd be a big job. And Linus further suggests that ioremap's first
argument is an architecture-specific object, not necessarily either a
physical CPU address or a PCI address (though it's typically both in
many (most?) i386 implementations). Now *there'd* be a cleanup.
--
/Jonathan Lundell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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