Received: by 10.213.65.68 with SMTP id h4csp1160501imn; Wed, 21 Mar 2018 04:18:10 -0700 (PDT) X-Google-Smtp-Source: AG47ELucWkQMJX3k71sHgRhpYtHETygDkcQWMwa26SrxY5tnenvbrSKkPBcPKug4tvV5YHtn2Ykn X-Received: by 10.98.149.138 with SMTP id c10mr16716223pfk.143.1521631089990; Wed, 21 Mar 2018 04:18:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521631089; cv=none; d=google.com; s=arc-20160816; b=jl9QCS0PZp+KU+28KMkp2YP4bMtKmv1ueRXmnWnTYErVaqTZ20CSC/ugcSJGy+Isoq 2mAeKzJyM0NvpURAnfWeohPgjgnkatf1GejGqo5XFASx++ILzPvw3gsPZRZ+X5N8ogpw /njrWT3xFAZ9jflTnj+XtEXzC6iQQfQrEajdaLs623mI49BSLwf+bPQ8fYIsOptZQStT DkLxkKLirdmfj5QUQJ6eMo0HR68EWJ9HhK9bL9R5WYFQO+JT+CsBUMGs9YwrkiTomwfN P/BnS0IfgOKggee9bZXK1EsMnVekoVnmP7qRB7Wf52dwzhDFhSK+jiIy+XkZSzxwZOPR IDOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=eulO39E4Ky49awq/FnHraOvH9YntX/ea+TqNY6VKfbY=; b=dy60+lJso/pUa8JB57r2IK5O3lmnpZWsF4PDq5ixlAoO+1N5OqVNRVTPVvGbKokm/h hRbMsw4JzUcvVGchKJ1TBg2i6JRFk6CjGXmHERovdKmM6UhNADwvQyEakBFaMWaezTV8 cdeQ2evsqItVy0HGDO1y04W3cWiYXXXZ1Gd776nYbAmnc1AZ6g7HPf3goSY7HMUqPbVy kVU43hX5/48Ublnd9ZXv0+/BqKVf1utaLGnNJZ7B6S+UuDr/f24wmiAvTgQxRkQENLcL weA2gKLK0NDCb4n19pDlRXxE0MN8KYQnUMVu5tujYE9LNcWEvKIfNkY6pT98br/6zxYR 5R1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jujT6jGT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si1934771pgs.98.2018.03.21.04.17.55; Wed, 21 Mar 2018 04:18:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jujT6jGT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751717AbeCULQr (ORCPT + 99 others); Wed, 21 Mar 2018 07:16:47 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:36319 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751459AbeCULQo (ORCPT ); Wed, 21 Mar 2018 07:16:44 -0400 Received: by mail-pl0-f66.google.com with SMTP id 61-v6so2921212plf.3 for ; Wed, 21 Mar 2018 04:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=eulO39E4Ky49awq/FnHraOvH9YntX/ea+TqNY6VKfbY=; b=jujT6jGTYxtBKfozdAeom3K5qbfCKvG5nyjQ7g9BlhUUK/wWCwu7wN6KuLid0IMVFC pShgeUAAdxj15vf78vFMOWzQ9pUIqdz66/orOgvUZNLyl5r6PWln7rZBwVK8H2ZlL+tc Qv9dsHEdZPvVC//zzDRRt15EH/QHRo6IfDEqSvB5Z458vu5LMxxrx1FdE6Ef9EWHl7Ti 8opVuHE7AJePMvONJ8mi36y2wNAFQVd9xoQosi/YgWNC6HkV5A3xyJ7U8ZDKQWlpX9TH msbImTRXX9z5pFm4z5X8eyeoiDxqak4ZhFPLIbdzfRsnHTjn2jWaOllnpASIZIVQt4Vo 5rXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=eulO39E4Ky49awq/FnHraOvH9YntX/ea+TqNY6VKfbY=; b=k5pOWwmEvYQypgCFcVtr6iwGYBWq0Ph+SabY191sKkPvfzsIhpzi7uoF5TBLUAl+36 MiAK8IG31L8v/NEYsxVjMx1xpS3z7af1j4TFPA3/Pjo2QZwNjCF6XZKziWJx+JTsN3Qb fSdkVff7IaZbM0HYDSJDCuEbTskqOvlAkn1bH5J3pbkOTW6bwU7YEhNKNtxNdL6IIbt4 7dNjpqWtHXSfeZotHB+gdGwLvkX30FSk/wnhZ38xVLVx96UpHsdjjb4u/lCNniwuj+I5 550nGo+MVs58CsYLLeyJcb2sIuI4ggYumzjNCF9rrpEnF50goGTwcvsOqOux21/q2wib 4DlA== X-Gm-Message-State: AElRT7GKqSkGvUnTViJ2i11+tmzel7vM4fn//pqy4oQg1gGtIibykZeM 9wr1s6I/7+QjjQlVdQmku0s= X-Received: by 2002:a17:902:8d92:: with SMTP id v18-v6mr20259752plo.21.1521631004187; Wed, 21 Mar 2018 04:16:44 -0700 (PDT) Received: from localhost.localdomain ([2405:204:704d:dd88:856a:9bcd:6536:693e]) by smtp.gmail.com with ESMTPSA id b6sm8327436pfm.160.2018.03.21.04.16.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Mar 2018 04:16:43 -0700 (PDT) From: hariprasath.elango@gmail.com To: ruxandra.radulescu@nxp.com, gregkh@linuxfoundation.org Cc: gehariprasath@gmail.com, HariPrasath Elango , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH] staging: fsl-dpaa2: replace simple switch case by if statement Date: Wed, 21 Mar 2018 16:46:04 +0530 Message-Id: <20180321111604.9902-1-hariprasath.elango@gmail.com> X-Mailer: git-send-email 2.10.0.GIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: HariPrasath Elango Replace a couple of simple switch cases by if condition Signed-off-by: HariPrasath Elango --- drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c index 070a3f2..fb517cb 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c @@ -171,8 +171,7 @@ static void dpaa2_eth_get_strings(struct net_device *netdev, u32 stringset, u8 *p = data; int i; - switch (stringset) { - case ETH_SS_STATS: + if (stringset == ETH_SS_STATS) { for (i = 0; i < DPAA2_ETH_NUM_STATS; i++) { strlcpy(p, dpaa2_ethtool_stats[i], ETH_GSTRING_LEN); p += ETH_GSTRING_LEN; @@ -181,18 +180,16 @@ static void dpaa2_eth_get_strings(struct net_device *netdev, u32 stringset, strlcpy(p, dpaa2_ethtool_extras[i], ETH_GSTRING_LEN); p += ETH_GSTRING_LEN; } - break; } } static int dpaa2_eth_get_sset_count(struct net_device *net_dev, int sset) { - switch (sset) { - case ETH_SS_STATS: /* ethtool_get_stats(), ethtool_get_drvinfo() */ + if (sset == ETH_SS_STATS) + /* ethtool_get_stats(), ethtool_get_drvinfo() */ return DPAA2_ETH_NUM_STATS + DPAA2_ETH_NUM_EXTRA_STATS; - default: + else return -EOPNOTSUPP; - } } /** Fill in hardware counters, as returned by MC. -- 2.10.0.GIT