Commit ed7dd240 authored by Jean Delvare's avatar Jean Delvare Committed by Mauro Carvalho Chehab

[media] mceusb: Optimize DIV_ROUND_CLOSEST call

DIV_ROUND_CLOSEST is faster if the compiler knows it will only be
dealing with unsigned dividends.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 8b036636
...@@ -627,7 +627,7 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf, ...@@ -627,7 +627,7 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf,
break; break;
case MCE_RSP_EQIRCFS: case MCE_RSP_EQIRCFS:
period = DIV_ROUND_CLOSEST( period = DIV_ROUND_CLOSEST(
(1 << data1 * 2) * (data2 + 1), 10); (1U << data1 * 2) * (data2 + 1), 10);
if (!period) if (!period)
break; break;
carrier = (1000 * 1000) / period; carrier = (1000 * 1000) / period;
......
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