Commit cf96e284 authored by Benson Leung's avatar Benson Leung

Merge remote-tracking branch 'origin/chrome-platform-5.7-fixes' into for-kernelci

Merging 5.7 fixes branch as of April 13, containing two fixes to branch
destined for chrome-platform-5.8.

538b8471 platform/chrome: cros_ec_sensorhub: Add missing '\n' in log messages
5b69c237 platform/chrome: cros_ec_sensorhub: Off by one in cros_sensorhub_send_sample()
Signed-off-by: default avatarBenson Leung <bleung@chromium.org>
parents fd167f7a 538b8471
...@@ -40,7 +40,7 @@ cros_sensorhub_send_sample(struct cros_ec_sensorhub *sensorhub, ...@@ -40,7 +40,7 @@ cros_sensorhub_send_sample(struct cros_ec_sensorhub *sensorhub,
int id = sample->sensor_id; int id = sample->sensor_id;
struct iio_dev *indio_dev; struct iio_dev *indio_dev;
if (id > sensorhub->sensor_num) if (id >= sensorhub->sensor_num)
return -EINVAL; return -EINVAL;
cb = sensorhub->push_data[id].push_data_cb; cb = sensorhub->push_data[id].push_data_cb;
...@@ -820,7 +820,7 @@ static void cros_ec_sensorhub_ring_handler(struct cros_ec_sensorhub *sensorhub) ...@@ -820,7 +820,7 @@ static void cros_ec_sensorhub_ring_handler(struct cros_ec_sensorhub *sensorhub)
if (fifo_info->count > sensorhub->fifo_size || if (fifo_info->count > sensorhub->fifo_size ||
fifo_info->size != sensorhub->fifo_size) { fifo_info->size != sensorhub->fifo_size) {
dev_warn(sensorhub->dev, dev_warn(sensorhub->dev,
"Mismatch EC data: count %d, size %d - expected %d", "Mismatch EC data: count %d, size %d - expected %d\n",
fifo_info->count, fifo_info->size, fifo_info->count, fifo_info->size,
sensorhub->fifo_size); sensorhub->fifo_size);
goto error; goto error;
...@@ -851,14 +851,14 @@ static void cros_ec_sensorhub_ring_handler(struct cros_ec_sensorhub *sensorhub) ...@@ -851,14 +851,14 @@ static void cros_ec_sensorhub_ring_handler(struct cros_ec_sensorhub *sensorhub)
} }
if (number_data > fifo_info->count - i) { if (number_data > fifo_info->count - i) {
dev_warn(sensorhub->dev, dev_warn(sensorhub->dev,
"Invalid EC data: too many entry received: %d, expected %d", "Invalid EC data: too many entry received: %d, expected %d\n",
number_data, fifo_info->count - i); number_data, fifo_info->count - i);
break; break;
} }
if (out + number_data > if (out + number_data >
sensorhub->ring + fifo_info->count) { sensorhub->ring + fifo_info->count) {
dev_warn(sensorhub->dev, dev_warn(sensorhub->dev,
"Too many samples: %d (%zd data) to %d entries for expected %d entries", "Too many samples: %d (%zd data) to %d entries for expected %d entries\n",
i, out - sensorhub->ring, i + number_data, i, out - sensorhub->ring, i + number_data,
fifo_info->count); fifo_info->count);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment