Commit c9813d50 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: ni_tio: fix ni_tio_arm() params/vars

As suggested by checkpatch.pl:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

The 'arm' parameter is really a true/false flag. For aesthetics,
change it to a bool.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a4915d54
...@@ -484,11 +484,11 @@ static int ni_tio_set_counter_mode(struct ni_gpct *counter, unsigned mode) ...@@ -484,11 +484,11 @@ static int ni_tio_set_counter_mode(struct ni_gpct *counter, unsigned mode)
return 0; return 0;
} }
int ni_tio_arm(struct ni_gpct *counter, int arm, unsigned start_trigger) int ni_tio_arm(struct ni_gpct *counter, bool arm, unsigned int start_trigger)
{ {
struct ni_gpct_device *counter_dev = counter->counter_dev; struct ni_gpct_device *counter_dev = counter->counter_dev;
unsigned cidx = counter->counter_index; unsigned int cidx = counter->counter_index;
unsigned command_transient_bits = 0; unsigned int command_transient_bits = 0;
if (arm) { if (arm) {
switch (start_trigger) { switch (start_trigger) {
...@@ -502,8 +502,8 @@ int ni_tio_arm(struct ni_gpct *counter, int arm, unsigned start_trigger) ...@@ -502,8 +502,8 @@ int ni_tio_arm(struct ni_gpct *counter, int arm, unsigned start_trigger)
break; break;
} }
if (ni_tio_counting_mode_registers_present(counter_dev)) { if (ni_tio_counting_mode_registers_present(counter_dev)) {
unsigned bits = 0; unsigned int bits = 0;
unsigned sel_mask; unsigned int sel_mask;
sel_mask = GI_HW_ARM_SEL_MASK(counter_dev->variant); sel_mask = GI_HW_ARM_SEL_MASK(counter_dev->variant);
...@@ -1180,9 +1180,9 @@ int ni_tio_insn_config(struct comedi_device *dev, ...@@ -1180,9 +1180,9 @@ int ni_tio_insn_config(struct comedi_device *dev,
case INSN_CONFIG_SET_COUNTER_MODE: case INSN_CONFIG_SET_COUNTER_MODE:
return ni_tio_set_counter_mode(counter, data[1]); return ni_tio_set_counter_mode(counter, data[1]);
case INSN_CONFIG_ARM: case INSN_CONFIG_ARM:
return ni_tio_arm(counter, 1, data[1]); return ni_tio_arm(counter, true, data[1]);
case INSN_CONFIG_DISARM: case INSN_CONFIG_DISARM:
ni_tio_arm(counter, 0, 0); ni_tio_arm(counter, false, 0);
return 0; return 0;
case INSN_CONFIG_GET_COUNTER_STATUS: case INSN_CONFIG_GET_COUNTER_STATUS:
data[1] = 0; data[1] = 0;
......
...@@ -244,7 +244,7 @@ static inline unsigned ni_tio_get_soft_copy(const struct ni_gpct *counter, ...@@ -244,7 +244,7 @@ static inline unsigned ni_tio_get_soft_copy(const struct ni_gpct *counter,
return value; return value;
} }
int ni_tio_arm(struct ni_gpct *counter, int arm, unsigned start_trigger); int ni_tio_arm(struct ni_gpct *, bool arm, unsigned int start_trigger);
int ni_tio_set_gate_src(struct ni_gpct *, unsigned int gate, unsigned int src); int ni_tio_set_gate_src(struct ni_gpct *, unsigned int gate, unsigned int src);
#endif /* _COMEDI_NI_TIO_INTERNAL_H */ #endif /* _COMEDI_NI_TIO_INTERNAL_H */
...@@ -103,7 +103,7 @@ static int ni_tio_input_inttrig(struct comedi_device *dev, ...@@ -103,7 +103,7 @@ static int ni_tio_input_inttrig(struct comedi_device *dev,
spin_unlock_irqrestore(&counter->lock, flags); spin_unlock_irqrestore(&counter->lock, flags);
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = ni_tio_arm(counter, 1, NI_GPCT_ARM_IMMEDIATE); ret = ni_tio_arm(counter, true, NI_GPCT_ARM_IMMEDIATE);
s->async->inttrig = NULL; s->async->inttrig = NULL;
return ret; return ret;
...@@ -143,9 +143,9 @@ static int ni_tio_input_cmd(struct comedi_subdevice *s) ...@@ -143,9 +143,9 @@ static int ni_tio_input_cmd(struct comedi_subdevice *s)
mite_dma_arm(counter->mite_chan); mite_dma_arm(counter->mite_chan);
if (cmd->start_src == TRIG_NOW) if (cmd->start_src == TRIG_NOW)
ret = ni_tio_arm(counter, 1, NI_GPCT_ARM_IMMEDIATE); ret = ni_tio_arm(counter, true, NI_GPCT_ARM_IMMEDIATE);
else if (cmd->start_src == TRIG_EXT) else if (cmd->start_src == TRIG_EXT)
ret = ni_tio_arm(counter, 1, cmd->start_arg); ret = ni_tio_arm(counter, true, cmd->start_arg);
} }
return ret; return ret;
} }
...@@ -292,7 +292,7 @@ int ni_tio_cancel(struct ni_gpct *counter) ...@@ -292,7 +292,7 @@ int ni_tio_cancel(struct ni_gpct *counter)
unsigned cidx = counter->counter_index; unsigned cidx = counter->counter_index;
unsigned long flags; unsigned long flags;
ni_tio_arm(counter, 0, 0); ni_tio_arm(counter, false, 0);
spin_lock_irqsave(&counter->lock, flags); spin_lock_irqsave(&counter->lock, flags);
if (counter->mite_chan) if (counter->mite_chan)
mite_dma_disarm(counter->mite_chan); mite_dma_disarm(counter->mite_chan);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment