From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jiri Pirko <jiri@mellanox.com>
Cc: Ido Schimmel <idosch@mellanox.com>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch -next] mlxsw: core: remove an unnecessary condition
Date: Wed, 06 Jan 2016 09:56:30 +0000 [thread overview]
Message-ID: <20160106095630.GB23185@mwanda> (raw)
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 <dan.carpenter@oracle.com>
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,
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jiri Pirko <jiri@mellanox.com>
Cc: Ido Schimmel <idosch@mellanox.com>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch -next] mlxsw: core: remove an unnecessary condition
Date: Wed, 6 Jan 2016 12:56:30 +0300 [thread overview]
Message-ID: <20160106095630.GB23185@mwanda> (raw)
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 <dan.carpenter@oracle.com>
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,
next reply other threads:[~2016-01-06 9:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 9:56 Dan Carpenter [this message]
2016-01-06 9:56 ` [patch -next] mlxsw: core: remove an unnecessary condition Dan Carpenter
2016-01-06 10:15 ` Jiri Pirko
2016-01-06 10:15 ` Jiri Pirko
2016-01-06 20:08 ` David Miller
2016-01-06 20:08 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160106095630.GB23185@mwanda \
--to=dan.carpenter@oracle.com \
--cc=idosch@mellanox.com \
--cc=jiri@mellanox.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.