All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] proper casting (if any) in copy_to_user() calls?
@ 2007-01-05 13:54 Robert P. J. Day
  2007-01-06  6:31 ` Ahmed S. Darwish
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Robert P. J. Day @ 2007-01-05 13:54 UTC (permalink / raw)
  To: kernel-janitors


  if you run the following recursive search:

  $ grep -Er "copy_to_user ?\( ?\(" * | less

you'll notice that numerous calls to copy_to_user() insist on casting
the pointer type of the first argument, despite the fact that that
first pointer is declared as being of type "void __user *" for the
routine itself, so it would seem no pointer is casting is required.

  and yet, you can see that calls to copy_to_user() are casting the
first argument to (among other types) "char *" and "char __user *" and
"void *" and "void __user *" and "unsigned long *" and ... well, you
get the idea.  (the same can be said for the second argument to
copy_from_user().)

  what is the proper rule for casting in this situation?  one would
think most of those casts are totally superfluous, no?

rday
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2007-01-08 16:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-05 13:54 [KJ] proper casting (if any) in copy_to_user() calls? Robert P. J. Day
2007-01-06  6:31 ` Ahmed S. Darwish
2007-01-06  7:47 ` Jaco Kroon
2007-01-06  8:23 ` Robert P. J. Day
2007-01-06  9:07 ` Robert P. J. Day
2007-01-06 11:32 ` Jaco Kroon
2007-01-08 13:11 ` Thomas Petazzoni
2007-01-08 16:15 ` Jaco Kroon

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.