Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp476603iof; Mon, 6 Jun 2022 07:06:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkWhDCcNcRTGMLkNQmb5kQqnbZI37GsVOEqShLMlHWVQKGmX8Cu9IKDmkMUmZzoj/ssHac X-Received: by 2002:a05:6a00:882:b0:510:a043:d4bc with SMTP id q2-20020a056a00088200b00510a043d4bcmr24833776pfj.64.1654524408203; Mon, 06 Jun 2022 07:06:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654524408; cv=none; d=google.com; s=arc-20160816; b=z/y2lXVDnXA2s0HE+VG735D5s1WrqV2w2oh4Z13aEZl8o4gZ+MlSVdWgvXmrGyKxJt 2jtlLLOvgRal9UaO9DabJDpFmOBfpPFMcMTx2LTznBnHmy49HVA2C+wFmoXRx189emJ3 MKzQjGMSbAJXwIcdLeZ7z+1HG8m3H4XiXUetMw73R0Ppu0wKBbR/CFseiYekJTLNE0pK B4YirFGtOVmnuxdmPO34fBJtQfpvRVYHRqveNOeieNOL0O/P/z4bPW7ydRdZBkBCtQvr etH+WwpX4b6MdmH/poDNVQr9fk/f2uDzJGqyrb5k/2m+dNu1BHldFTlubG8KWOXLLTzl COYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=4pJHoBYz7/11sdQp4gyBxy09fRmiG9AKaOR4AHYH8F0=; b=JlVNYu+ScFt00E9FKLEUo8NshjYOs/a3gCXm9vr41Ox8ynqXpaLPfpMTgYGDXsWRQB xJlAsvYWBMOKGHLYyLjXS5uA+vN0kdPwe1lEqdcujbblBtyAA4yySt4lUw5L+2rl0a6l tb/CuuKJjKh8BXM5mRJ28/lm/YJtJ2h1t0h+5/eNViAar5ilwdQ9RfZYqL/uMP3Vt2VQ Ca2FTY9TgY+SRSv79hglpbWExSpUB4Btnuvu1LnUuNyU+XAJM5tchaeWagWK77jYw9Is rzBiYVNuxBNvLQtz+0NEo3V5Q4Cth1EyTT08SZaaXCfkHxp+dmZ0X6y8I/tTW0Bfv7OZ XCcg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y5-20020a17090322c500b0015838a4fd9dsi22540275plg.64.2022.06.06.07.06.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 07:06:48 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EB0CA5535B; Mon, 6 Jun 2022 06:56:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239382AbiFFN4D (ORCPT + 67 others); Mon, 6 Jun 2022 09:56:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239368AbiFFN4B (ORCPT ); Mon, 6 Jun 2022 09:56:01 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4317113D38; Mon, 6 Jun 2022 06:56:00 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 9458B1E80D76; Mon, 6 Jun 2022 21:55:48 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r0ZZjdADiD8D; Mon, 6 Jun 2022 21:55:46 +0800 (CST) Received: from localhost.localdomain (unknown [180.167.10.98]) (Authenticated sender: liqiong@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 5A8F81E80D27; Mon, 6 Jun 2022 21:55:45 +0800 (CST) From: Li Qiong To: Lennert Buytenhek , Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Li Qiong Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, yuzhe@nfschina.com, renyu@nfschina.com Subject: [PATCH 2/2] mwl8k: use time_after to replace "jiffies > a" Date: Mon, 6 Jun 2022 21:54:49 +0800 Message-Id: <20220606135449.23256-1-liqiong@nfschina.com> X-Mailer: git-send-email 2.11.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org time_after deals with timer wrapping correctly. Signed-off-by: Li Qiong --- drivers/net/wireless/marvell/mwl8k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/marvell/mwl8k.c b/drivers/net/wireless/marvell/mwl8k.c index 864a2ba9efee..2dfb8c10bb57 100644 --- a/drivers/net/wireless/marvell/mwl8k.c +++ b/drivers/net/wireless/marvell/mwl8k.c @@ -1880,7 +1880,7 @@ static inline void mwl8k_tx_count_packet(struct ieee80211_sta *sta, u8 tid) * packets ever exceeds the ampdu_min_traffic threshold, we will allow * an ampdu stream to be started. */ - if (jiffies - tx_stats->start_time > HZ) { + if (time_after(jiffies, (unsigned long)tx_stats->start_time + HZ)) { tx_stats->pkts = 0; tx_stats->start_time = 0; } else -- 2.25.1