Re: [PATCH 2/5] iio:magnetometer:mag3110: Fix output of decimal digits in show_int_plus_micros()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/01/14 21:59, Peter Meerwald wrote:
need to print leading zeros, hence "%d.%06d"

Signed-off-by: Peter Meerwald <pmeerw@xxxxxxxxxx>
Applied to the fixes-for-3.14new branch of iio.git

Thanks,
---
  drivers/iio/magnetometer/mag3110.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/magnetometer/mag3110.c b/drivers/iio/magnetometer/mag3110.c
index b88cb44..f66955f 100644
--- a/drivers/iio/magnetometer/mag3110.c
+++ b/drivers/iio/magnetometer/mag3110.c
@@ -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';

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux