diff options
author | Benson Leung <bleung@chromium.org> | 2020-04-13 21:53:22 +0200 |
---|---|---|
committer | Benson Leung <bleung@chromium.org> | 2020-04-13 21:57:15 +0200 |
commit | cf96e284deda69e26a90b8f278967998e7b628ab (patch) | |
tree | 19735830369959c4d1ef9c1f5d1566ebfdd66f14 /drivers/platform/chrome | |
parent | platform/chrome: cros_ec_ishtp: free ishtp buffer before sending event (diff) | |
parent | platform/chrome: cros_ec_sensorhub: Add missing '\n' in log messages (diff) | |
download | linux-cf96e284deda69e26a90b8f278967998e7b628ab.tar.xz linux-cf96e284deda69e26a90b8f278967998e7b628ab.zip |
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.
538b8471fee8 platform/chrome: cros_ec_sensorhub: Add missing '\n' in log messages
5b69c23799ec platform/chrome: cros_ec_sensorhub: Off by one in cros_sensorhub_send_sample()
Signed-off-by: Benson Leung <bleung@chromium.org>
Diffstat (limited to 'drivers/platform/chrome')
-rw-r--r-- | drivers/platform/chrome/cros_ec_sensorhub_ring.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/platform/chrome/cros_ec_sensorhub_ring.c b/drivers/platform/chrome/cros_ec_sensorhub_ring.c index 230e6cf3da2f..c48e5b38a441 100644 --- a/drivers/platform/chrome/cros_ec_sensorhub_ring.c +++ b/drivers/platform/chrome/cros_ec_sensorhub_ring.c @@ -40,7 +40,7 @@ cros_sensorhub_send_sample(struct cros_ec_sensorhub *sensorhub, int id = sample->sensor_id; struct iio_dev *indio_dev; - if (id > sensorhub->sensor_num) + if (id >= sensorhub->sensor_num) return -EINVAL; cb = sensorhub->push_data[id].push_data_cb; @@ -820,7 +820,7 @@ static void cros_ec_sensorhub_ring_handler(struct cros_ec_sensorhub *sensorhub) if (fifo_info->count > sensorhub->fifo_size || fifo_info->size != sensorhub->fifo_size) { 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, sensorhub->fifo_size); goto error; @@ -851,14 +851,14 @@ static void cros_ec_sensorhub_ring_handler(struct cros_ec_sensorhub *sensorhub) } if (number_data > fifo_info->count - i) { 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); break; } if (out + number_data > sensorhub->ring + fifo_info->count) { 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, fifo_info->count); break; |