Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1375193imm; Fri, 27 Jul 2018 16:32:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcGrFGPi56+l/FBdk4wGKPZoDPWMhcumd0nmBQgX3aQ2ZAzA+3dhtMyY/KUf9VP73mvCVWq X-Received: by 2002:a17:902:d90f:: with SMTP id c15-v6mr7651837plz.65.1532734369218; Fri, 27 Jul 2018 16:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532734369; cv=none; d=google.com; s=arc-20160816; b=jKAZx661Rir42FS9cqURRAhF6JBaZFm/9YIoMxtBbmyoD1r4gUSNUms/S8FCg7nvcX LfD/5oXl9E9ebZWunwcm3i51AqRG9w2xQav73y3DkWaWmYpwewlIsZvsIkqmu5l6Y60E MH61HFnwoLsP+nSzd51un/La3UMlWQ/KAmgCiXoWzAheAUgqb3NSF3kHY23vvOLWWef1 89CtHgB68fAm7/AxFr09uvHy1Ptdk324H/fvsclmqaumn+9o6lC1/FMULhAoH/kfCAUj b+8sFjkvBYaaPQpAQE1vaeLj9nMPhXrVddDRBTQKoIXNRVh340xuXB17UkMfJWDt7mmG iDRQ== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=Ako0BVkwY5AkrhV3Qf24YnSV5jo/vajOHejDa1zgZaI=; b=HZco5Fl9NjTt3YOUI8JyPcvUA2/9x7GbymwJfhL0Yo2i0YBZfCqUe8Yce4czMoenjo gwdKXd/lk8QcLIvWzBLfB8rEn4KMHATp479+w5ejI4aj7kM9bo8EOaZD9FRkPi0DGyuU JjB6IUftHcPhFK4iuZP8ZpwxLHKNnoDA9Wu9cnSBmb5drgN51HHAvIHojQD2RQ+Vfxmb f1ObAwEIWDqDWY8iaf2JiZGHcSg/46wjzUPezy77c1i0PfSyFErhO5JLeHdWSzdxq7j/ 3P5RCCmVP1dIAOizbvhTnUHfrw3tnn68kxQBq6i3bBpsDFcQz8JXMmsbDd1Ex/L6ju1m Wt7g== 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 m68-v6si4996119pgm.637.2018.07.27.16.32.34; Fri, 27 Jul 2018 16:32:49 -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 S2389302AbeG1AzG (ORCPT + 99 others); Fri, 27 Jul 2018 20:55:06 -0400 Received: from smtprelay0254.hostedemail.com ([216.40.44.254]:49165 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388652AbeG1AzG (ORCPT ); Fri, 27 Jul 2018 20:55:06 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id DB283100E86C0; Fri, 27 Jul 2018 23:30:56 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3871:3872:4321:5007:6117:10004:10400:10848:11026:11232:11473:11657:11658:11914:12043:12296:12438:12679:12740:12760:12895:13069:13255:13311:13357:13439:14659:14721:21080:21627:30012:30046:30054:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: turn12_253205b3ad10f X-Filterd-Recvd-Size: 2000 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf06.hostedemail.com (Postfix) with ESMTPA; Fri, 27 Jul 2018 23:30:55 +0000 (UTC) Message-ID: Subject: Re: [PATCH v3 net-next] net: ethernet: ti: cpsw: replace unnecessarily macroses on functions From: Joe Perches To: Ivan Khoronzhuk , grygorii.strashko@ti.com, davem@davemloft.net Cc: linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, andrew@lunn.ch Date: Fri, 27 Jul 2018 16:30:54 -0700 In-Reply-To: <20180727225725.3843-1-ivan.khoronzhuk@linaro.org> References: <20180727225725.3843-1-ivan.khoronzhuk@linaro.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2018-07-28 at 01:57 +0300, Ivan Khoronzhuk wrote: > Replace ugly macroses on functions. trivia: As cpsw_src_port_detect is only used once, and is a very small function, it might make the code more intelligible to just directly code it where it's used. > diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c [] > @@ -565,40 +565,40 @@ static const struct cpsw_stats cpsw_gstrings_ch_stats[] = { [] > +static void cpsw_src_port_detect(struct cpsw_common *cpsw, int status, > + struct sk_buff *skb) > +{ > + if (!cpsw->data.dual_emac) > + return; > + > + if (CPDMA_RX_SOURCE_PORT(status) == 1) > + skb->dev = cpsw->slaves[0].ndev; > + else if (CPDMA_RX_SOURCE_PORT(status) == 2) > + skb->dev = cpsw->slaves[1].ndev; > +} [] > @@ -801,7 +801,8 @@ static void cpsw_rx_handler(void *token, int len, int status) > int ret = 0; > struct cpsw_common *cpsw = ndev_to_cpsw(ndev); > > - cpsw_dual_emac_src_port_detect(cpsw, status, ndev, skb); > + cpsw_src_port_detect(cpsw, status, skb); here > + ndev = skb->dev;