* [PATCH] net: amd8111e: remove redundant assignment to 'tx_index'
@ 2018-03-01 16:42 ` Colin King
0 siblings, 0 replies; 8+ messages in thread
From: Colin King @ 2018-03-01 16:42 UTC (permalink / raw)
To: David S . Miller, netdev; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable tx_index is being initialized with a value that is never
read and re-assigned a little later, hence the initialization is redundant
and can be removed.
Cleans up clang warning:
drivers/net/ethernet/amd/amd8111e.c:652:6: warning: Value stored to
'tx_index' during its initialization is never read
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/ethernet/amd/amd8111e.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index 358f7ab77c70..c99e3e845ac0 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -649,7 +649,7 @@ static void amd8111e_free_ring(struct amd8111e_priv *lp)
static int amd8111e_tx(struct net_device *dev)
{
struct amd8111e_priv *lp = netdev_priv(dev);
- int tx_index = lp->tx_complete_idx & TX_RING_DR_MOD_MASK;
+ int tx_index;
int status;
/* Complete all the transmit packet */
while (lp->tx_complete_idx != lp->tx_idx){
--
2.15.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] net: amd8111e: remove redundant assignment to 'tx_index'
@ 2018-03-01 16:42 ` Colin King
0 siblings, 0 replies; 8+ messages in thread
From: Colin King @ 2018-03-01 16:42 UTC (permalink / raw)
To: David S . Miller, netdev; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable tx_index is being initialized with a value that is never
read and re-assigned a little later, hence the initialization is redundant
and can be removed.
Cleans up clang warning:
drivers/net/ethernet/amd/amd8111e.c:652:6: warning: Value stored to
'tx_index' during its initialization is never read
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/ethernet/amd/amd8111e.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index 358f7ab77c70..c99e3e845ac0 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -649,7 +649,7 @@ static void amd8111e_free_ring(struct amd8111e_priv *lp)
static int amd8111e_tx(struct net_device *dev)
{
struct amd8111e_priv *lp = netdev_priv(dev);
- int tx_index = lp->tx_complete_idx & TX_RING_DR_MOD_MASK;
+ int tx_index;
int status;
/* Complete all the transmit packet */
while (lp->tx_complete_idx != lp->tx_idx){
--
2.15.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] net: amd8111e: remove redundant assignment to 'tx_index'
2018-03-01 16:42 ` Colin King
@ 2018-03-04 23:18 ` David Miller
-1 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2018-03-04 23:18 UTC (permalink / raw)
To: colin.king; +Cc: netdev, kernel-janitors, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Thu, 1 Mar 2018 16:42:40 +0000
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable tx_index is being initialized with a value that is never
> read and re-assigned a little later, hence the initialization is redundant
> and can be removed.
>
> Cleans up clang warning:
> drivers/net/ethernet/amd/amd8111e.c:652:6: warning: Value stored to
> 'tx_index' during its initialization is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied to net-next.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] net: amd8111e: remove redundant assignment to 'tx_index'
@ 2018-03-04 23:18 ` David Miller
0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2018-03-04 23:18 UTC (permalink / raw)
To: colin.king; +Cc: netdev, kernel-janitors, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Thu, 1 Mar 2018 16:42:40 +0000
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable tx_index is being initialized with a value that is never
> read and re-assigned a little later, hence the initialization is redundant
> and can be removed.
>
> Cleans up clang warning:
> drivers/net/ethernet/amd/amd8111e.c:652:6: warning: Value stored to
> 'tx_index' during its initialization is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied to net-next.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] net: amd8111e: remove redundant duplicated if statement
2018-03-01 16:42 ` Colin King
@ 2018-04-25 10:31 ` Colin King
-1 siblings, 0 replies; 8+ messages in thread
From: Colin King @ 2018-04-25 10:31 UTC (permalink / raw)
To: David S . Miller, Allen Pais, netdev; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
There are two identical nested if statements, the second is redundant
and can be removed. Also clean up white space formatting.
Cleans up cppcheck warning:
drivers/net/ethernet/amd/amd8111e.c:1080: (warning) Identical inner 'if'
condition is always true.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/ethernet/amd/amd8111e.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index c99e3e845ac0..a90080f12e67 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -1074,16 +1074,12 @@ static int amd8111e_calc_coalesce(struct net_device *dev)
amd8111e_set_coalesce(dev,TX_INTR_COAL);
coal_conf->tx_coal_type = MEDIUM_COALESCE;
}
-
- }
- else if(tx_pkt_size >= 1024){
- if (tx_pkt_size >= 1024){
- if(coal_conf->tx_coal_type != HIGH_COALESCE){
- coal_conf->tx_timeout = 4;
- coal_conf->tx_event_count = 8;
- amd8111e_set_coalesce(dev,TX_INTR_COAL);
- coal_conf->tx_coal_type = HIGH_COALESCE;
- }
+ } else if (tx_pkt_size >= 1024) {
+ if (coal_conf->tx_coal_type != HIGH_COALESCE) {
+ coal_conf->tx_timeout = 4;
+ coal_conf->tx_event_count = 8;
+ amd8111e_set_coalesce(dev, TX_INTR_COAL);
+ coal_conf->tx_coal_type = HIGH_COALESCE;
}
}
}
--
2.17.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] net: amd8111e: remove redundant duplicated if statement
@ 2018-04-25 10:31 ` Colin King
0 siblings, 0 replies; 8+ messages in thread
From: Colin King @ 2018-04-25 10:31 UTC (permalink / raw)
To: David S . Miller, Allen Pais, netdev; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
There are two identical nested if statements, the second is redundant
and can be removed. Also clean up white space formatting.
Cleans up cppcheck warning:
drivers/net/ethernet/amd/amd8111e.c:1080: (warning) Identical inner 'if'
condition is always true.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/ethernet/amd/amd8111e.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index c99e3e845ac0..a90080f12e67 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -1074,16 +1074,12 @@ static int amd8111e_calc_coalesce(struct net_device *dev)
amd8111e_set_coalesce(dev,TX_INTR_COAL);
coal_conf->tx_coal_type = MEDIUM_COALESCE;
}
-
- }
- else if(tx_pkt_size >= 1024){
- if (tx_pkt_size >= 1024){
- if(coal_conf->tx_coal_type != HIGH_COALESCE){
- coal_conf->tx_timeout = 4;
- coal_conf->tx_event_count = 8;
- amd8111e_set_coalesce(dev,TX_INTR_COAL);
- coal_conf->tx_coal_type = HIGH_COALESCE;
- }
+ } else if (tx_pkt_size >= 1024) {
+ if (coal_conf->tx_coal_type != HIGH_COALESCE) {
+ coal_conf->tx_timeout = 4;
+ coal_conf->tx_event_count = 8;
+ amd8111e_set_coalesce(dev, TX_INTR_COAL);
+ coal_conf->tx_coal_type = HIGH_COALESCE;
}
}
}
--
2.17.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] net: amd8111e: remove redundant duplicated if statement
2018-04-25 10:31 ` Colin King
@ 2018-04-25 18:12 ` David Miller
-1 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2018-04-25 18:12 UTC (permalink / raw)
To: colin.king; +Cc: allen.lkml, netdev, kernel-janitors, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Wed, 25 Apr 2018 11:31:13 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> There are two identical nested if statements, the second is redundant
> and can be removed. Also clean up white space formatting.
>
> Cleans up cppcheck warning:
> drivers/net/ethernet/amd/amd8111e.c:1080: (warning) Identical inner 'if'
> condition is always true.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] net: amd8111e: remove redundant duplicated if statement
@ 2018-04-25 18:12 ` David Miller
0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2018-04-25 18:12 UTC (permalink / raw)
To: colin.king; +Cc: allen.lkml, netdev, kernel-janitors, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Wed, 25 Apr 2018 11:31:13 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> There are two identical nested if statements, the second is redundant
> and can be removed. Also clean up white space formatting.
>
> Cleans up cppcheck warning:
> drivers/net/ethernet/amd/amd8111e.c:1080: (warning) Identical inner 'if'
> condition is always true.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-04-25 18:27 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25 10:31 [PATCH] net: amd8111e: remove redundant duplicated if statement Colin King
2018-04-25 10:31 ` Colin King
2018-04-25 18:12 ` David Miller
2018-04-25 18:12 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2018-03-01 16:42 [PATCH] net: amd8111e: remove redundant assignment to 'tx_index' Colin King
2018-03-01 16:42 ` Colin King
2018-03-04 23:18 ` David Miller
2018-03-04 23:18 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.