From edb9204dae663189092af3ec46586a8a8a1f7bad Mon Sep 17 00:00:00 2001 From: Petr Oros Date: Mon, 23 Nov 2020 17:16:55 +0100 Subject: [PATCH 60/78] net: ena: cosmetic: remove unnecessary code Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1861967 Upstream commit(s): commit f3020447471c40024fbb4e5d720861b25ce46717 Author: Arthur Kiyanovski Date: Fri May 22 12:09:01 2020 +0300 net: ena: cosmetic: remove unnecessary code 1. Remove unused definition of DRV_MODULE_VERSION 2. Remove {} from single line-of-code ifs 3. Remove unnecessary comments from ena_get/set_coalesce() 4. Remove unnecessary extra spaces and newlines Signed-off-by: Arthur Kiyanovski Signed-off-by: David S. Miller Signed-off-by: Petr Oros --- drivers/net/ethernet/amazon/ena/ena_ethtool.c | 11 +++-------- drivers/net/ethernet/amazon/ena/ena_netdev.h | 6 ------ 2 files changed, 3 insertions(+), 14 deletions(-) Index: src/drivers/net/ethernet/amazon/ena/ena_ethtool.c =================================================================== --- src.orig/drivers/net/ethernet/amazon/ena/ena_ethtool.c 2020-11-23 17:46:13.785725723 +0100 +++ src/drivers/net/ethernet/amazon/ena/ena_ethtool.c 2020-11-23 17:46:21.949653838 +0100 @@ -206,7 +206,7 @@ if (sset != ETH_SS_STATS) return -EOPNOTSUPP; - return adapter->num_io_queues * (ENA_STATS_ARRAY_TX + ENA_STATS_ARRAY_RX) + return adapter->num_io_queues * (ENA_STATS_ARRAY_TX + ENA_STATS_ARRAY_RX) + ENA_STATS_ARRAY_GLOBAL + ENA_STATS_ARRAY_ENA_COM; } @@ -260,7 +260,6 @@ for (i = 0; i < ENA_STATS_ARRAY_GLOBAL; i++) { ena_stats = &ena_stats_global_strings[i]; - memcpy(data, ena_stats->name, ETH_GSTRING_LEN); data += ETH_GSTRING_LEN; } @@ -307,10 +306,8 @@ struct ena_adapter *adapter = netdev_priv(net_dev); struct ena_com_dev *ena_dev = adapter->ena_dev; - if (!ena_com_interrupt_moderation_supported(ena_dev)) { - /* the devie doesn't support interrupt moderation */ + if (!ena_com_interrupt_moderation_supported(ena_dev)) return -EOPNOTSUPP; - } coalesce->tx_coalesce_usecs = ena_com_get_nonadaptive_moderation_interval_tx(ena_dev) * @@ -355,10 +352,8 @@ struct ena_com_dev *ena_dev = adapter->ena_dev; int rc; - if (!ena_com_interrupt_moderation_supported(ena_dev)) { - /* the devie doesn't support interrupt moderation */ + if (!ena_com_interrupt_moderation_supported(ena_dev)) return -EOPNOTSUPP; - } rc = ena_com_update_nonadaptive_moderation_interval_tx(ena_dev, coalesce->tx_coalesce_usecs);