Skip to content

Commit

Permalink
net: ena: cosmetic: remove unnecessary code
Browse files Browse the repository at this point in the history
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 <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arthur Kiyanovski authored and David S. Miller committed May 22, 2020
1 parent 46143e5 commit f302044
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
11 changes: 3 additions & 8 deletions drivers/net/ethernet/amazon/ena/ena_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ int ena_get_sset_count(struct net_device *netdev, int sset)
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;
}

Expand Down Expand Up @@ -260,7 +260,6 @@ static void ena_get_strings(struct net_device *netdev, u32 sset, u8 *data)

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;
}
Expand Down Expand Up @@ -307,10 +306,8 @@ static int ena_get_coalesce(struct net_device *net_dev,
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) *
Expand Down Expand Up @@ -355,10 +352,8 @@ static int ena_set_coalesce(struct net_device *net_dev,
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);
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/ethernet/amazon/ena/ena_netdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@
#define DRV_MODULE_GEN_SUBMINOR 0

#define DRV_MODULE_NAME "ena"
#ifndef DRV_MODULE_GENERATION
#define DRV_MODULE_GENERATION \
__stringify(DRV_MODULE_GEN_MAJOR) "." \
__stringify(DRV_MODULE_GEN_MINOR) "." \
__stringify(DRV_MODULE_GEN_SUBMINOR) "K"
#endif

#define DEVICE_NAME "Elastic Network Adapter (ENA)"

Expand Down

0 comments on commit f302044

Please sign in to comment.