summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Maneyrol <JManeyrol@invensense.com>2017-06-07 13:42:26 +0000
committerJonathan Cameron <jic23@kernel.org>2017-06-11 15:07:38 +0100
commit8a12ed7df7750778808c6feb0a5fd5725d2a8aeb (patch)
treeff232fb8d2c488a4147b5787041c10587e5caf1c
parent68cd6e5b206b21ff5226c806c55fd8c718d5bde5 (diff)
downloadop-kernel-dev-8a12ed7df7750778808c6feb0a5fd5725d2a8aeb.zip
op-kernel-dev-8a12ed7df7750778808c6feb0a5fd5725d2a8aeb.tar.gz
iio: imu: inv_mpu6050: replace sprintf with scnprintf
Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/iio/imu/inv_mpu6050/inv_mpu_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index 9b4bbee..60732e9 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -651,7 +651,8 @@ static ssize_t inv_attr_show(struct device *dev, struct device_attribute *attr,
case ATTR_ACCL_MATRIX:
m = st->plat_data.orientation;
- return sprintf(buf, "%d, %d, %d; %d, %d, %d; %d, %d, %d\n",
+ return scnprintf(buf, PAGE_SIZE,
+ "%d, %d, %d; %d, %d, %d; %d, %d, %d\n",
m[0], m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8]);
default:
return -EINVAL;
OpenPOWER on IntegriCloud