Skip to content

Commit

Permalink
staging: comedi: adl_pci8164: remove buggy dev_dbg()
Browse files Browse the repository at this point in the history
The dev_dbg() messages in the adl_pci8164_insn_{read,out} functions
output the 'data' that was read/write to the device. Two 'data' values
are always printed, data[0] and data[1].

The 'data' pointer points to an array of unsigned int values. The number
of values in the array is indicated by insn->n. The number of data
elements is never checked so the dev_dbg() could be trying to access
a 'data' element that is invalid.

Instead of fixing the dev_dbg() just remove them. They are really just
added noise.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
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 Mar 11, 2013
1 parent 42169e2 commit fff7a2c
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions drivers/staging/comedi/drivers/adl_pci8164.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,36 +64,27 @@ static void adl_pci8164_insn_read(struct comedi_device *dev,
char *action, unsigned short offset)
{
int axis, axis_reg;
char axisname;

axis = CR_CHAN(insn->chanspec);

switch (axis) {
case 0:
axis_reg = PCI8164_AXIS_X;
axisname = 'X';
break;
case 1:
axis_reg = PCI8164_AXIS_Y;
axisname = 'Y';
break;
case 2:
axis_reg = PCI8164_AXIS_Z;
axisname = 'Z';
break;
case 3:
axis_reg = PCI8164_AXIS_U;
axisname = 'U';
break;
default:
axis_reg = PCI8164_AXIS_X;
axisname = 'X';
}

data[0] = inw(dev->iobase + axis_reg + offset);
dev_dbg(dev->class_dev,
"pci8164 %s read -> %04X:%04X on axis %c\n",
action, data[0], data[1], axisname);
}

static int adl_pci8164_insn_read_msts(struct comedi_device *dev,
Expand Down Expand Up @@ -144,38 +135,26 @@ static void adl_pci8164_insn_out(struct comedi_device *dev,
{
unsigned int axis, axis_reg;

char axisname;

axis = CR_CHAN(insn->chanspec);

switch (axis) {
case 0:
axis_reg = PCI8164_AXIS_X;
axisname = 'X';
break;
case 1:
axis_reg = PCI8164_AXIS_Y;
axisname = 'Y';
break;
case 2:
axis_reg = PCI8164_AXIS_Z;
axisname = 'Z';
break;
case 3:
axis_reg = PCI8164_AXIS_U;
axisname = 'U';
break;
default:
axis_reg = PCI8164_AXIS_X;
axisname = 'X';
}

outw(data[0], dev->iobase + axis_reg + offset);

dev_dbg(dev->class_dev,
"pci8164 %s write -> %04X:%04X on axis %c\n",
action, data[0], data[1], axisname);

}

static int adl_pci8164_insn_write_cmd(struct comedi_device *dev,
Expand Down

0 comments on commit fff7a2c

Please sign in to comment.