Re: [PATCH] msi3103: Use time_before_eq()

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

 



On Sat, 2014-05-24 at 20:47 +0200, Manuel Schölling wrote:
> To be future-proof and for better readability the time comparisons are
> modified to use time_before_eq() instead of plain, error-prone math.

A couple of unrelated, trivial notes: (repeated a few times)

> diff --git a/drivers/staging/media/msi3101/sdr-msi3101.c b/drivers/staging/media/msi3101/sdr-msi3101.c
[]
> @@ -208,7 +208,7 @@ static int msi3101_convert_stream_504(struct msi3101_state *s, u8 *dst,
>  	}
>  
>  	/* calculate samping rate and output it in 10 seconds intervals */

s/samping/sampling/

> -	if ((s->jiffies_next + msecs_to_jiffies(10000)) <= jiffies) {
> +	if (time_before_eq(s->jiffies_next + 10 * HZ, jiffies)) {
>  		unsigned long jiffies_now = jiffies;
>  		unsigned long msecs = jiffies_to_msecs(jiffies_now) - jiffies_to_msecs(s->jiffies_next);

Perhaps better to subtract then convert
instead of convert twice then subtract.


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel





[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux