Skip to contentSkip to conversation

media: mceusb: set timeout to at least timeout provided

git:media_stage/master Mauro Carvalho Chehab 1 participant 1 message Sep 24, 2022

Subsystems (3)
lore
Share & tools
lore

Mauro Carvalho Chehab

author maintainer
#0 lore raw

This is an automatic generated email to let you know that the following patch were queued:

Subject: media: mceusb: set timeout to at least timeout provided
Author:  Sean Young <[email protected]>
Date:    Fri Sep 2 12:32:21 2022 +0200

By rounding down, the actual timeout can be lower than requested. As a result, long spaces just below the requested timeout can be incorrectly reported as timeout and truncated.

Fixes 877f1a7cee3f ("media: rc: mceusb: allow the timeout to be configurable")
 drivers/media/rc/mceusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

---

drivers/media/rc/mceusb.c +1 -1
index 39d2b03e2631..c76ba24c1f55 100644
@@ -1077,7 +1077,7 @@ static int mceusb_set_timeout(struct rc_dev *dev, unsigned int timeout)
 	struct mceusb_dev *ir = dev->priv;
 	unsigned int units;
 
-	units = DIV_ROUND_CLOSEST(timeout, MCE_TIME_UNIT);
+	units = DIV_ROUND_UP(timeout, MCE_TIME_UNIT);
 
 	cmdbuf[2] = units >> 8;
 	cmdbuf[3] = units;