Re: [PATCH] [media] mceusb: Optimize DIV_ROUND_CLOSEST call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Sep 01, 2012 at 08:53:57PM +0200, Jean Delvare wrote:
> DIV_ROUND_CLOSEST is faster if the compiler knows it will only be
> dealing with unsigned dividends.
> 
> Signed-off-by: Jean Delvare <khali@xxxxxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
> Cc: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxx>

Tested-by: Guenter Roeck <linux@xxxxxxxxxxxx>

> ---
>  drivers/media/rc/mceusb.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-3.6-rc3.orig/drivers/media/rc/mceusb.c	2012-08-04 21:49:27.000000000 +0200
> +++ linux-3.6-rc3/drivers/media/rc/mceusb.c	2012-09-01 18:53:32.053042123 +0200
> @@ -627,7 +627,7 @@ static void mceusb_dev_printdata(struct
>  			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;
> 
> 
> -- 
> Jean Delvare
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux