Skip to content

Commit

Permalink
iio:magnetometer:mag3110: Fix output of decimal digits in show_int_pl…
Browse files Browse the repository at this point in the history
…us_micros()

need to print leading zeros, hence "%d.%06d"

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Peter Meerwald authored and Jonathan Cameron committed Feb 8, 2014
1 parent f25330f commit 71bd894
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/magnetometer/mag3110.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static ssize_t mag3110_show_int_plus_micros(char *buf,

while (n-- > 0)
len += scnprintf(buf + len, PAGE_SIZE - len,
"%d.%d ", vals[n][0], vals[n][1]);
"%d.%06d ", vals[n][0], vals[n][1]);

/* replace trailing space by newline */
buf[len - 1] = '\n';
Expand Down

0 comments on commit 71bd894

Please sign in to comment.