Netdev List
 help / color / mirror / Atom feed
From: roy.qing.li@gmail.com
To: netdev@vger.kernel.org
Cc: mkubecek@suse.cz
Subject: [PATCH net-next] netdevice: optimise netdev_intersect_features slightly
Date: Fri, 19 Dec 2014 13:21:27 +0800	[thread overview]
Message-ID: <1418966487-23347-1-git-send-email-roy.qing.li@gmail.com> (raw)

From: Li RongQing <roy.qing.li@gmail.com>

Since f1 and f2 always have NETIF_F_GEN_CSUM when doing Bitwise OR assignment,
it is unnecessory to clear NETIF_F_GEN_CSUM from the added data

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Cc: Michal Kubecek <mkubecek@suse.cz>
---
 include/linux/netdevice.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c31f74d..b8facf9 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3542,9 +3542,9 @@ static inline netdev_features_t netdev_intersect_features(netdev_features_t f1,
 							  netdev_features_t f2)
 {
 	if (f1 & NETIF_F_GEN_CSUM)
-		f1 |= (NETIF_F_ALL_CSUM & ~NETIF_F_GEN_CSUM);
+		f1 |= NETIF_F_ALL_CSUM;
 	if (f2 & NETIF_F_GEN_CSUM)
-		f2 |= (NETIF_F_ALL_CSUM & ~NETIF_F_GEN_CSUM);
+		f2 |= NETIF_F_ALL_CSUM;
 	f1 &= f2;
 	if (f1 & NETIF_F_GEN_CSUM)
 		f1 &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_GEN_CSUM);
-- 
2.1.0

             reply	other threads:[~2014-12-19  5:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-19  5:21 roy.qing.li [this message]
2014-12-19  6:09 ` [PATCH net-next] netdevice: optimise netdev_intersect_features slightly Michal Kubecek

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=1418966487-23347-1-git-send-email-roy.qing.li@gmail.com \
    --to=roy.qing.li@gmail.com \
    --cc=mkubecek@suse.cz \
    --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