From dbd446fc7aab519c213e63eefa15c82586a50989 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Mon, 10 Feb 2014 11:49:46 -0700 Subject: [PATCH] staging: comedi: don't clear 'data' on (*insn_read) timeout 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 Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- 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 647b2d814d61..ff086d0eedd9 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 9218e9293cf5..6ca6c429c722 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 16c4bb00022c..5978ae63d804 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 78d44a9c8a71..e5593f8c7406 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 ee30f2b8a54b..0b8b2162b76b 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 4bf2efb2c027..a35f230d1958 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; -- 2.30.2