From 835f8fe9527b826d23b223fb5347ee2c3e670cee Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Fri, 7 Aug 2015 11:45:11 -0700 Subject: [PATCH] staging: comedi: hwdrv_apci1564: remove useless code in apci1564_counter_insn_config() The gate, trig, and ena, bits in the 'ctrl' are cleared at the start of the function. There is no reason clear these bits for each step. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- .../staging/comedi/drivers/addi-data/hwdrv_apci1564.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c index a3e3a34d7e86..a1f4ae19c024 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c @@ -114,24 +114,23 @@ static int apci1564_counter_insn_config(struct comedi_device *dev, /* Set the mode */ ctrl &= ~(ADDI_TCW_CTRL_EXT_CLK_MASK | ADDI_TCW_CTRL_MODE_MASK | - ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG | ADDI_TCW_CTRL_TIMER_ENA | ADDI_TCW_CTRL_RESET_ENA | - ADDI_TCW_CTRL_WARN_ENA | ADDI_TCW_CTRL_ENA); + ADDI_TCW_CTRL_WARN_ENA); ctrl |= ADDI_TCW_CTRL_CNTR_ENA | ADDI_TCW_CTRL_EXT_CLK(data[4]); outl(ctrl, iobase + ADDI_TCW_CTRL_REG); /* Enable or Disable Interrupt */ - ctrl &= ~(ADDI_TCW_CTRL_GATE | ADDI_TCW_CTRL_TRIG | - ADDI_TCW_CTRL_IRQ_ENA); if (data[1]) ctrl |= ADDI_TCW_CTRL_IRQ_ENA; + else + ctrl &= ~ADDI_TCW_CTRL_IRQ_ENA; outl(ctrl, iobase + ADDI_TCW_CTRL_REG); /* Set the Up/Down selection */ - ctrl &= ~(ADDI_TCW_CTRL_CNT_UP | ADDI_TCW_CTRL_GATE | - ADDI_TCW_CTRL_TRIG); if (data[6]) ctrl |= ADDI_TCW_CTRL_CNT_UP; + else + ctrl &= ~ADDI_TCW_CTRL_CNT_UP; outl(ctrl, iobase + ADDI_TCW_CTRL_REG); return insn->n; -- 2.20.1