Skip to contentSkip to conversation

Variables only used in ifdef

PATCH In review Wang Chen 1 participant 2 messages Jul 4, 2008 – Jul 25, 2008

Subsystems (2)
lore
Share & tools
lore

Wang Chen

author
#0 lore raw

PATCH 1/1 Variables only used in ifdef

Move the variables which only used in #ifdef to where they should be. Otherwise, "defined but not used" compile warning will go out.

---

drivers/net/wan/syncppp.c +2 -2
index 29b4b94..c938d4c 100644
@@ -763,10 +763,10 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb)
 	case CISCO_ADDR_REQ:
 		/* Stolen from net/ipv4/devinet.c -- SIOCGIFADDR ioctl */
 		{
-		struct in_device *in_dev;
-		struct in_ifaddr *ifa;
 		__be32 addr = 0, mask = htonl(~0U); /* FIXME: is the mask correct? */
 #ifdef CONFIG_INET
+		struct in_device *in_dev;
+		struct in_ifaddr *ifa;
 		rcu_read_lock();
 		if ((in_dev = __in_dev_get_rcu(dev)) != NULL)
 		{
author
#1 lore raw

Wang Chen said the following on 2008-7-4 16:25:

Quoted 13 lines

Move the variables which only used in #ifdef to where they should be. Otherwise, "defined but not used" compile warning will go out.

---

drivers/net/wan/syncppp.c +0 -0
index 29b4b94..c938d4c 100644
@@ -763,10 +763,10 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb)
 	case CISCO_ADDR_REQ:
 		/* Stolen from net/ipv4/devinet.c -- SIOCGIFADDR ioctl */

drivers/net/wan/syncppp.c static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb) · line 772

Quoted 10 lines
drivers/net/wan/syncppp.c +2 -2
 		{
-		struct in_device *in_dev;
-		struct in_ifaddr *ifa;
 		__be32 addr = 0, mask = htonl(~0U); /* FIXME: is the mask correct? */
 #ifdef CONFIG_INET
+		struct in_device *in_dev;
+		struct in_ifaddr *ifa;
 		rcu_read_lock();
 		if ((in_dev = __in_dev_get_rcu(dev)) != NULL)
 		{

Jeff, will you take this?