From patchwork Fri Jun 8 09:20:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Vecera X-Patchwork-Id: 926651 X-Patchwork-Delegate: linville@tuxdriver.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cera.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 412H2D5jLxz9s01 for ; Fri, 8 Jun 2018 19:20:36 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751128AbeFHJUQ (ORCPT ); Fri, 8 Jun 2018 05:20:16 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40032 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751072AbeFHJUO (ORCPT ); Fri, 8 Jun 2018 05:20:14 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 26097406E8C0; Fri, 8 Jun 2018 09:20:14 +0000 (UTC) Received: from ceranb.redhat.com (unknown [10.40.205.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 955591116701; Fri, 8 Jun 2018 09:20:11 +0000 (UTC) From: Ivan Vecera To: linville@tuxdriver.com Cc: netdev@vger.kernel.org Subject: [PATCH ethtool 1/6] ethtool: fix uninitialized return value Date: Fri, 8 Jun 2018 11:20:05 +0200 Message-Id: <20180608092010.13041-1-cera@cera.cz> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 08 Jun 2018 09:20:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 08 Jun 2018 09:20:14 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cera@cera.cz' RCPT:'' Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fixes: b0fe96d ("Ethtool: Implements ETHTOOL_PHY_GTUNABLE/ETHTOOL_PHY_STUNABLE and PHY downshift") Signed-off-by: Ivan Vecera --- 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) From patchwork Fri Jun 8 09:20:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Vecera X-Patchwork-Id: 926648 X-Patchwork-Delegate: linville@tuxdriver.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cera.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 412H1w3cMsz9s01 for ; Fri, 8 Jun 2018 19:20:20 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751154AbeFHJUR (ORCPT ); Fri, 8 Jun 2018 05:20:17 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35904 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751077AbeFHJUP (ORCPT ); Fri, 8 Jun 2018 05:20:15 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4CF5288866; Fri, 8 Jun 2018 09:20:15 +0000 (UTC) Received: from ceranb.redhat.com (unknown [10.40.205.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5CB4C1117646; Fri, 8 Jun 2018 09:20:14 +0000 (UTC) From: Ivan Vecera To: linville@tuxdriver.com Cc: netdev@vger.kernel.org, Jacob Keller Subject: [PATCH ethtool 2/6] ethtool: fix RING_VF assignment Date: Fri, 8 Jun 2018 11:20:06 +0200 Message-Id: <20180608092010.13041-2-cera@cera.cz> In-Reply-To: <20180608092010.13041-1-cera@cera.cz> References: <20180608092010.13041-1-cera@cera.cz> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 08 Jun 2018 09:20:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 08 Jun 2018 09:20:15 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cera@cera.cz' RCPT:'' Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fixes: 36ee712 ("ethtool: support queue and VF fields for rxclass filters") Cc: Jacob Keller Signed-off-by: Ivan Vecera --- rxclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rxclass.c b/rxclass.c index ce4b382..42d122d 100644 --- a/rxclass.c +++ b/rxclass.c @@ -1066,7 +1066,7 @@ static int rxclass_get_val(char *str, unsigned char *p, u32 *flags, val++; *(u64 *)&p[opt->offset] &= ~ETHTOOL_RX_FLOW_SPEC_RING_VF; - *(u64 *)&p[opt->offset] = (u64)val << ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF; + *(u64 *)&p[opt->offset] |= (u64)val << ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF; break; } case OPT_RING_QUEUE: { From patchwork Fri Jun 8 09:20:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Vecera X-Patchwork-Id: 926652 X-Patchwork-Delegate: linville@tuxdriver.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cera.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 412H2K2XTWz9s01 for ; Fri, 8 Jun 2018 19:20:41 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751657AbeFHJUh (ORCPT ); Fri, 8 Jun 2018 05:20:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54910 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751137AbeFHJUQ (ORCPT ); Fri, 8 Jun 2018 05:20:16 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 46F5940200A0; Fri, 8 Jun 2018 09:20:16 +0000 (UTC) Received: from ceranb.redhat.com (unknown [10.40.205.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8BCA61116702; Fri, 8 Jun 2018 09:20:15 +0000 (UTC) From: Ivan Vecera To: linville@tuxdriver.com Cc: netdev@vger.kernel.org Subject: [PATCH ethtool 3/6] ethtool: remove unused global variable Date: Fri, 8 Jun 2018 11:20:07 +0200 Message-Id: <20180608092010.13041-3-cera@cera.cz> In-Reply-To: <20180608092010.13041-1-cera@cera.cz> References: <20180608092010.13041-1-cera@cera.cz> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 08 Jun 2018 09:20:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 08 Jun 2018 09:20:16 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cera@cera.cz' RCPT:'' Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fixes: 2c2ee7a ("ethtool: Add support for sfc register dumps") Signed-off-by: Ivan Vecera --- sfc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sfc.c b/sfc.c index 9478b38..b4c590f 100644 --- a/sfc.c +++ b/sfc.c @@ -3083,9 +3083,6 @@ static const struct efx_nic_reg_field efx_nic_reg_fields_TX_PACE[] = { REGISTER_FIELD_BZ(TX_PACE_SB_AF), REGISTER_FIELD_BZ(TX_PACE_SB_NOT_AF), }; -static const struct efx_nic_reg_field efx_nic_reg_fields_TX_PACE_DROP_QID[] = { - REGISTER_FIELD_BZ(TX_PACE_QID_DRP_CNT), -}; static const struct efx_nic_reg_field efx_nic_reg_fields_TX_VLAN[] = { REGISTER_FIELD_BB(TX_VLAN0), REGISTER_FIELD_BB(TX_VLAN0_PORT0_EN), From patchwork Fri Jun 8 09:20:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Vecera X-Patchwork-Id: 926650 X-Patchwork-Delegate: linville@tuxdriver.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cera.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 412H2533nVz9s0W for ; Fri, 8 Jun 2018 19:20:29 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751253AbeFHJUW (ORCPT ); Fri, 8 Jun 2018 05:20:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54914 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751077AbeFHJUR (ORCPT ); Fri, 8 Jun 2018 05:20:17 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6ACCF40200A4; Fri, 8 Jun 2018 09:20:17 +0000 (UTC) Received: from ceranb.redhat.com (unknown [10.40.205.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 845B81116702; Fri, 8 Jun 2018 09:20:16 +0000 (UTC) From: Ivan Vecera To: linville@tuxdriver.com Cc: netdev@vger.kernel.org, David Decotigny Subject: [PATCH ethtool 4/6] ethtool: several fixes in do_gregs() Date: Fri, 8 Jun 2018 11:20:08 +0200 Message-Id: <20180608092010.13041-4-cera@cera.cz> In-Reply-To: <20180608092010.13041-1-cera@cera.cz> References: <20180608092010.13041-1-cera@cera.cz> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 08 Jun 2018 09:20:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 08 Jun 2018 09:20:17 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cera@cera.cz' RCPT:'' Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org - correctly close gregs_dump_file in case of fstat() failure - check for error from realloc Fixes: be4c2d0 ("ethtool.c: fix dump_regs heap corruption") Cc: David Decotigny Signed-off-by: Ivan Vecera --- ethtool.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ethtool.c b/ethtool.c index e7495fe..2b90984 100644 --- a/ethtool.c +++ b/ethtool.c @@ -3179,17 +3179,26 @@ static int do_gregs(struct cmd_context *ctx) if (!gregs_dump_raw && gregs_dump_file != NULL) { /* overwrite reg values from file dump */ FILE *f = fopen(gregs_dump_file, "r"); + struct ethtool_regs *nregs; struct stat st; size_t nread; if (!f || fstat(fileno(f), &st) < 0) { fprintf(stderr, "Can't open '%s': %s\n", gregs_dump_file, strerror(errno)); + if (f) + fclose(f); free(regs); return 75; } - regs = realloc(regs, sizeof(*regs) + st.st_size); + nregs = realloc(regs, sizeof(*regs) + st.st_size); + if (!nregs) { + perror("Cannot allocate memory for register dump"); + free(regs); /* was not freed by realloc */ + return 73; + } + regs = nregs; regs->len = st.st_size; nread = fread(regs->data, regs->len, 1, f); fclose(f); From patchwork Fri Jun 8 09:20:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Vecera X-Patchwork-Id: 926649 X-Patchwork-Delegate: linville@tuxdriver.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cera.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 412H210TTYz9s01 for ; Fri, 8 Jun 2018 19:20:25 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751466AbeFHJUW (ORCPT ); Fri, 8 Jun 2018 05:20:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40036 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751216AbeFHJUT (ORCPT ); Fri, 8 Jun 2018 05:20:19 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 873F3406E8C4; Fri, 8 Jun 2018 09:20:18 +0000 (UTC) Received: from ceranb.redhat.com (unknown [10.40.205.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id A99181116702; Fri, 8 Jun 2018 09:20:17 +0000 (UTC) From: Ivan Vecera To: linville@tuxdriver.com Cc: netdev@vger.kernel.org, Gal Pressman Subject: [PATCH ethtool 5/6] ethtool: correctly free hkey when get_stringset() fails Date: Fri, 8 Jun 2018 11:20:09 +0200 Message-Id: <20180608092010.13041-5-cera@cera.cz> In-Reply-To: <20180608092010.13041-1-cera@cera.cz> References: <20180608092010.13041-1-cera@cera.cz> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 08 Jun 2018 09:20:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 08 Jun 2018 09:20:18 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cera@cera.cz' RCPT:'' Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Memory allocated for 'hkey' is not freed when get_stringset(..., ETH_SS_RSS_HASH_FUNCS...) fails. Fixes: b888f35 ("ethtool: Support for configurable RSS hash function") Cc: Gal Pressman Signed-off-by: Ivan Vecera --- ethtool.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ethtool.c b/ethtool.c index 2b90984..fb93ae8 100644 --- a/ethtool.c +++ b/ethtool.c @@ -3910,7 +3910,7 @@ static int do_srxfhindir(struct cmd_context *ctx, int rxfhindir_default, static int do_srxfh(struct cmd_context *ctx) { struct ethtool_rxfh rss_head = {0}; - struct ethtool_rxfh *rss; + struct ethtool_rxfh *rss = NULL; struct ethtool_rxnfc ring_count; int rxfhindir_equal = 0, rxfhindir_default = 0; struct ethtool_gstrings *hfuncs = NULL; @@ -4064,7 +4064,8 @@ static int do_srxfh(struct cmd_context *ctx) hfuncs = get_stringset(ctx, ETH_SS_RSS_HASH_FUNCS, 0, 1); if (!hfuncs) { perror("Cannot get hash functions names"); - return 1; + err = 1; + goto free; } for (i = 0; i < hfuncs->len && !req_hfunc ; i++) { @@ -4078,8 +4079,8 @@ static int do_srxfh(struct cmd_context *ctx) if (!req_hfunc) { fprintf(stderr, "Unknown hash function: %s\n", req_hfunc_name); - free(hfuncs); - return 1; + err = 1; + goto free; } } @@ -4120,9 +4121,7 @@ static int do_srxfh(struct cmd_context *ctx) } free: - if (hkey) - free(hkey); - + free(hkey); free(rss); free(hfuncs); return err; From patchwork Fri Jun 8 09:20:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Vecera X-Patchwork-Id: 926653 X-Patchwork-Delegate: linville@tuxdriver.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cera.cz Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 412H2M6nqTz9s01 for ; Fri, 8 Jun 2018 19:20:43 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751614AbeFHJUf (ORCPT ); Fri, 8 Jun 2018 05:20:35 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54922 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751224AbeFHJUU (ORCPT ); Fri, 8 Jun 2018 05:20:20 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C7F69402243B; Fri, 8 Jun 2018 09:20:19 +0000 (UTC) Received: from ceranb.redhat.com (unknown [10.40.205.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id C79AC1116702; Fri, 8 Jun 2018 09:20:18 +0000 (UTC) From: Ivan Vecera To: linville@tuxdriver.com Cc: netdev@vger.kernel.org, Vidya Sagar Ravipati Subject: [PATCH ethtool 6/6] ethtool: remove unreachable code Date: Fri, 8 Jun 2018 11:20:10 +0200 Message-Id: <20180608092010.13041-6-cera@cera.cz> In-Reply-To: <20180608092010.13041-1-cera@cera.cz> References: <20180608092010.13041-1-cera@cera.cz> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 08 Jun 2018 09:20:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 08 Jun 2018 09:20:19 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cera@cera.cz' RCPT:'' Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The default switch case is unreachable as the MAX_CHANNEL_NUM == 4. Fixes: a5e73bb ("ethtool:QSFP Plus/QSFP28 Diagnostics Information Support") Cc: Vidya Sagar Ravipati Signed-off-by: Ivan Vecera --- qsfp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/qsfp.c b/qsfp.c index aecd5bb..32e195d 100644 --- a/qsfp.c +++ b/qsfp.c @@ -661,9 +661,6 @@ static void sff8636_dom_parse(const __u8 *id, struct sff_diags *sd) tx_power_offset = SFF8636_TX_PWR_4_OFFSET; tx_bias_offset = SFF8636_TX_BIAS_4_OFFSET; break; - default: - printf(" Invalid channel: %d\n", i); - break; } sd->scd[i].bias_cur = OFFSET_TO_U16(tx_bias_offset); sd->scd[i].rx_power = OFFSET_TO_U16(rx_power_offset);