Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52070660 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: remove unneeded sanity check in insn_bits functions



The comedi core does the sanity check to make sure that the data length
the INSN_BITS instruction is 2. There is no need for the drivers to do
this check. Remove all the sanity checks in the drivers.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 60ff4610
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -139,9 +139,6 @@ static int subdev_8255_insn(struct comedi_device *dev,
	unsigned int bits;
	unsigned int v;

	if (insn->n != 2)
		return -EINVAL;

	mask = data[0];
	bits = data[1];

+0 −6
Original line number Diff line number Diff line
@@ -31,9 +31,6 @@ static int acl7225b_do_insn(struct comedi_device *dev,
			    struct comedi_subdevice *s,
			    struct comedi_insn *insn, unsigned int *data)
{
	if (insn->n != 2)
		return -EINVAL;

	if (data[0]) {
		s->state &= ~data[0];
		s->state |= (data[0] & data[1]);
@@ -53,9 +50,6 @@ static int acl7225b_di_insn(struct comedi_device *dev,
			    struct comedi_subdevice *s,
			    struct comedi_insn *insn, unsigned int *data)
{
	if (insn->n != 2)
		return -EINVAL;

	data[1] = inb(dev->iobase + (unsigned long)s->private) |
	    (inb(dev->iobase + (unsigned long)s->private + 1) << 8);

+0 −2
Original line number Diff line number Diff line
@@ -141,8 +141,6 @@ static int pci6208_ao_rinsn(struct comedi_device *dev,
 *					struct comedi_subdevice *s, */
/* struct comedi_insn *insn,unsigned int *data) */
/* { */
/* if(insn->n!=2)return -EINVAL; */

	/* The insn data is a mask in data[0] and the new data
	 * in data[1], each channel cooresponding to a bit. */
/* if(data[0]){ */
+0 −6
Original line number Diff line number Diff line
@@ -54,9 +54,6 @@ static int adl_pci7230_do_insn_bits(struct comedi_device *dev,
	struct comedi_insn *insn,
	unsigned int *data)
{
	if (insn->n != 2)
		return -EINVAL;

	if (data[0]) {
		s->state &= ~data[0];
		s->state |= (data[0] & data[1]);
@@ -72,9 +69,6 @@ static int adl_pci7230_di_insn_bits(struct comedi_device *dev,
	struct comedi_insn *insn,
	unsigned int *data)
{
	if (insn->n != 2)
		return -EINVAL;

	data[1] = inl(dev->iobase + PCI7230_DI) & 0xffffffff;

	return 2;
+0 −6
Original line number Diff line number Diff line
@@ -57,9 +57,6 @@ static int adl_pci7432_do_insn_bits(struct comedi_device *dev,
	printk(KERN_DEBUG "comedi: pci7432_do_insn_bits called\n");
	printk(KERN_DEBUG "comedi: data0: %8x data1: %8x\n", data[0], data[1]);

	if (insn->n != 2)
		return -EINVAL;

	if (data[0]) {
		s->state &= ~data[0];
		s->state |= (data[0] & data[1]);
@@ -79,9 +76,6 @@ static int adl_pci7432_di_insn_bits(struct comedi_device *dev,
	printk(KERN_DEBUG "comedi: pci7432_di_insn_bits called\n");
	printk(KERN_DEBUG "comedi: data0: %8x data1: %8x\n", data[0], data[1]);

	if (insn->n != 2)
		return -EINVAL;

	data[1] = inl(dev->iobase + PCI7432_DI) & 0xffffffff;
	printk(KERN_DEBUG "comedi: data1 %8x\n", data[1]);

Loading