Received: by 10.213.65.68 with SMTP id h4csp1179661imn; Wed, 21 Mar 2018 04:48:20 -0700 (PDT) X-Google-Smtp-Source: AG47ELvIB67ndEDjwjSfmlQ74KULnCo48BK3C0MLjblvULZklcv9QpwA2GhJ6ZFNzCUD0Szfctmn X-Received: by 2002:a17:902:7516:: with SMTP id i22-v6mr3366235pll.240.1521632900023; Wed, 21 Mar 2018 04:48:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521632899; cv=none; d=google.com; s=arc-20160816; b=G+rVGADKKppKaKHIeaNcvu3qPrpYHKIMEQZZUyTHB/7S6LEzhpXPTBun5ZnhszyLOi uAkYMfbbc7ZjrtqSYdBVVf3CjJrqNWGz+U6X/42j2g2wPWGhEEC4HJky8nGyUzc0YvAc o6c2MCvejr03/4RndZR1QSMD5Rsmd8F7L5NU3woa+YfN+LPxbGCW9O4voRMrG2c5zYrX hlb6hdpk6g31SFmLPiIyMmvsWlA4wPeEzmiMhaham0mG0jSY2wbi1akVRS26C9Waajwq hYxV/vmavJM0BwuG5j07xMRBy0Wy3ZOtO1V7wnizK8oKnGa9gAW5kfuoFy2badTXpwu/ ynFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=Cim1T3m3bZI91REzXoMqyBFJR5a47qpzbrqW5uN2C0c=; b=LArOwPmyfsKAkfabGEdyFJNrWhFdZ60T3OV1SlL7bmIQ1Z6TorlIGyUmXeLHTArn1E WAs0QaInT/hAj4HIVgVIhCTnYSfeizxE/4az8MGYmTg1wZykF3L3CjEHt5Z0qald6sL0 tp5og0Y48z6Ue73u+PlvJRwBNk7SNb6ioi1tgBWlPsFawJ8pqrWQI0NzSxYJ5RnBqS8F 3H+l8of+lcpYanxNgG5lZ+wadiqM1UpuNzzxvFBQ+T491lO5AsRX6ZvIDMoWR65vIWz2 cy/MKzShp48ilY3mq6Ojig22l3xeYNIVEV6/7BNhIN3M8ei3/iwGtCyN19FWBs8ULquR EXIg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91-v6si3790929ply.646.2018.03.21.04.48.05; Wed, 21 Mar 2018 04:48:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751549AbeCULrO convert rfc822-to-8bit (ORCPT + 99 others); Wed, 21 Mar 2018 07:47:14 -0400 Received: from smtp-out6.electric.net ([192.162.217.190]:57565 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751405AbeCULrN (ORCPT ); Wed, 21 Mar 2018 07:47:13 -0400 Received: from 1eycCz-0005LZ-TV by out6b.electric.net with emc1-ok (Exim 4.90_1) (envelope-from ) id 1eycD0-0005Ti-Tv; Wed, 21 Mar 2018 04:47:10 -0700 Received: by emcmailer; Wed, 21 Mar 2018 04:47:10 -0700 Received: from [156.67.243.126] (helo=AcuMS.aculab.com) by out6b.electric.net with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1eycCz-0005LZ-TV; Wed, 21 Mar 2018 04:47:09 -0700 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 21 Mar 2018 11:48:08 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Wed, 21 Mar 2018 11:48:08 +0000 From: David Laight To: "'hariprasath.elango@gmail.com'" , "ruxandra.radulescu@nxp.com" , "gregkh@linuxfoundation.org" CC: "gehariprasath@gmail.com" , "linux-kernel@vger.kernel.org" , "devel@driverdev.osuosl.org" Subject: RE: [PATCH] staging: fsl-dpaa2: replace simple switch case by if statement Thread-Topic: [PATCH] staging: fsl-dpaa2: replace simple switch case by if statement Thread-Index: AQHTwQY99HFy4WEVM0a+/SD9vn9jDqPakoWQ Date: Wed, 21 Mar 2018 11:48:08 +0000 Message-ID: References: <20180321111604.9902-1-hariprasath.elango@gmail.com> In-Reply-To: <20180321111604.9902-1-hariprasath.elango@gmail.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.33] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuMS.aculab.com X-TLS: TLSv1.2:ECDHE-RSA-AES256-SHA384:256 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 X-Virus-Status: Scanned by VirusSMART (c) X-Virus-Status: Scanned by VirusSMART (s) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: > hariprasath.elango@gmail.com > Sent: 21 March 2018 11:16 > From: HariPrasath Elango > > Replace a couple of simple switch cases by if condition Why? In principle extra 'case' might be needed in the future. ... > 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; > } > } ... David