Commit e2154544 authored by Peter Huewe's avatar Peter Huewe Committed by Greg Kroah-Hartman

staging/comedi/adl_pci8164: Don't assign string

Assigning a string is really bad,
and since we only have 1 char strings here we
can simply use a char to store the value and change the format specifier.
Signed-off-by: default avatarPeter Huewe <peterhuewe@gmx.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bc3954b8
...@@ -62,35 +62,35 @@ static void adl_pci8164_insn_read(struct comedi_device *dev, ...@@ -62,35 +62,35 @@ static void adl_pci8164_insn_read(struct comedi_device *dev,
char *action, unsigned short offset) char *action, unsigned short offset)
{ {
int axis, axis_reg; int axis, axis_reg;
char *axisname; char axisname;
axis = CR_CHAN(insn->chanspec); axis = CR_CHAN(insn->chanspec);
switch (axis) { switch (axis) {
case 0: case 0:
axis_reg = PCI8164_AXIS_X; axis_reg = PCI8164_AXIS_X;
axisname = "X"; axisname = 'X';
break; break;
case 1: case 1:
axis_reg = PCI8164_AXIS_Y; axis_reg = PCI8164_AXIS_Y;
axisname = "Y"; axisname = 'Y';
break; break;
case 2: case 2:
axis_reg = PCI8164_AXIS_Z; axis_reg = PCI8164_AXIS_Z;
axisname = "Z"; axisname = 'Z';
break; break;
case 3: case 3:
axis_reg = PCI8164_AXIS_U; axis_reg = PCI8164_AXIS_U;
axisname = "U"; axisname = 'U';
break; break;
default: default:
axis_reg = PCI8164_AXIS_X; axis_reg = PCI8164_AXIS_X;
axisname = "X"; axisname = 'X';
} }
data[0] = inw(dev->iobase + axis_reg + offset); data[0] = inw(dev->iobase + axis_reg + offset);
dev_dbg(dev->class_dev, dev_dbg(dev->class_dev,
"pci8164 %s read -> %04X:%04X on axis %s\n", "pci8164 %s read -> %04X:%04X on axis %c\n",
action, data[0], data[1], axisname); action, data[0], data[1], axisname);
} }
...@@ -142,36 +142,36 @@ static void adl_pci8164_insn_out(struct comedi_device *dev, ...@@ -142,36 +142,36 @@ static void adl_pci8164_insn_out(struct comedi_device *dev,
{ {
unsigned int axis, axis_reg; unsigned int axis, axis_reg;
char *axisname; char axisname;
axis = CR_CHAN(insn->chanspec); axis = CR_CHAN(insn->chanspec);
switch (axis) { switch (axis) {
case 0: case 0:
axis_reg = PCI8164_AXIS_X; axis_reg = PCI8164_AXIS_X;
axisname = "X"; axisname = 'X';
break; break;
case 1: case 1:
axis_reg = PCI8164_AXIS_Y; axis_reg = PCI8164_AXIS_Y;
axisname = "Y"; axisname = 'Y';
break; break;
case 2: case 2:
axis_reg = PCI8164_AXIS_Z; axis_reg = PCI8164_AXIS_Z;
axisname = "Z"; axisname = 'Z';
break; break;
case 3: case 3:
axis_reg = PCI8164_AXIS_U; axis_reg = PCI8164_AXIS_U;
axisname = "U"; axisname = 'U';
break; break;
default: default:
axis_reg = PCI8164_AXIS_X; axis_reg = PCI8164_AXIS_X;
axisname = "X"; axisname = 'X';
} }
outw(data[0], dev->iobase + axis_reg + offset); outw(data[0], dev->iobase + axis_reg + offset);
dev_dbg(dev->class_dev, dev_dbg(dev->class_dev,
"pci8164 %s write -> %04X:%04X on axis %s\n", "pci8164 %s write -> %04X:%04X on axis %c\n",
action, data[0], data[1], axisname); action, data[0], data[1], axisname);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment