lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <201208141345.54496.hartleys@visionengravers.com>
Date:	Tue, 14 Aug 2012 13:45:53 -0700
From:	H Hartley Sweeten <hartleys@...ionengravers.com>
To:	Linux Kernel <linux-kernel@...r.kernel.org>
CC:	<devel@...verdev.osuosl.org>, <gregkh@...uxfoundation.org>,
	<abbotti@....co.uk>
Subject: [PATCH] staging: comedi: adl_pci7x3x: fix pointer-to-int-cast warning

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@...ionengravers.com>
Reported-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Ian Abbott <abbotti@....co.uk>
---
 drivers/staging/comedi/drivers/adl_pci7x3x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci7x3x.c b/drivers/staging/comedi/drivers/adl_pci7x3x.c
index 990670a..41963fb 100644
--- a/drivers/staging/comedi/drivers/adl_pci7x3x.c
+++ b/drivers/staging/comedi/drivers/adl_pci7x3x.c
@@ -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];
 
@@ -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);
 
-- 
1.7.11

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ