[patch -next] mlxsw: core: remove an unnecessary condition

Subsystems: mellanox ethernet switch drivers, networking drivers, the rest

STALE3876d

3 messages, 3 authors, 2016-01-06 · open the first message on its own page

[patch -next] mlxsw: core: remove an unnecessary condition

From: Dan Carpenter <hidden>
Date: 2016-01-06 09:56:42

We checked "err" on the lines before so we know it's zero here.

These cause a static checker warning because checking known things can
indicate a bug.  Maybe there is a missing assignment or we are checking
the wrong variable.

Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c
index 5b9364f..1ac8bf1 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c
@@ -130,7 +130,7 @@ static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev,
 		dev_err(mlxsw_hwmon->bus_info->dev, "Failed to reset temp sensor history\n");
 		return err;
 	}
-	return err ? err : len;
+	return len;
 }
 
 static ssize_t mlxsw_hwmon_fan_rpm_show(struct device *dev,

Re: [patch -next] mlxsw: core: remove an unnecessary condition

From: Jiri Pirko <jiri@resnulli.us>
Date: 2016-01-06 10:15:49

Wed, Jan 06, 2016 at 10:56:30AM CET, dan.carpenter@oracle.com wrote:
We checked "err" on the lines before so we know it's zero here.

These cause a static checker warning because checking known things can
indicate a bug.  Maybe there is a missing assignment or we are checking
the wrong variable.

Signed-off-by: Dan Carpenter <redacted>
Acked-by: Jiri Pirko <redacted>

Re: [patch -next] mlxsw: core: remove an unnecessary condition

From: David Miller <davem@davemloft.net>
Date: 2016-01-06 20:08:10

From: Dan Carpenter <redacted>
Date: Wed, 6 Jan 2016 12:56:30 +0300
We checked "err" on the lines before so we know it's zero here.

These cause a static checker warning because checking known things can
indicate a bug.  Maybe there is a missing assignment or we are checking
the wrong variable.

Signed-off-by: Dan Carpenter <redacted>
Applied, thanks Dan.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help