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]
Date:	Wed, 13 Jun 2012 15:42:39 -0700
From:	H Hartley Sweeten <hartleys@...ionengravers.com>
To:	Linux Kernel <linux-kernel@...r.kernel.org>
CC:	<devel@...verdev.osuosl.org>, <abbotti@....co.uk>,
	<fmhess@...rs.sourceforge.net>, <gregkh@...uxfoundation.org>
Subject: [PATCH 11/15] staging: comedi: 8255: use a local variable for the iobase

To improve readability, use a locale variable to hold the 8255's
private iobase value.

Signed-off-by: H Hartley Sweeten <hsweeten@...ionengravers.com>
Cc: Ian Abbott <abbotti@....co.uk>
Cc: Frank Mori Hess <fmhess@...rs.sourceforge.net>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
 drivers/staging/comedi/drivers/8255.c |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/comedi/drivers/8255.c b/drivers/staging/comedi/drivers/8255.c
index f6ea493..1f4b24c 100644
--- a/drivers/staging/comedi/drivers/8255.c
+++ b/drivers/staging/comedi/drivers/8255.c
@@ -106,10 +106,11 @@ void subdev_8255_interrupt(struct comedi_device *dev,
 			   struct comedi_subdevice *s)
 {
 	struct subdev_8255_private *spriv = s->private;
+	unsigned long iobase = spriv->iobase;
 	short d;
 
-	d = spriv->io(0, _8255_DATA, 0, spriv->iobase);
-	d |= (spriv->io(0, _8255_DATA + 1, 0, spriv->iobase) << 8);
+	d = spriv->io(0, _8255_DATA, 0, iobase);
+	d |= (spriv->io(0, _8255_DATA + 1, 0, iobase) << 8);
 
 	comedi_buf_put(s->async, d);
 	s->async->events |= COMEDI_CB_EOS;
@@ -133,25 +134,25 @@ static int subdev_8255_insn(struct comedi_device *dev,
 			    struct comedi_insn *insn, unsigned int *data)
 {
 	struct subdev_8255_private *spriv = s->private;
+	unsigned long iobase = spriv->iobase;
 
 	if (data[0]) {
 		s->state &= ~data[0];
 		s->state |= (data[0] & data[1]);
 
 		if (data[0] & 0xff)
-			spriv->io(1, _8255_DATA, s->state & 0xff,
-				  spriv->iobase);
+			spriv->io(1, _8255_DATA, s->state & 0xff, iobase);
 		if (data[0] & 0xff00)
 			spriv->io(1, _8255_DATA + 1,
-				  (s->state >> 8) & 0xff, spriv->iobase);
+				  (s->state >> 8) & 0xff, iobase);
 		if (data[0] & 0xff0000)
 			spriv->io(1, _8255_DATA + 2,
-				  (s->state >> 16) & 0xff, spriv->iobase);
+				  (s->state >> 16) & 0xff, iobase);
 	}
 
-	data[1] = spriv->io(0, _8255_DATA, 0, spriv->iobase);
-	data[1] |= (spriv->io(0, _8255_DATA + 1, 0, spriv->iobase) << 8);
-	data[1] |= (spriv->io(0, _8255_DATA + 2, 0, spriv->iobase) << 16);
+	data[1] = spriv->io(0, _8255_DATA, 0, iobase);
+	data[1] |= (spriv->io(0, _8255_DATA + 1, 0, iobase) << 8);
+	data[1] |= (spriv->io(0, _8255_DATA + 2, 0, iobase) << 16);
 
 	return 2;
 }
@@ -159,6 +160,7 @@ static int subdev_8255_insn(struct comedi_device *dev,
 static void do_config(struct comedi_device *dev, struct comedi_subdevice *s)
 {
 	struct subdev_8255_private *spriv = s->private;
+	unsigned long iobase = spriv->iobase;
 	int config;
 
 	config = CR_CW;
@@ -171,7 +173,8 @@ static void do_config(struct comedi_device *dev, struct comedi_subdevice *s)
 		config |= CR_C_LO_IO;
 	if (!(s->io_bits & 0xf00000))
 		config |= CR_C_HI_IO;
-	spriv->io(1, _8255_CR, config, spriv->iobase);
+
+	spriv->io(1, _8255_CR, config, iobase);
 }
 
 static int subdev_8255_insn_config(struct comedi_device *dev,
-- 
1.7.7

--
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