linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] typechecking for get_unaligned/put_unaligned
@ 2006-10-17  0:50 Al Viro
  2006-10-17  1:50 ` Linus Torvalds
  2006-10-17  9:04 ` David Howells
  0 siblings, 2 replies; 54+ messages in thread
From: Al Viro @ 2006-10-17  0:50 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, linux-arch

	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.

Questions:
	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
#ifndef __LINUX_UNALGINED_H__
#error include linux/unaligned.h instead
#endif
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...

^ permalink raw reply	[flat|nested] 54+ messages in thread
* dealing with excessive includes
@ 2006-10-30 10:45 Al Viro
  0 siblings, 0 replies; 54+ messages in thread
From: Al Viro @ 2006-10-30 10:45 UTC (permalink / raw)
  To: linux-arch; +Cc: linux-kernel, torvalds

	Patches follow.  Again, it's still preliminary and needs more
testing.  The good thing is that if it's broken it simply won't build.

	All that stuff is going after low-hanging fruits and it gives
one hell of dependency counts reduction for widely used headers.

	Enjoy.

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

end of thread, other threads:[~2006-10-30 10:45 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-17  0:50 [RFC] typechecking for get_unaligned/put_unaligned Al Viro
2006-10-17  1:50 ` Linus Torvalds
2006-10-17  4:37   ` Al Viro
2006-10-17 15:24     ` Linus Torvalds
2006-10-18  4:40       ` dealing with excessive includes Al Viro
2006-10-18  9:19         ` Alexey Dobriyan
2006-10-18  9:31           ` Al Viro
2006-10-18 10:00             ` Alexey Dobriyan
2006-10-18 17:42               ` Al Viro
2006-10-18 21:48                 ` Alexey Dobriyan
2006-10-18 15:04             ` Linus Torvalds
2006-10-18 15:13               ` Matthew Wilcox
2006-10-18 16:06               ` Al Viro
2006-10-18 16:32                 ` Linus Torvalds
2006-10-18 17:44                   ` Al Viro
2006-10-19 16:23                   ` Al Viro
2006-10-19 18:24                   ` Andreas Gruenbacher
2006-10-20  0:53                   ` Al Viro
2006-10-20  0:57                     ` Al Viro
2006-10-20 12:43                       ` Matthew Wilcox
2006-10-20  0:58                     ` Al Viro
2006-10-20  0:59                     ` Al Viro
2006-10-20  1:02                     ` Al Viro
2006-10-20  4:35                     ` Randy Dunlap
2006-10-20  9:26                       ` Stefan Richter
2006-10-20 16:13                         ` Randy Dunlap
2006-10-20 17:51                           ` Stefan Richter
2006-10-22 17:58                           ` Geert Uytterhoeven
2006-10-22 22:59                             ` Andi Kleen
2006-10-23  8:29                               ` Geert Uytterhoeven
2006-10-23 16:09                                 ` Linus Torvalds
2006-10-23 16:13                                   ` Geert Uytterhoeven
2006-10-23 16:31                                     ` Linus Torvalds
2006-10-23 16:52                                       ` Geert Uytterhoeven
2006-10-23 17:05                                         ` Linus Torvalds
2006-10-23  0:31                             ` Matthew Wilcox
2006-10-23  0:42                               ` Andi Kleen
2006-10-23  1:08                                 ` Matthew Wilcox
2006-10-23  1:31                                   ` Andi Kleen
2006-10-23  1:36                                     ` Matthew Wilcox
2006-10-23  1:41                                       ` Andi Kleen
2006-10-23  8:34                                         ` Geert Uytterhoeven
2006-10-23  1:48                                       ` Randy Dunlap
2006-10-23  1:49                                       ` Nick Piggin
2006-10-23  6:34                                         ` Stefan Richter
2006-10-18 16:15               ` Jan Engelhardt
2006-10-18 16:21                 ` Matthew Wilcox
2006-10-18  5:42     ` [RFC] typechecking for get_unaligned/put_unaligned Dave Jones
2006-10-18  6:05       ` Al Viro
2006-10-19 16:52         ` Denis Vlasenko
2006-10-19 16:58           ` Al Viro
2006-10-17  9:04 ` David Howells
2006-10-17 15:28   ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2006-10-30 10:45 dealing with excessive includes Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).