Skip to content

Commit

Permalink
[media] mceusb: Optimize DIV_ROUND_CLOSEST call
Browse files Browse the repository at this point in the history
DIV_ROUND_CLOSEST is faster if the compiler knows it will only be
dealing with unsigned dividends.

Signed-off-by: Jean 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: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Jean Delvare authored and Mauro Carvalho Chehab committed Sep 18, 2012
1 parent 8b03663 commit ed7dd24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/rc/mceusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ed7dd24

Please sign in to comment.