summaryrefslogtreecommitdiffstats
path: root/drivers/iio
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 /drivers/iio
parent68cd6e5b206b21ff5226c806c55fd8c718d5bde5 (diff)
downloadlinux-8a12ed7df7750778808c6feb0a5fd5725d2a8aeb.tar.gz
linux-8a12ed7df7750778808c6feb0a5fd5725d2a8aeb.tar.bz2
linux-8a12ed7df7750778808c6feb0a5fd5725d2a8aeb.zip
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>
Diffstat (limited to 'drivers/iio')
-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 9b4bbeea3d4f..60732e90ccfa 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;