lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <nycvar.YFH.7.76.2206081306090.10851@cbobk.fhfr.pm>
Date:   Wed, 8 Jun 2022 13:06:14 +0200 (CEST)
From:   Jiri Kosina <jikos@...nel.org>
To:     Li Qiong <liqiong@...china.com>
cc:     Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        Pandruvada@...ts.nfsmail.com,
        Srinivas <srinivas.pandruvada@...el.com>,
        Ye Xiang <xiang.ye@...el.com>, Even Xu <even.xu@...el.com>,
        linux-kernel@...r.kernel.org, yuzhe@...china.com,
        renyu@...china.com, linux-input@...r.kernel.org
Subject: Re: [PATCH 1/2] HID: intel-ish-hid: ipc: use time_before to replace
 "jiffies < a"

On Mon, 6 Jun 2022, Li Qiong wrote:

> time_before deals with timer wrapping correctly.
> 
> Signed-off-by: Li Qiong <liqiong@...china.com>
> ---
>  drivers/hid/intel-ish-hid/ipc/ipc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-ish-hid/ipc/ipc.c
> index 8ccb246b0114..15e14239af82 100644
> --- a/drivers/hid/intel-ish-hid/ipc/ipc.c
> +++ b/drivers/hid/intel-ish-hid/ipc/ipc.c
> @@ -578,7 +578,7 @@ static void _ish_sync_fw_clock(struct ishtp_device *dev)
>  	static unsigned long	prev_sync;
>  	uint64_t	usec;
>  
> -	if (prev_sync && jiffies - prev_sync < 20 * HZ)
> +	if (prev_sync && time_before(jiffies, prev_sync + 20 * HZ))
>  		return;

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ