Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72a868b3 authored by Ioana Ciornei's avatar Ioana Ciornei Committed by Jonathan Cameron
Browse files

iio: imu: check sscanf return value



This patch fixes the following checkpatch warning:
WARNING: unchecked sscanf return value

Signed-off-by: default avatarIoana Ciornei <ciorneiioana@gmail.com>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent a106b474
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -288,7 +288,11 @@ static int adis16400_initial_setup(struct iio_dev *indio_dev)
		if (ret)
			goto err_ret;

		sscanf(indio_dev->name, "adis%u\n", &device_id);
		ret = sscanf(indio_dev->name, "adis%u\n", &device_id);
		if (ret != 1) {
			ret = -EINVAL;
			goto err_ret;
		}

		if (prod_id != device_id)
			dev_warn(&indio_dev->dev, "Device ID(%u) and product ID(%u) do not match.",
+3 −1
Original line number Diff line number Diff line
@@ -765,7 +765,9 @@ static int adis16480_initial_setup(struct iio_dev *indio_dev)
	if (ret)
		return ret;

	sscanf(indio_dev->name, "adis%u\n", &device_id);
	ret = sscanf(indio_dev->name, "adis%u\n", &device_id);
	if (ret != 1)
		return -EINVAL;

	if (prod_id != device_id)
		dev_warn(&indio_dev->dev, "Device ID(%u) and product ID(%u) do not match.",