[media] mceusb: Optimize DIV_ROUND_CLOSEST call
authorJean Delvare <khali@linux-fr.org>
Sat, 1 Sep 2012 17:53:57 +0000 (14:53 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 18 Sep 2012 15:22:58 +0000 (12:22 -0300)
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>
drivers/media/rc/mceusb.c

index a5c6c1c2af822b95164cc4ca8827d8bf2dba2214..850547fe711c25131ca84b748b35de2c35b8b5ae 100644 (file)
@@ -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;