From 263fde5ab87bc3f299e4bd2d33a22e0fe55f9545 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Fri, 3 May 2024 19:35:11 +0200 Subject: [PATCH] ramips: remove unnecessary macros for previous kernel versions Remove unnecessary 'if' macros for previous kernel versions. After removing kernel 6.1 the kernel is always >= 6.6 so the conditions are unnecessary. Signed-off-by: Mieczyslaw Nalewaj [removed some more and also no longer include version.h] Signed-off-by: Daniel Golle --- .../ramips/files/drivers/net/ethernet/ralink/ethtool.c | 8 -------- .../files/drivers/net/ethernet/ralink/mtk_eth_soc.c | 8 -------- .../files/drivers/net/ethernet/ralink/mtk_eth_soc.h | 1 - .../ramips/files/drivers/pinctrl/pinctrl-aw9523.c | 10 ---------- 4 files changed, 27 deletions(-) diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/ethtool.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/ethtool.c index ca3b6fb302e6..5d4cebb08968 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/ethtool.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/ethtool.c @@ -199,20 +199,12 @@ static void fe_get_ethtool_stats(struct net_device *dev, do { data_src = &hwstats->tx_bytes; data_dst = data; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) start = u64_stats_fetch_begin(&hwstats->syncp); -#else - start = u64_stats_fetch_begin_irq(&hwstats->syncp); -#endif for (i = 0; i < ARRAY_SIZE(fe_gdma_str); i++) *data_dst++ = *data_src++; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) } while (u64_stats_fetch_retry(&hwstats->syncp, start)); -#else - } while (u64_stats_fetch_retry_irq(&hwstats->syncp, start)); -#endif } static struct ethtool_ops fe_ethtool_ops = { diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c index 4365e398d3fc..c8afa4e3bb8f 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c @@ -487,11 +487,7 @@ static void fe_get_stats64(struct net_device *dev, } do { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) start = u64_stats_fetch_begin(&hwstats->syncp); -#else - start = u64_stats_fetch_begin_irq(&hwstats->syncp); -#endif storage->rx_packets = hwstats->rx_packets; storage->tx_packets = hwstats->tx_packets; storage->rx_bytes = hwstats->rx_bytes; @@ -503,11 +499,7 @@ static void fe_get_stats64(struct net_device *dev, storage->rx_crc_errors = hwstats->rx_fcs_errors; storage->rx_errors = hwstats->rx_checksum_errors; storage->tx_aborted_errors = hwstats->tx_skip; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) } while (u64_stats_fetch_retry(&hwstats->syncp, start)); -#else - } while (u64_stats_fetch_retry_irq(&hwstats->syncp, start)); -#endif storage->tx_errors = priv->netdev->stats.tx_errors; storage->rx_dropped = priv->netdev->stats.rx_dropped; diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h index 364dd54a58f1..151caae1dcc3 100644 --- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h +++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h @@ -21,7 +21,6 @@ #include #include #include -#include enum fe_reg { FE_REG_PDMA_GLO_CFG = 0, diff --git a/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c b/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c index a429bb82a3a0..8b642e28b19a 100644 --- a/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c +++ b/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -810,11 +809,7 @@ static int aw9523_init_gpiochip(struct aw9523 *awi, unsigned int npins) gpiochip->set_multiple = aw9523_gpio_set_multiple; gpiochip->set_config = gpiochip_generic_config; gpiochip->parent = dev; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) gpiochip->fwnode = dev->fwnode; -#else - gpiochip->of_node = dev->of_node; -#endif gpiochip->owner = THIS_MODULE; gpiochip->can_sleep = true; @@ -988,12 +983,7 @@ static int aw9523_hw_init(struct aw9523 *awi) return regmap_reinit_cache(awi->regmap, &aw9523_regmap); } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) static int aw9523_probe(struct i2c_client *client) -#else -static int aw9523_probe(struct i2c_client *client, - const struct i2c_device_id *id) -#endif { struct device *dev = &client->dev; struct pinctrl_desc *pdesc; -- 2.30.2