Received: by 10.213.65.68 with SMTP id h4csp1201012imn; Wed, 21 Mar 2018 05:19:00 -0700 (PDT) X-Google-Smtp-Source: AG47ELuGBD0wki+m+q6uihxV/XRRyrta/G0BtP0XEhSkpinELJgQAKx6jxZXAtqf7XgsgCMwqkyu X-Received: by 10.101.85.71 with SMTP id t7mr14840232pgr.386.1521634740018; Wed, 21 Mar 2018 05:19:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521634740; cv=none; d=google.com; s=arc-20160816; b=UTZWRpKTDICK9R2bcLeh+ixbWIZQZ29hL+YERJKp3wZgzXiK+S3OT0ng3ULBn0ktrW 1z96Q/21Q5K7V0nMrEFvV+7t8fgZTX4epbj8OfxmasVuvRnYQVnXA2LtUokWAyDif3UN LQIS5A1inwBNFpERE5YzIqpeQhya/Dnk+8UWjNUu5zz8MffiZES0gu8r8ulAM2yXyBmk Rl6iVKsKTqz1ZZkCvvojgpkrOiyHoJX2cWCyl8qSjpbqRNdu9O5IDHU+vmfxJz27xacr 8WvF7uARUoRd48V0qMPnmpLs/KpEKtJgI7xFw7A4u0UQQ6PAwCT1nG83V5isiG9wqpE6 wzhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=rs1/KIJHDiEgUks99sQHfWSzOwLGX4qVm9+4tNdluAk=; b=r5OVng4BZ3jfE7j5dQXe8ulxdYO2BtRrdOaFwp8YabmOOmh8qGovItbOgodtnEcV6j u0n+vxkyHdTVvt3FcJEgQMoE5Jm6hgQz72gVznPsMMXmHWqKkxUw5Y8885unDuBXN0XN 7F3XHAkC0ip+SB7G2WUCEmiInda5CoQM+k9oO8CbtIvFeQJr4tVt3EtUqCkqQ0kyBl5z yTDw6mSc6ot5C3mc4XPr3VLMkKcWvzeLsiWYtlxApv7WiF4z0TxRljq2oe0tFUFcnYZj 5MiyMdfJXZ2+T6bUMQ0zjcerYwKEt3HjSdsT4YKvCQVQ0NlK/MUU0Vg0tEUCIZci8QNm 2EEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YGDR1OWG; 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 u137si2692458pgb.651.2018.03.21.05.18.45; Wed, 21 Mar 2018 05:18:59 -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=YGDR1OWG; 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 S1751667AbeCUMRx (ORCPT + 99 others); Wed, 21 Mar 2018 08:17:53 -0400 Received: from mail-qt0-f173.google.com ([209.85.216.173]:37114 "EHLO mail-qt0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751464AbeCUMRw (ORCPT ); Wed, 21 Mar 2018 08:17:52 -0400 Received: by mail-qt0-f173.google.com with SMTP id n11so4668696qti.4 for ; Wed, 21 Mar 2018 05:17:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=rs1/KIJHDiEgUks99sQHfWSzOwLGX4qVm9+4tNdluAk=; b=YGDR1OWGNmgq6Nso2pZBxtPJEpRoWd4eznJp83g/qdsvn/iBDe2EtgB3Y62qBlwEkX 9NCrDVdAbUhTa/kKTBzjmytjOVhzZNitlhKgC/3kydbSyKY08XGywAubFcvAaksI5qM6 E8e2+fJnV/johbdltvY1ZkvjSyBzKr0xE4rAXYQs4INNzc4/bm6ZCj4nIiw1o/kfbD6w Ki7eiXZUBD+C6z8GkeKoF4n6YYQKR0cDzx20MTXSy+jeQahLJYzX5lEPib2plkIX2St3 WGpdOJ/WqT0Csw3CP0pyoghH+2K2YDMNRBpfw14Kar/ZZTaAsNWKRVPxcaho8FdSGyZD CF4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=rs1/KIJHDiEgUks99sQHfWSzOwLGX4qVm9+4tNdluAk=; b=fklAHrHWU1pIRJEAr5vakHhXsVQP6GUbW9PKhKQYnF6YgoH1HSWltLshtkl4EIUcBU QRDZTl5+I7OFgRbfvrckgq8RRzLE0PCqzm9si+YpGKIMOf0zSLWEgbxrEAuHVt0udHv8 J6YEfCKtpenYoucguUb9somDr5FwgECwd4ShndzrfGhthWW8zneDPPcrX87E7dwGA3TX zkh+VaLx7Jg71+vLLuVrju9SYoMLW85Z9cD7rkhrR5UXKH58CW2C5wcZxnPc7iG5HALm ImVfYP6N5PiUjtqbVyP2PdeOU7hVGMnNlRia3XeW0lzz6X0MRwmDAxxq/WEXa9TekC2a tx9w== X-Gm-Message-State: AElRT7Fc+utbmUKn2V+9YvTMI6GesnUEUM0pNfFtO3YDuhpazLLbgyMw iL6JYQtBRmVA/aLcPZpu/lUa7yNQsGFIM3gNs/w= X-Received: by 10.200.42.146 with SMTP id b18mr12946544qta.262.1521634671805; Wed, 21 Mar 2018 05:17:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.35.50 with HTTP; Wed, 21 Mar 2018 05:17:51 -0700 (PDT) In-Reply-To: References: <20180321111604.9902-1-hariprasath.elango@gmail.com> From: Denis Kirjanov Date: Wed, 21 Mar 2018 15:17:51 +0300 Message-ID: Subject: Re: [PATCH] staging: fsl-dpaa2: replace simple switch case by if statement To: David Laight Cc: "hariprasath.elango@gmail.com" , "ruxandra.radulescu@nxp.com" , "gregkh@linuxfoundation.org" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/21/18, David Laight wrote: > 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. I had the same question when saw it. It's better to keep things as is. > > ... >> 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 =3D data; >> int i; >> >> - switch (stringset) { >> - case ETH_SS_STATS: >> + if (stringset =3D=3D ETH_SS_STATS) { >> for (i =3D 0; i < DPAA2_ETH_NUM_STATS; i++) { >> strlcpy(p, dpaa2_ethtool_stats[i], ETH_GSTRING_LEN); >> p +=3D ETH_GSTRING_LEN; >> @@ -181,18 +180,16 @@ static void dpaa2_eth_get_strings(struct net_devic= e >> *netdev, u32 stringset, >> strlcpy(p, dpaa2_ethtool_extras[i], ETH_GSTRING_LEN); >> p +=3D ETH_GSTRING_LEN; >> } >> - break; >> } >> } > ... > > David > > _______________________________________________ > devel mailing list > devel@linuxdriverproject.org > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel > --=20 Regards / Mit besten Gr=C3=BC=C3=9Fen, Denis