netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ethtool 1/6] ethtool: fix uninitialized return value
@ 2018-06-08  9:20 Ivan Vecera
  2018-06-08  9:20 ` [PATCH ethtool 2/6] ethtool: fix RING_VF assignment Ivan Vecera
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Ivan Vecera @ 2018-06-08  9:20 UTC (permalink / raw)
  To: linville; +Cc: netdev

Fixes: b0fe96d ("Ethtool: Implements ETHTOOL_PHY_GTUNABLE/ETHTOOL_PHY_STUNABLE and PHY downshift")
Signed-off-by: Ivan Vecera <cera@cera.cz>
---
 ethtool.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/ethtool.c b/ethtool.c
index 2e87384..e7495fe 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -4723,8 +4723,8 @@ static int do_get_phy_tunable(struct cmd_context *ctx)
 {
 	int argc = ctx->argc;
 	char **argp = ctx->argp;
-	int err, i;
 	u8 downshift_changed = 0;
+	int i;
 
 	if (argc < 1)
 		exit_bad_args();
@@ -4750,8 +4750,7 @@ static int do_get_phy_tunable(struct cmd_context *ctx)
 		cont.ds.id = ETHTOOL_PHY_DOWNSHIFT;
 		cont.ds.type_id = ETHTOOL_TUNABLE_U8;
 		cont.ds.len = 1;
-		err = send_ioctl(ctx, &cont.ds);
-		if (err < 0) {
+		if (send_ioctl(ctx, &cont.ds) < 0) {
 			perror("Cannot Get PHY downshift count");
 			return 87;
 		}
@@ -4762,7 +4761,7 @@ static int do_get_phy_tunable(struct cmd_context *ctx)
 			fprintf(stdout, "Downshift disabled\n");
 	}
 
-	return err;
+	return 0;
 }
 
 static __u32 parse_reset(char *val, __u32 bitset, char *arg, __u32 *data)
-- 
2.16.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-06-13 18:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-08  9:20 [PATCH ethtool 1/6] ethtool: fix uninitialized return value Ivan Vecera
2018-06-08  9:20 ` [PATCH ethtool 2/6] ethtool: fix RING_VF assignment Ivan Vecera
2018-06-08 15:20   ` Keller, Jacob E
2018-06-08  9:20 ` [PATCH ethtool 3/6] ethtool: remove unused global variable Ivan Vecera
2018-06-08  9:20 ` [PATCH ethtool 4/6] ethtool: several fixes in do_gregs() Ivan Vecera
2018-06-08  9:20 ` [PATCH ethtool 5/6] ethtool: correctly free hkey when get_stringset() fails Ivan Vecera
2018-06-08  9:46   ` Gal Pressman
2018-06-08  9:20 ` [PATCH ethtool 6/6] ethtool: remove unreachable code Ivan Vecera
2018-06-13 18:31 ` [PATCH ethtool 1/6] ethtool: fix uninitialized return value John W. Linville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).