From: Jean Delvare Date: Sat, 1 Sep 2012 17:53:57 +0000 (-0300) Subject: [media] mceusb: Optimize DIV_ROUND_CLOSEST call X-Git-Tag: firefly_0821_release~3680^2~275^2~1251 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ed7dd240075fabf38e489930e39eab2dfa836520;p=firefly-linux-kernel-4.4.55.git [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: Jean Delvare Cc: Andrew Morton Cc: Guenter Roeck Cc: Mauro Carvalho Chehab Tested-by: Guenter Roeck Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index a5c6c1c2af82..850547fe711c 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -627,7 +627,7 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf, break; case MCE_RSP_EQIRCFS: period = DIV_ROUND_CLOSEST( - (1 << data1 * 2) * (data2 + 1), 10); + (1U << data1 * 2) * (data2 + 1), 10); if (!period) break; carrier = (1000 * 1000) / period;