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>
This commit is contained in:
parent
68cd6e5b20
commit
8a12ed7df7
|
@ -651,7 +651,8 @@ static ssize_t inv_attr_show(struct device *dev, struct device_attribute *attr,
|
||||||
case ATTR_ACCL_MATRIX:
|
case ATTR_ACCL_MATRIX:
|
||||||
m = st->plat_data.orientation;
|
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]);
|
m[0], m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8]);
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
Loading…
Reference in New Issue