Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next] netdevice: optimise netdev_intersect_features slightly
@ 2014-12-19  5:21 roy.qing.li
  2014-12-19  6:09 ` Michal Kubecek
  0 siblings, 1 reply; 2+ messages in thread
From: roy.qing.li @ 2014-12-19  5:21 UTC (permalink / raw)
  To: netdev; +Cc: mkubecek

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-19  6:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-19  5:21 [PATCH net-next] netdevice: optimise netdev_intersect_features slightly roy.qing.li
2014-12-19  6:09 ` Michal Kubecek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox