summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorColin Ian King2017-11-07 20:07:24 +0100
committerGreg Kroah-Hartman2017-11-27 09:20:40 +0100
commitbc4eec76e66ec5c53b93f9ee0b0a1689f7307ce5 (patch)
tree340472fe017634a04aae604026ff805448356de8 /drivers/staging
parentstaging: speakup: selection: replace _manual_ swap with swap macro (diff)
downloadkernel-qcow2-linux-bc4eec76e66ec5c53b93f9ee0b0a1689f7307ce5.tar.gz
kernel-qcow2-linux-bc4eec76e66ec5c53b93f9ee0b0a1689f7307ce5.tar.xz
kernel-qcow2-linux-bc4eec76e66ec5c53b93f9ee0b0a1689f7307ce5.zip
staging: comedi: usbdux: remove redundant initialization of val
The early initialization of val is redundant as the value is never read and is updated inside a for-loop. Remove the initialization and move the declaration and initialization to the for-loop scope. Cleans up clang warning: drivers/staging/comedi/drivers/usbdux.c:812:15: warning: Value stored to 'val' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/comedi/drivers/usbdux.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers/usbdux.c b/drivers/staging/comedi/drivers/usbdux.c
index f4f05d29d30d..ede064b47aac 100644
--- a/drivers/staging/comedi/drivers/usbdux.c
+++ b/drivers/staging/comedi/drivers/usbdux.c
@@ -809,7 +809,6 @@ static int usbdux_ao_insn_write(struct comedi_device *dev,
{
struct usbdux_private *devpriv = dev->private;
unsigned int chan = CR_CHAN(insn->chanspec);
- unsigned int val = s->readback[chan];
__le16 *p = (__le16 *)&devpriv->dux_commands[2];
int ret = -EBUSY;
int i;
@@ -825,7 +824,7 @@ static int usbdux_ao_insn_write(struct comedi_device *dev,
devpriv->dux_commands[4] = chan << 6;
for (i = 0; i < insn->n; i++) {
- val = data[i];
+ unsigned int val = data[i];
/* one 16 bit value */
*p = cpu_to_le16(val);