From: Markus Elfring <Markus.Elfring@web.de>
To: devel@driverdev.osuosl.org,
"Aaro Koskinen" <aaro.koskinen@iki.fi>,
"David S. Miller" <davem@davemloft.net>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Ioannis Valasakis" <code@wizofe.uk>,
"Petr Štetiar" <ynezz@true.cz>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] staging: octeon: One function call less in cvm_oct_common_set_multicast_list()
Date: Sat, 6 Jul 2019 10:56:52 +0200 [thread overview]
Message-ID: <877404bb-a9e4-ffa5-a621-d87fbca549ef@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 6 Jul 2019 10:48:23 +0200
Avoid an extra function call by using a ternary operator instead of
a conditional statement.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/staging/octeon/ethernet.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 8847a11c212f..93f127a0b287 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -337,13 +337,8 @@ static void cvm_oct_common_set_multicast_list(struct net_device *dev)
cvmx_write_csr(CVMX_GMXX_RXX_ADR_CTL(index, interface),
control.u64);
- if (dev->flags & IFF_PROMISC)
- cvmx_write_csr(CVMX_GMXX_RXX_ADR_CAM_EN
- (index, interface), 0);
- else
- cvmx_write_csr(CVMX_GMXX_RXX_ADR_CAM_EN
- (index, interface), 1);
-
+ cvmx_write_csr(CVMX_GMXX_RXX_ADR_CAM_EN(index, interface),
+ dev->flags & IFF_PROMISC ? 0 : 1);
cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface),
gmx_cfg.u64);
}
--
2.22.0
next reply other threads:[~2019-07-06 8:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-06 8:56 Markus Elfring [this message]
2019-07-06 8:56 [PATCH] staging: octeon: One function call less in cvm_oct_common_set_multicast_list() Markus Elfring
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=877404bb-a9e4-ffa5-a621-d87fbca549ef@web.de \
--to=markus.elfring@web.de \
--cc=aaro.koskinen@iki.fi \
--cc=code@wizofe.uk \
--cc=davem@davemloft.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ynezz@true.cz \
/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).