Skip to content

Commit 2fcd801

Browse files
committed
Merge tag 'tag-chrome-platform-fixes-for-v5.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux
Pull chrome-platform fixes from Benson Leung: "Two small fixes for cros_ec_sensorhub_ring.c, addressing issues introduced in the cros_ec_sensorhub FIFO support commit" * tag 'tag-chrome-platform-fixes-for-v5.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: cros_ec_sensorhub: Add missing '\n' in log messages platform/chrome: cros_ec_sensorhub: Off by one in cros_sensorhub_send_sample()
2 parents c837266 + 538b847 commit 2fcd801

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/platform/chrome/cros_ec_sensorhub_ring.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cros_sensorhub_send_sample(struct cros_ec_sensorhub *sensorhub,
4040
int id = sample->sensor_id;
4141
struct iio_dev *indio_dev;
4242

43-
if (id > sensorhub->sensor_num)
43+
if (id >= sensorhub->sensor_num)
4444
return -EINVAL;
4545

4646
cb = sensorhub->push_data[id].push_data_cb;
@@ -820,7 +820,7 @@ static void cros_ec_sensorhub_ring_handler(struct cros_ec_sensorhub *sensorhub)
820820
if (fifo_info->count > sensorhub->fifo_size ||
821821
fifo_info->size != sensorhub->fifo_size) {
822822
dev_warn(sensorhub->dev,
823-
"Mismatch EC data: count %d, size %d - expected %d",
823+
"Mismatch EC data: count %d, size %d - expected %d\n",
824824
fifo_info->count, fifo_info->size,
825825
sensorhub->fifo_size);
826826
goto error;
@@ -851,14 +851,14 @@ static void cros_ec_sensorhub_ring_handler(struct cros_ec_sensorhub *sensorhub)
851851
}
852852
if (number_data > fifo_info->count - i) {
853853
dev_warn(sensorhub->dev,
854-
"Invalid EC data: too many entry received: %d, expected %d",
854+
"Invalid EC data: too many entry received: %d, expected %d\n",
855855
number_data, fifo_info->count - i);
856856
break;
857857
}
858858
if (out + number_data >
859859
sensorhub->ring + fifo_info->count) {
860860
dev_warn(sensorhub->dev,
861-
"Too many samples: %d (%zd data) to %d entries for expected %d entries",
861+
"Too many samples: %d (%zd data) to %d entries for expected %d entries\n",
862862
i, out - sensorhub->ring, i + number_data,
863863
fifo_info->count);
864864
break;

0 commit comments

Comments
 (0)