diff options
author | Peter Huewe <peterhuewe@gmx.de> | 2013-01-29 00:36:39 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-29 23:11:41 -0500 |
commit | e21545449b2b96775065f237063a224fff21ed9d (patch) | |
tree | 986d0cd202cbb9f84f091d4e8af5b1082873c8f3 | |
parent | bc3954b8147402e4495378d982cc8e708703a0f1 (diff) |
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: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/comedi/drivers/adl_pci8164.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/staging/comedi/drivers/adl_pci8164.c b/drivers/staging/comedi/drivers/adl_pci8164.c index bfa71e07af1f..ece84dd3aa6c 100644 --- a/drivers/staging/comedi/drivers/adl_pci8164.c +++ b/drivers/staging/comedi/drivers/adl_pci8164.c @@ -62,35 +62,35 @@ static void adl_pci8164_insn_read(struct comedi_device *dev, char *action, unsigned short offset) { int axis, axis_reg; - char *axisname; + char axisname; axis = CR_CHAN(insn->chanspec); switch (axis) { case 0: axis_reg = PCI8164_AXIS_X; - axisname = "X"; + axisname = 'X'; break; case 1: axis_reg = PCI8164_AXIS_Y; - axisname = "Y"; + axisname = 'Y'; break; case 2: axis_reg = PCI8164_AXIS_Z; - axisname = "Z"; + axisname = 'Z'; break; case 3: axis_reg = PCI8164_AXIS_U; - axisname = "U"; + axisname = 'U'; break; default: axis_reg = PCI8164_AXIS_X; - axisname = "X"; + axisname = 'X'; } data[0] = inw(dev->iobase + axis_reg + offset); 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); } @@ -142,36 +142,36 @@ static void adl_pci8164_insn_out(struct comedi_device *dev, { unsigned int axis, axis_reg; - char *axisname; + char axisname; axis = CR_CHAN(insn->chanspec); switch (axis) { case 0: axis_reg = PCI8164_AXIS_X; - axisname = "X"; + axisname = 'X'; break; case 1: axis_reg = PCI8164_AXIS_Y; - axisname = "Y"; + axisname = 'Y'; break; case 2: axis_reg = PCI8164_AXIS_Z; - axisname = "Z"; + axisname = 'Z'; break; case 3: axis_reg = PCI8164_AXIS_U; - axisname = "U"; + axisname = 'U'; break; default: axis_reg = PCI8164_AXIS_X; - axisname = "X"; + axisname = 'X'; } outw(data[0], dev->iobase + axis_reg + offset); 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); } |