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

staging: comedi: ni_660x: Prefer 'unsigned int' to bare use of 'unsigned'

Fix the checkpatch.pl issues.
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 b15f5069
...@@ -299,7 +299,7 @@ enum ni_660x_boardid { ...@@ -299,7 +299,7 @@ enum ni_660x_boardid {
struct ni_660x_board { struct ni_660x_board {
const char *name; const char *name;
unsigned n_chips; /* total number of TIO chips */ unsigned int n_chips; /* total number of TIO chips */
}; };
static const struct ni_660x_board ni_660x_boards[] = { static const struct ni_660x_board ni_660x_boards[] = {
...@@ -337,7 +337,7 @@ struct ni_660x_private { ...@@ -337,7 +337,7 @@ struct ni_660x_private {
spinlock_t mite_channel_lock; spinlock_t mite_channel_lock;
/* interrupt_lock prevents races between interrupt and comedi_poll */ /* interrupt_lock prevents races between interrupt and comedi_poll */
spinlock_t interrupt_lock; spinlock_t interrupt_lock;
unsigned dma_cfg[NI_660X_MAX_NUM_CHIPS]; unsigned int dma_cfg[NI_660X_MAX_NUM_CHIPS];
spinlock_t soft_reg_copy_lock; spinlock_t soft_reg_copy_lock;
unsigned short pfi_output_selects[NUM_PFI_CHANNELS]; unsigned short pfi_output_selects[NUM_PFI_CHANNELS];
}; };
...@@ -533,17 +533,17 @@ static inline struct mite_dma_descriptor_ring *mite_ring(struct ni_660x_private ...@@ -533,17 +533,17 @@ static inline struct mite_dma_descriptor_ring *mite_ring(struct ni_660x_private
struct ni_gpct struct ni_gpct
*counter) *counter)
{ {
unsigned chip = counter->chip_index; unsigned int chip = counter->chip_index;
return priv->mite_rings[chip][counter->counter_index]; return priv->mite_rings[chip][counter->counter_index];
} }
static inline void ni_660x_set_dma_channel(struct comedi_device *dev, static inline void ni_660x_set_dma_channel(struct comedi_device *dev,
unsigned mite_channel, unsigned int mite_channel,
struct ni_gpct *counter) struct ni_gpct *counter)
{ {
struct ni_660x_private *devpriv = dev->private; struct ni_660x_private *devpriv = dev->private;
unsigned chip = counter->chip_index; unsigned int chip = counter->chip_index;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&devpriv->soft_reg_copy_lock, flags); spin_lock_irqsave(&devpriv->soft_reg_copy_lock, flags);
...@@ -558,11 +558,11 @@ static inline void ni_660x_set_dma_channel(struct comedi_device *dev, ...@@ -558,11 +558,11 @@ static inline void ni_660x_set_dma_channel(struct comedi_device *dev,
} }
static inline void ni_660x_unset_dma_channel(struct comedi_device *dev, static inline void ni_660x_unset_dma_channel(struct comedi_device *dev,
unsigned mite_channel, unsigned int mite_channel,
struct ni_gpct *counter) struct ni_gpct *counter)
{ {
struct ni_660x_private *devpriv = dev->private; struct ni_660x_private *devpriv = dev->private;
unsigned chip = counter->chip_index; unsigned int chip = counter->chip_index;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&devpriv->soft_reg_copy_lock, flags); spin_lock_irqsave(&devpriv->soft_reg_copy_lock, flags);
...@@ -642,7 +642,7 @@ static int ni_660x_cancel(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -642,7 +642,7 @@ static int ni_660x_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
static void set_tio_counterswap(struct comedi_device *dev, int chip) static void set_tio_counterswap(struct comedi_device *dev, int chip)
{ {
unsigned bits = 0; unsigned int bits = 0;
/* /*
* See P. 3.5 of the Register-Level Programming manual. * See P. 3.5 of the Register-Level Programming manual.
...@@ -670,7 +670,7 @@ static irqreturn_t ni_660x_interrupt(int irq, void *d) ...@@ -670,7 +670,7 @@ static irqreturn_t ni_660x_interrupt(int irq, void *d)
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct ni_660x_private *devpriv = dev->private; struct ni_660x_private *devpriv = dev->private;
struct comedi_subdevice *s; struct comedi_subdevice *s;
unsigned i; unsigned int i;
unsigned long flags; unsigned long flags;
if (!dev->attached) if (!dev->attached)
...@@ -718,7 +718,7 @@ static int ni_660x_buf_change(struct comedi_device *dev, ...@@ -718,7 +718,7 @@ static int ni_660x_buf_change(struct comedi_device *dev,
static int ni_660x_allocate_private(struct comedi_device *dev) static int ni_660x_allocate_private(struct comedi_device *dev)
{ {
struct ni_660x_private *devpriv; struct ni_660x_private *devpriv;
unsigned i; unsigned int i;
devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv)); devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
if (!devpriv) if (!devpriv)
...@@ -737,8 +737,8 @@ static int ni_660x_alloc_mite_rings(struct comedi_device *dev) ...@@ -737,8 +737,8 @@ static int ni_660x_alloc_mite_rings(struct comedi_device *dev)
{ {
const struct ni_660x_board *board = dev->board_ptr; const struct ni_660x_board *board = dev->board_ptr;
struct ni_660x_private *devpriv = dev->private; struct ni_660x_private *devpriv = dev->private;
unsigned i; unsigned int i;
unsigned j; unsigned int j;
for (i = 0; i < board->n_chips; ++i) { for (i = 0; i < board->n_chips; ++i) {
for (j = 0; j < counters_per_chip; ++j) { for (j = 0; j < counters_per_chip; ++j) {
...@@ -755,8 +755,8 @@ static void ni_660x_free_mite_rings(struct comedi_device *dev) ...@@ -755,8 +755,8 @@ static void ni_660x_free_mite_rings(struct comedi_device *dev)
{ {
const struct ni_660x_board *board = dev->board_ptr; const struct ni_660x_board *board = dev->board_ptr;
struct ni_660x_private *devpriv = dev->private; struct ni_660x_private *devpriv = dev->private;
unsigned i; unsigned int i;
unsigned j; unsigned int j;
for (i = 0; i < board->n_chips; ++i) { for (i = 0; i < board->n_chips; ++i) {
for (j = 0; j < counters_per_chip; ++j) for (j = 0; j < counters_per_chip; ++j)
...@@ -767,7 +767,7 @@ static void ni_660x_free_mite_rings(struct comedi_device *dev) ...@@ -767,7 +767,7 @@ static void ni_660x_free_mite_rings(struct comedi_device *dev)
static void init_tio_chip(struct comedi_device *dev, int chipset) static void init_tio_chip(struct comedi_device *dev, int chipset)
{ {
struct ni_660x_private *devpriv = dev->private; struct ni_660x_private *devpriv = dev->private;
unsigned i; unsigned int i;
/* init dma configuration register */ /* init dma configuration register */
devpriv->dma_cfg[chipset] = 0; devpriv->dma_cfg[chipset] = 0;
...@@ -782,7 +782,7 @@ static int ni_660x_dio_insn_bits(struct comedi_device *dev, ...@@ -782,7 +782,7 @@ static int ni_660x_dio_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn, unsigned int *data)
{ {
unsigned base_bitfield_channel = CR_CHAN(insn->chanspec); unsigned int base_bitfield_channel = CR_CHAN(insn->chanspec);
/* Check if we have to write some bits */ /* Check if we have to write some bits */
if (data[0]) { if (data[0]) {
...@@ -836,8 +836,8 @@ static void ni_660x_select_pfi_output(struct comedi_device *dev, ...@@ -836,8 +836,8 @@ static void ni_660x_select_pfi_output(struct comedi_device *dev,
ni_660x_write(dev, active_chip, bits, NI660X_IO_CFG(chan)); ni_660x_write(dev, active_chip, bits, NI660X_IO_CFG(chan));
} }
static int ni_660x_set_pfi_routing(struct comedi_device *dev, unsigned chan, static int ni_660x_set_pfi_routing(struct comedi_device *dev,
unsigned source) unsigned int chan, unsigned int source)
{ {
struct ni_660x_private *devpriv = dev->private; struct ni_660x_private *devpriv = dev->private;
...@@ -923,8 +923,8 @@ static int ni_660x_auto_attach(struct comedi_device *dev, ...@@ -923,8 +923,8 @@ static int ni_660x_auto_attach(struct comedi_device *dev,
unsigned int n_counters; unsigned int n_counters;
int subdev; int subdev;
int ret; int ret;
unsigned i; unsigned int i;
unsigned global_interrupt_config_bits; unsigned int global_interrupt_config_bits;
if (context < ARRAY_SIZE(ni_660x_boards)) if (context < ARRAY_SIZE(ni_660x_boards))
board = &ni_660x_boards[context]; board = &ni_660x_boards[context];
......
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