It's not necessary to clear the returned data pointer when an (*insn_read) times out. For aesthetics, remove all of these in the drivers. Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx> Cc: Ian Abbott <abbotti@xxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/staging/comedi/drivers/adl_pci9111.c | 1 - drivers/staging/comedi/drivers/adl_pci9118.c | 1 - drivers/staging/comedi/drivers/adv_pci1710.c | 1 - drivers/staging/comedi/drivers/dyna_pci10xx.c | 4 +--- drivers/staging/comedi/drivers/icp_multi.c | 5 +---- drivers/staging/comedi/drivers/pcl816.c | 1 - 6 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c b/drivers/staging/comedi/drivers/adl_pci9111.c index 647b2d8..ff086d0 100644 --- a/drivers/staging/comedi/drivers/adl_pci9111.c +++ b/drivers/staging/comedi/drivers/adl_pci9111.c @@ -748,7 +748,6 @@ static int pci9111_ai_insn_read(struct comedi_device *dev, ret = comedi_timeout(dev, s, insn, pci9111_ai_eoc, 0); if (ret) { - data[i] = 0; pci9111_fifo_reset(dev); return ret; } diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c index 9218e92..6ca6c42 100644 --- a/drivers/staging/comedi/drivers/adl_pci9118.c +++ b/drivers/staging/comedi/drivers/adl_pci9118.c @@ -614,7 +614,6 @@ static int pci9118_insn_read_ai(struct comedi_device *dev, ret = comedi_timeout(dev, s, insn, pci9118_ai_eoc, 0); if (ret) { - data[n] = 0; outl(0, dev->iobase + PCI9118_DELFIFO); /* flush FIFO */ return ret; } diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c index 16c4bb0..5978ae6 100644 --- a/drivers/staging/comedi/drivers/adv_pci1710.c +++ b/drivers/staging/comedi/drivers/adv_pci1710.c @@ -469,7 +469,6 @@ static int pci171x_insn_read_ai(struct comedi_device *dev, if (ret) { outb(0, dev->iobase + PCI171x_CLRFIFO); outb(0, dev->iobase + PCI171x_CLRINT); - data[n] = 0; return ret; } diff --git a/drivers/staging/comedi/drivers/dyna_pci10xx.c b/drivers/staging/comedi/drivers/dyna_pci10xx.c index 78d44a9..e5593f8 100644 --- a/drivers/staging/comedi/drivers/dyna_pci10xx.c +++ b/drivers/staging/comedi/drivers/dyna_pci10xx.c @@ -93,10 +93,8 @@ static int dyna_pci10xx_insn_read_ai(struct comedi_device *dev, udelay(10); ret = comedi_timeout(dev, s, insn, dyna_pci10xx_ai_eoc, 0); - if (ret) { - data[n] = 0; + if (ret) break; - } /* read data */ d = inw_p(dev->iobase); diff --git a/drivers/staging/comedi/drivers/icp_multi.c b/drivers/staging/comedi/drivers/icp_multi.c index ee30f2b..0b8b216 100644 --- a/drivers/staging/comedi/drivers/icp_multi.c +++ b/drivers/staging/comedi/drivers/icp_multi.c @@ -215,11 +215,8 @@ static int icp_multi_insn_read_ai(struct comedi_device *dev, /* Wait for conversion to complete, or get fed up waiting */ ret = comedi_timeout(dev, s, insn, icp_multi_ai_eoc, 0); - if (ret) { - /* Clear data received */ - data[n] = 0; + if (ret) break; - } data[n] = (readw(devpriv->io_addr + ICP_MULTI_AI) >> 4) & 0x0fff; diff --git a/drivers/staging/comedi/drivers/pcl816.c b/drivers/staging/comedi/drivers/pcl816.c index 4bf2efb..a35f230 100644 --- a/drivers/staging/comedi/drivers/pcl816.c +++ b/drivers/staging/comedi/drivers/pcl816.c @@ -196,7 +196,6 @@ static int pcl816_ai_insn_read(struct comedi_device *dev, ret = comedi_timeout(dev, s, insn, pcl816_ai_eoc, 0); if (ret) { - data[0] = 0; /* clear INT (conversion end) flag */ outb(0, dev->iobase + PCL816_CLRINT); return ret; -- 1.8.5.2 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel