From c9813d50a514b451c4ad3acf1f5a400fff005c70 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Wed, 23 Mar 2016 15:36:40 -0700 Subject: [PATCH] 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: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_tio.c | 14 +++++++------- drivers/staging/comedi/drivers/ni_tio_internal.h | 2 +- drivers/staging/comedi/drivers/ni_tiocmd.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_tio.c b/drivers/staging/comedi/drivers/ni_tio.c index abbc8b7a7092..35596b1a075c 100644 --- a/drivers/staging/comedi/drivers/ni_tio.c +++ b/drivers/staging/comedi/drivers/ni_tio.c @@ -484,11 +484,11 @@ static int ni_tio_set_counter_mode(struct ni_gpct *counter, unsigned mode) 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; - unsigned cidx = counter->counter_index; - unsigned command_transient_bits = 0; + unsigned int cidx = counter->counter_index; + unsigned int command_transient_bits = 0; if (arm) { switch (start_trigger) { @@ -502,8 +502,8 @@ int ni_tio_arm(struct ni_gpct *counter, int arm, unsigned start_trigger) break; } if (ni_tio_counting_mode_registers_present(counter_dev)) { - unsigned bits = 0; - unsigned sel_mask; + unsigned int bits = 0; + unsigned int sel_mask; sel_mask = GI_HW_ARM_SEL_MASK(counter_dev->variant); @@ -1180,9 +1180,9 @@ int ni_tio_insn_config(struct comedi_device *dev, case INSN_CONFIG_SET_COUNTER_MODE: return ni_tio_set_counter_mode(counter, data[1]); case INSN_CONFIG_ARM: - return ni_tio_arm(counter, 1, data[1]); + return ni_tio_arm(counter, true, data[1]); case INSN_CONFIG_DISARM: - ni_tio_arm(counter, 0, 0); + ni_tio_arm(counter, false, 0); return 0; case INSN_CONFIG_GET_COUNTER_STATUS: data[1] = 0; diff --git a/drivers/staging/comedi/drivers/ni_tio_internal.h b/drivers/staging/comedi/drivers/ni_tio_internal.h index ee02b36aa51d..1e9163304692 100644 --- a/drivers/staging/comedi/drivers/ni_tio_internal.h +++ b/drivers/staging/comedi/drivers/ni_tio_internal.h @@ -244,7 +244,7 @@ static inline unsigned ni_tio_get_soft_copy(const struct ni_gpct *counter, 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); #endif /* _COMEDI_NI_TIO_INTERNAL_H */ diff --git a/drivers/staging/comedi/drivers/ni_tiocmd.c b/drivers/staging/comedi/drivers/ni_tiocmd.c index 823e47910004..0546a55b7277 100644 --- a/drivers/staging/comedi/drivers/ni_tiocmd.c +++ b/drivers/staging/comedi/drivers/ni_tiocmd.c @@ -103,7 +103,7 @@ static int ni_tio_input_inttrig(struct comedi_device *dev, spin_unlock_irqrestore(&counter->lock, flags); if (ret < 0) 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; return ret; @@ -143,9 +143,9 @@ static int ni_tio_input_cmd(struct comedi_subdevice *s) mite_dma_arm(counter->mite_chan); 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) - ret = ni_tio_arm(counter, 1, cmd->start_arg); + ret = ni_tio_arm(counter, true, cmd->start_arg); } return ret; } @@ -292,7 +292,7 @@ int ni_tio_cancel(struct ni_gpct *counter) unsigned cidx = counter->counter_index; unsigned long flags; - ni_tio_arm(counter, 0, 0); + ni_tio_arm(counter, false, 0); spin_lock_irqsave(&counter->lock, flags); if (counter->mite_chan) mite_dma_disarm(counter->mite_chan); -- 2.39.5