From 4c5c6479bda194a33d9db010bf3ec991275a6353 Mon Sep 17 00:00:00 2001 From: Robin Reyes Date: Tue, 9 Jul 2024 21:36:52 +0800 Subject: [PATCH] Fix invalid patch --- .../patches/100-kernel-6.6.patch | 44 ++++++------------- 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/wwan/driver/quectel_QMI_WWAN/patches/100-kernel-6.6.patch b/wwan/driver/quectel_QMI_WWAN/patches/100-kernel-6.6.patch index 5b5453e..4d74460 100644 --- a/wwan/driver/quectel_QMI_WWAN/patches/100-kernel-6.6.patch +++ b/wwan/driver/quectel_QMI_WWAN/patches/100-kernel-6.6.patch @@ -29,39 +29,23 @@ stats64 = per_cpu_ptr(dev->stats64, cpu); do { --#if (LINUX_VERSION_CODE < KERNEL_VERSION( 6,6,0 )) -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,6,0)) ++#if (LINUX_VERSION_CODE < KERNEL_VERSION( 6,6,0 )) start = u64_stats_fetch_begin_irq(&stats64->syncp); - #else - start = u64_stats_fetch_begin(&stats64->syncp); - #endif -- rx_packets = stats64->rx_packets; -- rx_bytes = stats64->rx_bytes; -- tx_packets = stats64->tx_packets; -- tx_bytes = stats64->tx_bytes; --#if (LINUX_VERSION_CODE < KERNEL_VERSION( 6,6,0 )) -+ rx_packets = u64_stats_read(&stats64->rx_packets); -+ rx_bytes = u64_stats_read(&stats64->rx_bytes); -+ tx_packets = u64_stats_read(&stats64->tx_packets); -+ tx_bytes = u64_stats_read(&stats64->tx_bytes); -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,6,0)) ++#else ++ start = u64_stats_fetch_begin(&stats64->syncp); ++#endif + rx_packets = stats64->rx_packets; + rx_bytes = stats64->rx_bytes; + tx_packets = stats64->tx_packets; + tx_bytes = stats64->tx_bytes; ++#if (LINUX_VERSION_CODE < KERNEL_VERSION( 6,6,0 )) } while (u64_stats_fetch_retry_irq(&stats64->syncp, start)); - #else - } while (u64_stats_fetch_retry(&stats64->syncp, start)); - #endif ++#else ++ } while (u64_stats_fetch_retry(&stats64->syncp, start)); ++#endif -- stats->rx_packets += u64_stats_read(&rx_packets); -- stats->rx_bytes += u64_stats_read(&rx_bytes); -- stats->tx_packets += u64_stats_read(&tx_packets); -- stats->tx_bytes += u64_stats_read(&tx_bytes); --#endif -+ stats->rx_packets += rx_packets; -+ stats->rx_bytes += rx_bytes; -+ stats->tx_packets += tx_packets; -+ stats->tx_bytes += tx_bytes; - } - - return stats; + stats->rx_packets += u64_stats_read(&rx_packets); + stats->rx_bytes += u64_stats_read(&rx_bytes); @@ -2588,7 +2585,6 @@ static void qmap_qmi_wwan_disconnect(str static struct usb_driver qmi_wwan_driver = { .name = "qmi_wwan_q",