[lkml]   [2006]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[RFC] typechecking for get_unaligned/put_unaligned
	What kind of typechecking do we want for those?

AFAICS, current constraints are
* {put,get}_unaligned() should be passed a pointer to object; void *
is not acceptable
* sizeof(*ptr) should be one of 1, 2, 4, 8
* assignment of val to *ptr should be valid C.

a) do we want all of the above to be enforced on all targets?
b) do we really want to allow use of that when sizeof(*ptr) is 1?
It's almost certainly a sloppy code (and I don't see any instances in
the tree), but I might be missing some potentially valid use in macros.
c) how about gradually switching to linux/unaligned.h? In this
case we can do it nicely; start with mutual #include in asm/unaligned.h
and linux/unaligned.h (in the beginning of each), then switch users
and once they'd been all gone for a while, have asm/unaligned.h contain
#error include linux/unaligned.h instead
instead of
#include <linux/unaligned.h>
d) any objections to having asm/unaligned.h defining
__{get,put}_unaligned{2,4,8} and linux/unaligned.h doing __builtin_choose_expr()
to pick the right one? AFAICS, that should not have any bad effects on the
generated code and it would allow to put all typechecking in one place.
Helpers in question would take pointers to u{16,32,64} and value of the
same type. Even the targets doing a simple assignment in all cases would
get the same code generated, AFAICS...
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: 2006-10-17 02:53    [W:0.104 / U:2.408 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site