Received: by 10.213.65.68 with SMTP id h4csp1238121imn; Wed, 21 Mar 2018 06:09:18 -0700 (PDT) X-Google-Smtp-Source: AG47ELtLolOaMb/nGEonG4YAPJTIAJYbwGQJ1BKjvoCkehQ26W8Krkhsc7CbuOCNv1qrz+YFI1Sk X-Received: by 10.99.65.6 with SMTP id o6mr6289384pga.57.1521637758905; Wed, 21 Mar 2018 06:09:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521637758; cv=none; d=google.com; s=arc-20160816; b=min1wcYEP74uCj6EXFuMwgM0RDkzdJofQNk5K8f5Z0bHlLwGu+y0aLRag2MysHEH94 gYaJThtSPefi1gUp/TUIrlIcBlJSHns/J1LpNyfxnQqgNZlv6uPgU7ogsH4z0+Mdnom1 j5LXWhPxhOEm3O3MCg/tlPo3ZAgCQeZlPoQrdIIA2/fg0HsBR6SYVU3aRwztcKguphJa iWcDJzKKsUiVxHx9xdYjb8AdBd3JdE36ERG/dhSVA6ceIWA3XWg7B3CAolJtGAXCZKGT nvFjcEoFZdeRGGJNNIZI2yURju6FWpA10aF5eeirZxPsF/fuM/Ooorqf8TH05wuyz6Lv o+yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature :arc-authentication-results; bh=oD0w97HBSfz/xpDU439xJZ935JB3hzZge2NAKuGAUdQ=; b=kqbK+Qjm+5VkTQ3RlvkzXZqmI/G1++MRLZWWUdcDXh8YpkMRRBnIr651L93mQijm2T KymyhyWnwCUkIdSBhorZ0TeptGVIQb0jWL2aD7IjCGjQKENxY6AAeQnAtDCVm6d6AnMB oAa/NtM5qtzlOkySKi2vNmcRVLzQhIBJfYe4jZY4KPkeyxKBbqLxr/WR2S6faP91b4oB XUZLBy6HlXmRSy6QJJUka9zJDEsaPiu3DEucgzJMGRDrw6YO4eYU0Qcve4CDiMFqV85V A9IU+ujpry/jl7vPKTFp23bTwHf4eJr/CJW4XHMoovCytH2K1SzU7FFsCUvDEDxZ4j7P l4lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IMkEF/g0; 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 w4-v6si3757588plp.122.2018.03.21.06.08.32; Wed, 21 Mar 2018 06:09:18 -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=IMkEF/g0; 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 S1751778AbeCUNGG (ORCPT + 99 others); Wed, 21 Mar 2018 09:06:06 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:34645 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751405AbeCUNGE (ORCPT ); Wed, 21 Mar 2018 09:06:04 -0400 Received: by mail-io0-f196.google.com with SMTP id r18so6559566ioa.1 for ; Wed, 21 Mar 2018 06:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=oD0w97HBSfz/xpDU439xJZ935JB3hzZge2NAKuGAUdQ=; b=IMkEF/g01Mc8ktupCmlzeHE4FDEvuHGww5FBAR1F5mef8ZI2VX01RzM6h3Ai4iE81p kuuSt0bJDMeVIpoy5pd+yDjOifR7RJA0C6zQ4JQRIEqHy6Rjg11kNEv89zLMDeCjTIZz SjuJ8hF4suxyNvXjUYattEbSUM48pnyaGy1EOsXy9VoUvbUgMtHYIHBE/yVksekbD05S JKE3pORmF/JtEWhxw1PqAyNNueiFvglgufzjw334sVe26aRrziWuYZXOy2wjtleFUviS NypzeY5MZjX0BcIrm9Qt/gz4mgugHvDzUFnObqSWmSbBpYx3tSlBEkVQOG3GaJbFXTAK QVsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=oD0w97HBSfz/xpDU439xJZ935JB3hzZge2NAKuGAUdQ=; b=eCDhSdzZNid8dzPKEC13X1MYtgssq/DW4yzBEiILJYn6PvPvlffchMIvkzedH5IEz5 m12o74GzVyjkFBalIzQs3amyTs4Mao02caYwGykWr6HGcJj46SdJQdWbBZdOVNVSc330 6v+KJuodLsm0ZK2Wpy+880kz3/TCblBUW32nypaSh5mtzHzkvZH8snwlvTkkZMOtt+YG gND+6M6GEqJB8wScfnERzGnnQL7/mpgSj2O/2wzLsdAxdvfAx+itXgmjxD0GkK5q8Dey +yDAjfLYun3nkKOZ4EpOH01XZFF6Y6UL4PwyqrWtJ8/+IoG4j0uVyO68g0lkU7ldaEdM FmRQ== X-Gm-Message-State: AElRT7Evt8l/v+CHKTs9XRcEqDAMHHw27W3foPEpRQAryrJhP0vCP1Dw CyPXzicl8IKCWpoEztGf3q8= X-Received: by 10.107.102.25 with SMTP id a25mr20672537ioc.178.1521637564080; Wed, 21 Mar 2018 06:06:04 -0700 (PDT) Received: from hariprasath ([122.165.96.181]) by smtp.gmail.com with ESMTPSA id f11sm3017680iof.42.2018.03.21.06.05.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Mar 2018 06:06:03 -0700 (PDT) From: "" X-Google-Original-From: "" Date: Wed, 21 Mar 2018 18:35:57 +0530 To: Denis Kirjanov Cc: David Laight , "hariprasath.elango@gmail.com" , "ruxandra.radulescu@nxp.com" , "gregkh@linuxfoundation.org" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] staging: fsl-dpaa2: replace simple switch case by if statement Message-ID: <20180321130411.GA11639@hariprasath> References: <20180321111604.9902-1-hariprasath.elango@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 21, 2018 at 03:17:51PM +0300, Denis Kirjanov wrote: > 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. > > > > ... Hi, since the switch statement had only one case,I thought of doing this. If there are plans to add more cases, we can leave it like that. thanks, hari > >> 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 > > > > _______________________________________________ > > devel mailing list > > devel@linuxdriverproject.org > > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel > > > > > -- > Regards / Mit besten Gr??en, > Denis