Commit ecd56ff9 authored by Chase Southwood's avatar Chase Southwood Committed by Greg Kroah-Hartman

Staging: comedi: Correct a few printf format codes

My static checker found some slightly inaccurate format codes in printf
calls in comedi_fops.c and drivers/comedi_bond.c.  It may be slightly
pedantic to change them, but using the correctly corresponding format
codes is probably a good idea.  All but one were unsigned ints that were
formatted with %i, change these to %u, and one was an int formatted with
%u, we want to format this with %d.
Signed-off-by: default avatarChase Southwood <chase.southwood@yahoo.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f1fe476e
...@@ -297,7 +297,7 @@ static ssize_t max_read_buffer_kb_show(struct device *csdev, ...@@ -297,7 +297,7 @@ static ssize_t max_read_buffer_kb_show(struct device *csdev,
mutex_unlock(&dev->mutex); mutex_unlock(&dev->mutex);
comedi_dev_put(dev); comedi_dev_put(dev);
return snprintf(buf, PAGE_SIZE, "%i\n", size); return snprintf(buf, PAGE_SIZE, "%u\n", size);
} }
static ssize_t max_read_buffer_kb_store(struct device *csdev, static ssize_t max_read_buffer_kb_store(struct device *csdev,
...@@ -353,7 +353,7 @@ static ssize_t read_buffer_kb_show(struct device *csdev, ...@@ -353,7 +353,7 @@ static ssize_t read_buffer_kb_show(struct device *csdev,
mutex_unlock(&dev->mutex); mutex_unlock(&dev->mutex);
comedi_dev_put(dev); comedi_dev_put(dev);
return snprintf(buf, PAGE_SIZE, "%i\n", size); return snprintf(buf, PAGE_SIZE, "%u\n", size);
} }
static ssize_t read_buffer_kb_store(struct device *csdev, static ssize_t read_buffer_kb_store(struct device *csdev,
...@@ -410,7 +410,7 @@ static ssize_t max_write_buffer_kb_show(struct device *csdev, ...@@ -410,7 +410,7 @@ static ssize_t max_write_buffer_kb_show(struct device *csdev,
mutex_unlock(&dev->mutex); mutex_unlock(&dev->mutex);
comedi_dev_put(dev); comedi_dev_put(dev);
return snprintf(buf, PAGE_SIZE, "%i\n", size); return snprintf(buf, PAGE_SIZE, "%u\n", size);
} }
static ssize_t max_write_buffer_kb_store(struct device *csdev, static ssize_t max_write_buffer_kb_store(struct device *csdev,
...@@ -466,7 +466,7 @@ static ssize_t write_buffer_kb_show(struct device *csdev, ...@@ -466,7 +466,7 @@ static ssize_t write_buffer_kb_show(struct device *csdev,
mutex_unlock(&dev->mutex); mutex_unlock(&dev->mutex);
comedi_dev_put(dev); comedi_dev_put(dev);
return snprintf(buf, PAGE_SIZE, "%i\n", size); return snprintf(buf, PAGE_SIZE, "%u\n", size);
} }
static ssize_t write_buffer_kb_store(struct device *csdev, static ssize_t write_buffer_kb_store(struct device *csdev,
......
...@@ -211,7 +211,7 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -211,7 +211,7 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it)
return -EINVAL; return -EINVAL;
} }
snprintf(file, sizeof(file), "/dev/comedi%u", minor); snprintf(file, sizeof(file), "/dev/comedi%d", minor);
file[sizeof(file) - 1] = 0; file[sizeof(file) - 1] = 0;
d = comedi_open(file); d = comedi_open(file);
...@@ -264,7 +264,7 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -264,7 +264,7 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it)
char buf[20]; char buf[20];
int left = int left =
MAX_BOARD_NAME - strlen(devpriv->name) - 1; MAX_BOARD_NAME - strlen(devpriv->name) - 1;
snprintf(buf, sizeof(buf), "%d:%d ", snprintf(buf, sizeof(buf), "%u:%u ",
bdev->minor, bdev->subdev); bdev->minor, bdev->subdev);
buf[sizeof(buf) - 1] = 0; buf[sizeof(buf) - 1] = 0;
strncat(devpriv->name, buf, left); strncat(devpriv->name, buf, left);
......
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