mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 17:24:17 +08:00
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:
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user