Commit 3b6b25b5ddf4485e89432a35a7d79d371ba6eba1

Authored by Greg Kroah-Hartman
1 parent 2434358ac7

Staging: comedi: range.c: properly mark up __user pointers

This is the start of cleaning up the user pointer markings
in the comedi core.

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 5 changed files with 10 additions and 8 deletions Side-by-side Diff

drivers/staging/comedi/comedi.h
... ... @@ -368,7 +368,7 @@
368 368  
369 369 struct comedi_rangeinfo {
370 370 unsigned int range_type;
371   - void *range_ptr;
  371 + void __user *range_ptr;
372 372 };
373 373  
374 374 struct comedi_krange {
drivers/staging/comedi/comedi_compat32.c
... ... @@ -25,9 +25,8 @@
25 25 */
26 26  
27 27 #define __NO_VERSION__
28   -#include "comedi.h"
29 28 #include <linux/uaccess.h>
30   -
  29 +#include "comedi.h"
31 30 #include "comedi_compat32.h"
32 31  
33 32 #ifdef CONFIG_COMPAT
drivers/staging/comedi/drivers/comedi_bond.c
... ... @@ -87,11 +87,11 @@
87 87 * options that are used with comedi_config.
88 88 */
89 89  
  90 +#include <linux/string.h>
  91 +#include <linux/slab.h>
90 92 #include "../comedi.h"
91 93 #include "../comedilib.h"
92 94 #include "../comedidev.h"
93   -#include <linux/string.h>
94   -#include <linux/slab.h>
95 95  
96 96 /* The maxiumum number of channels per subdevice. */
97 97 #define MAX_CHANS 256
drivers/staging/comedi/internal.h
1 1 /*
2 2 * various internal comedi functions
3 3 */
4   -int do_rangeinfo_ioctl(struct comedi_device *dev, struct comedi_rangeinfo *arg);
  4 +int do_rangeinfo_ioctl(struct comedi_device *dev,
  5 + struct comedi_rangeinfo __user *arg);
5 6 int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s,
6 7 struct comedi_insn *insn, unsigned int *data);
7 8 int comedi_alloc_board_minor(struct device *hardware_device);
drivers/staging/comedi/range.c
... ... @@ -21,8 +21,9 @@
21 21  
22 22 */
23 23  
24   -#include "comedidev.h"
25 24 #include <linux/uaccess.h>
  25 +#include "comedidev.h"
  26 +#include "internal.h"
26 27  
27 28 const struct comedi_lrange range_bipolar10 = { 1, {BIP_RANGE(10)} };
28 29 EXPORT_SYMBOL(range_bipolar10);
... ... @@ -50,7 +51,8 @@
50 51 writes:
51 52 n struct comedi_krange structures to rangeinfo->range_ptr
52 53 */
53   -int do_rangeinfo_ioctl(struct comedi_device *dev, struct comedi_rangeinfo *arg)
  54 +int do_rangeinfo_ioctl(struct comedi_device *dev,
  55 + struct comedi_rangeinfo __user *arg)
54 56 {
55 57 struct comedi_rangeinfo it;
56 58 int subd, chan;