All of lore.kernel.org
 help / color / mirror / Atom feed
* generic memory addresses
@ 2017-04-06  0:31 Tobin C. Harding
  2017-04-06  6:08 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Tobin C. Harding @ 2017-04-06  0:31 UTC (permalink / raw)
  To: kernelnewbies

Why is there code in-tree that declares generic memory addresses as
unsigned int?

Linux Device Drivers 3rd Edition page 289
 Therefore, generic memory addresses in the kernel are usually unsigned
 long, exploiting the fact that pointers and long integers are always
 the same size, at least on all the platforms currently supported by
 Linux.

It would therefore seem like a bug to declare a generic memory address
as an unsigned int in code that can run on 64 bit machines.

What is the explanation for such declarations in the kernel please?

$ cd KERNEL_TREE
$ git grep 'unsigned int addr' | wc -l
556

thanks,
Tobin.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-06 22:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-06  0:31 generic memory addresses Tobin C. Harding
2017-04-06  6:08 ` Greg KH
2017-04-06 10:11   ` Tobin C. Harding
2017-04-06 16:59     ` Greg KH
2017-04-06 22:02       ` Tobin C. Harding

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.