Skip to content

Commit

Permalink
staging: comedi: adl_pci7x3x: fix pointer-to-int-cast warning
Browse files Browse the repository at this point in the history
This driver uses the void *private variable in the comedi_subdevice
to pass the offset needed to read/write the appropriate register to
get/set the channels for the subdevice.

The adl_pci7x3x_do_insn_bits() and adl_pci7x3x_di_insn_bits() functions
were retrieving this offset by casting the s->private value as an
unsigned int. On 64-bit builds this results in a warning:

warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

Fix these warnings by casting the void * to an unsigned long.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Aug 14, 2012
1 parent 9291975 commit 69af599
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/comedi/drivers/adl_pci7x3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static int adl_pci7x3x_do_insn_bits(struct comedi_device *dev,
struct comedi_insn *insn,
unsigned int *data)
{
unsigned int reg = (unsigned int)s->private;
unsigned long reg = (unsigned long)s->private;
unsigned int mask = data[0];
unsigned int bits = data[1];

Expand All @@ -147,7 +147,7 @@ static int adl_pci7x3x_di_insn_bits(struct comedi_device *dev,
struct comedi_insn *insn,
unsigned int *data)
{
unsigned int reg = (unsigned int)s->private;
unsigned long reg = (unsigned long)s->private;

data[1] = inl(dev->iobase + reg);

Expand Down

0 comments on commit 69af599

Please sign in to comment.