From patchwork Thu Dec 12 17:33:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13905722 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 447342153EC; Thu, 12 Dec 2024 17:33:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734024792; cv=none; b=gHyaGVZb2ukrHnh+hfXGNMSMgh3ZQRA4EZNvF0BP0MIa/INtbEUoBFvOdBkkIWTt641GUIwoXw+Rx3Hc1Y2xuMOVqzamCoe3/uk3ahHA8+n0E9Idgwvr4jP46Ib21ai35Ndsj9GmpQVNWSKq8W9RT3B6Y1uIQR3h3VttzQgZNiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734024792; c=relaxed/simple; bh=2NE2h+o0vnLauZoMsNvydgnef1Bo/amgX+VliXI66+E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OB0zg2rN+RgWrTWI9gcCPRSRgYLtTMi73DzPu4BB1D73JRnjI0gYWlfaPYivLfmPqU5wXF+DdHp6kelQufyXJ2QdVvwfScfMvMhpjS+rxEBVrx9LuRb6/VQTdce6MZ993Ch3Kga+TiBKtm4RQDeNyraM6c8L8DjqwCNt97IdIRQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=qlEXm7Lv; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="qlEXm7Lv" Received: from eahariha-devbox.5bhznamrcrmeznzvghz2s0u2eh.xx.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id BE7E8204BA83; Thu, 12 Dec 2024 09:33:10 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BE7E8204BA83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1734024790; bh=KhekioNyEpahueZj3EOliOXkKSYfTJCi0WH05Jw+vpU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qlEXm7LvQZ1WtmQ5xwu0xb+LrZ21hjKTyunPYA1nGpM0Q6GTj0/o0lFrdWCC4I+Vs jR6xM2CwIp+NGeNBJldkRVL7KJPw+DFee5aYjmgZWnTZXV+UrjG7EEuMVcKgV0+wv0 ACikRVkTvYokwxuGGnCg+rsu/x4tT+FTyKxkEO60= From: Easwar Hariharan To: Jeroen de Borst , Praveen Kaligineedi , Shailend Chand , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Kalle Valo , Jeff Johnson Cc: Easwar Hariharan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, ath11k@lists.infradead.org Subject: [PATCH net-next v4 1/2] gve: Convert timeouts to secs_to_jiffies() Date: Thu, 12 Dec 2024 17:33:01 +0000 Message-ID: <20241212-netdev-converge-secs-to-jiffies-v4-1-6dac97a6d6ab@linux.microsoft.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241212-netdev-converge-secs-to-jiffies-v4-0-6dac97a6d6ab@linux.microsoft.com> References: <20241212-netdev-converge-secs-to-jiffies-v4-0-6dac97a6d6ab@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @@ constant C; @@ - msecs_to_jiffies(C * 1000) + secs_to_jiffies(C) @@ constant C; @@ - msecs_to_jiffies(C * MSEC_PER_SEC) + secs_to_jiffies(C) Signed-off-by: Easwar Hariharan Reviewed-by: Praveen Kaligineedi --- drivers/net/ethernet/google/gve/gve_tx_dqo.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/google/gve/gve_tx_dqo.c b/drivers/net/ethernet/google/gve/gve_tx_dqo.c index f879426cb5523a7e150f363b5e57b9d472b5817c..394debc62268aadf2579f9b516e045cb48287e7c 100644 --- a/drivers/net/ethernet/google/gve/gve_tx_dqo.c +++ b/drivers/net/ethernet/google/gve/gve_tx_dqo.c @@ -1146,8 +1146,7 @@ static void gve_handle_miss_completion(struct gve_priv *priv, /* jiffies can wraparound but time comparisons can handle overflows. */ pending_packet->timeout_jiffies = jiffies + - msecs_to_jiffies(GVE_REINJECT_COMPL_TIMEOUT * - MSEC_PER_SEC); + secs_to_jiffies(GVE_REINJECT_COMPL_TIMEOUT); add_to_list(tx, &tx->dqo_compl.miss_completions, pending_packet); *bytes += pending_packet->skb->len; @@ -1191,8 +1190,7 @@ static void remove_miss_completions(struct gve_priv *priv, pending_packet->state = GVE_PACKET_STATE_TIMED_OUT_COMPL; pending_packet->timeout_jiffies = jiffies + - msecs_to_jiffies(GVE_DEALLOCATE_COMPL_TIMEOUT * - MSEC_PER_SEC); + secs_to_jiffies(GVE_DEALLOCATE_COMPL_TIMEOUT); /* Maintain pending packet in another list so the packet can be * unallocated at a later time. */ From patchwork Thu Dec 12 17:33:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13905723 X-Patchwork-Delegate: kvalo@adurom.com Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7700C222D4A; Thu, 12 Dec 2024 17:33:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734024792; cv=none; b=HiwgPMGs74CylY1CYQ/oFEmEeFl94VgAV8si2QIm6Guwz9/ikYGUlYKV0hs4UvTdxLsMZNJKfJ9ZF1XPsu6J2E6Wy+LGBTImqXJNZUvOuPNXxrT2bYNijvNONHUF/XmpccP/COS2lehWlY+kFm2JXARaJZgwcxu6iu+NPRZfuGM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734024792; c=relaxed/simple; bh=8zifT6ewWYEFbntDyJ6Ww05c6ssCJZsNoWbJSANJZng=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aXGojjT/bJyBYZkOTjBLWQJa1LMdF4buljyYxlFslbDqIAxzNsr3pHDF7KRNDVp13Z9vJ7iGCGCxbNBrZ4VMp+VGBjmEsab+9QhYbG5Wv86v0aD3OAZBbvVvC3+YQF6+AB4+uHy2XW1Lx1ZlnEQPONG5KyHZNcnqPExd5XTYNDQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=sH1e0U+K; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="sH1e0U+K" Received: from eahariha-devbox.5bhznamrcrmeznzvghz2s0u2eh.xx.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id DC255204BA86; Thu, 12 Dec 2024 09:33:10 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DC255204BA86 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1734024790; bh=ejEwRygxca6lQ1bnnmgGz/a6d9eFvOqci4xwtvOcijY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sH1e0U+KayP+lsFRd5cH4rW4QJHnRLOWDFCTJoPjZRvL6dwQYhPEw6wLSEiQVtzIz MGjOiqbZKlHIKC/I0x+IjPT78qNmm2OrOBklKG81Gn4wy67uMgQIlzYxTIMktAVNJA yGuIpYUjNjbN3EVimHdjo9phwdZ8Nt/bD5dSfqhA= From: Easwar Hariharan To: Jeroen de Borst , Praveen Kaligineedi , Shailend Chand , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Kalle Valo , Jeff Johnson Cc: Easwar Hariharan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, Jeff Johnson Subject: [PATCH net-next v4 2/2] wifi: ath11k: Convert timeouts to secs_to_jiffies() Date: Thu, 12 Dec 2024 17:33:02 +0000 Message-ID: <20241212-netdev-converge-secs-to-jiffies-v4-2-6dac97a6d6ab@linux.microsoft.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241212-netdev-converge-secs-to-jiffies-v4-0-6dac97a6d6ab@linux.microsoft.com> References: <20241212-netdev-converge-secs-to-jiffies-v4-0-6dac97a6d6ab@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @@ constant C; @@ - msecs_to_jiffies(C * 1000) + secs_to_jiffies(C) @@ constant C; @@ - msecs_to_jiffies(C * MSEC_PER_SEC) + secs_to_jiffies(C) Acked-by: Jeff Johnson Signed-off-by: Easwar Hariharan --- drivers/net/wireless/ath/ath11k/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath11k/debugfs.c b/drivers/net/wireless/ath/ath11k/debugfs.c index 57281a135dd7fa6b8610636f47873c8bba21053c..bf192529e3fe26a91e72105a77b4c6f849b905ec 100644 --- a/drivers/net/wireless/ath/ath11k/debugfs.c +++ b/drivers/net/wireless/ath/ath11k/debugfs.c @@ -178,7 +178,7 @@ static int ath11k_debugfs_fw_stats_request(struct ath11k *ar, * received 'update stats' event, we keep a 3 seconds timeout in case, * fw_stats_done is not marked yet */ - timeout = jiffies + msecs_to_jiffies(3 * 1000); + timeout = jiffies + secs_to_jiffies(3); ath11k_debugfs_fw_stats_reset(ar);