From: Joe Perches <joe@perches.com>
To: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>,
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
Subject: Re: [PATCH v3 net-next] net: ethernet: ti: cpsw: replace unnecessarily macroses on functions
Date: Fri, 27 Jul 2018 16:30:54 -0700 [thread overview]
Message-ID: <c2b3f36b8e7e1a2799580e76f19a267351da5491.camel@perches.com> (raw)
In-Reply-To: <20180727225725.3843-1-ivan.khoronzhuk@linaro.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;
next prev parent reply other threads:[~2018-07-27 23:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-27 22:57 [PATCH v3 net-next] net: ethernet: ti: cpsw: replace unnecessarily macroses on functions Ivan Khoronzhuk
2018-07-27 23:30 ` Joe Perches [this message]
2018-07-28 14:41 ` Ivan Khoronzhuk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c2b3f36b8e7e1a2799580e76f19a267351da5491.camel@perches.com \
--to=joe@perches.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=grygorii.strashko@ti.com \
--cc=ivan.khoronzhuk@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).