lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 13 Jun 2014 16:12:49 +0200
From:	Bart Van Assche <bvanassche@....org>
To:	"David S. Miller" <davem@...emloft.net>
CC:	Vlad Yasevich <vyasevic@...hat.com>, netdev@...r.kernel.org
Subject: [PATCH] net: Silence a W=1 compiler warning

Avoid that the following compiler warning is reported when building
with W=1:

include/linux/netdevice.h: In function 'netif_addr_lock_nested':
include/linux/netdevice.h:2865:6: warning: variable 'subclass' set but not used [-Wunused-but-set-variable]
  int subclass = SINGLE_DEPTH_NESTING;
      ^

This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bvanassche@....org>
Cc: Vlad Yasevich <vyasevic@...hat.com>
Cc: David S. Miller <davem@...emloft.net>
---
 include/linux/netdevice.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index abe3de1..3c0a2e7 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2951,12 +2951,10 @@ static inline void netif_addr_lock(struct net_device *dev)
 
 static inline void netif_addr_lock_nested(struct net_device *dev)
 {
-	int subclass = SINGLE_DEPTH_NESTING;
-
-	if (dev->netdev_ops->ndo_get_lock_subclass)
-		subclass = dev->netdev_ops->ndo_get_lock_subclass(dev);
-
-	spin_lock_nested(&dev->addr_list_lock, subclass);
+	spin_lock_nested(&dev->addr_list_lock,
+			 dev->netdev_ops->ndo_get_lock_subclass ?
+			 dev->netdev_ops->ndo_get_lock_subclass(dev) :
+			 SINGLE_DEPTH_NESTING);
 }
 
 static inline void netif_addr_lock_bh(struct net_device *dev)
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ