aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-04-17 19:57:55 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-17 19:57:55 -0400
commit056693a38e56c520e208409d221cbc077282c19d (patch)
treec931d434d588f1de20dd0557488565135c9d6895
parentb8ee8328bac0d8420d2b9ef4838d0df25df100ab (diff)
caif: Fix set-but-unused variables.
The variable 'caifdef' is set but unused in modemcmd(). Similarly for 'net' in receive(), and 'res' in caif_device_notify() and caif_exit_net(). Just kill them off. Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/caif/caif_dev.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
index a518fdd4da0a..75e00d59eb49 100644
--- a/net/caif/caif_dev.c
+++ b/net/caif/caif_dev.c
@@ -133,9 +133,7 @@ static int transmit(struct cflayer *layer, struct cfpkt *pkt)
133static int modemcmd(struct cflayer *layr, enum caif_modemcmd ctrl) 133static int modemcmd(struct cflayer *layr, enum caif_modemcmd ctrl)
134{ 134{
135 struct caif_device_entry *caifd; 135 struct caif_device_entry *caifd;
136 struct caif_dev_common *caifdev;
137 caifd = container_of(layr, struct caif_device_entry, layer); 136 caifd = container_of(layr, struct caif_device_entry, layer);
138 caifdev = netdev_priv(caifd->netdev);
139 if (ctrl == _CAIF_MODEMCMD_PHYIF_USEFULL) { 137 if (ctrl == _CAIF_MODEMCMD_PHYIF_USEFULL) {
140 atomic_set(&caifd->in_use, 1); 138 atomic_set(&caifd->in_use, 1);
141 wake_up_interruptible(&caifd->event); 139 wake_up_interruptible(&caifd->event);
@@ -154,10 +152,8 @@ static int modemcmd(struct cflayer *layr, enum caif_modemcmd ctrl)
154static int receive(struct sk_buff *skb, struct net_device *dev, 152static int receive(struct sk_buff *skb, struct net_device *dev,
155 struct packet_type *pkttype, struct net_device *orig_dev) 153 struct packet_type *pkttype, struct net_device *orig_dev)
156{ 154{
157 struct net *net;
158 struct cfpkt *pkt; 155 struct cfpkt *pkt;
159 struct caif_device_entry *caifd; 156 struct caif_device_entry *caifd;
160 net = dev_net(dev);
161 pkt = cfpkt_fromnative(CAIF_DIR_IN, skb); 157 pkt = cfpkt_fromnative(CAIF_DIR_IN, skb);
162 caifd = caif_get(dev); 158 caifd = caif_get(dev);
163 if (!caifd || !caifd->layer.up || !caifd->layer.up->receive) 159 if (!caifd || !caifd->layer.up || !caifd->layer.up->receive)
@@ -195,7 +191,6 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
195 struct caif_device_entry *caifd = NULL; 191 struct caif_device_entry *caifd = NULL;
196 struct caif_dev_common *caifdev; 192 struct caif_dev_common *caifdev;
197 enum cfcnfg_phy_preference pref; 193 enum cfcnfg_phy_preference pref;
198 int res = -EINVAL;
199 enum cfcnfg_phy_type phy_type; 194 enum cfcnfg_phy_type phy_type;
200 195
201 if (dev->type != ARPHRD_CAIF) 196 if (dev->type != ARPHRD_CAIF)
@@ -210,7 +205,6 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
210 caifdev = netdev_priv(dev); 205 caifdev = netdev_priv(dev);
211 caifdev->flowctrl = dev_flowctrl; 206 caifdev->flowctrl = dev_flowctrl;
212 atomic_set(&caifd->state, what); 207 atomic_set(&caifd->state, what);
213 res = 0;
214 break; 208 break;
215 209
216 case NETDEV_UP: 210 case NETDEV_UP:
@@ -274,7 +268,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
274 _CAIF_CTRLCMD_PHYIF_DOWN_IND, 268 _CAIF_CTRLCMD_PHYIF_DOWN_IND,
275 caifd->layer.id); 269 caifd->layer.id);
276 might_sleep(); 270 might_sleep();
277 res = wait_event_interruptible_timeout(caifd->event, 271 wait_event_interruptible_timeout(caifd->event,
278 atomic_read(&caifd->in_use) == 0, 272 atomic_read(&caifd->in_use) == 0,
279 TIMEOUT); 273 TIMEOUT);
280 break; 274 break;
@@ -344,12 +338,11 @@ static int caif_init_net(struct net *net)
344static void caif_exit_net(struct net *net) 338static void caif_exit_net(struct net *net)
345{ 339{
346 struct net_device *dev; 340 struct net_device *dev;
347 int res;
348 rtnl_lock(); 341 rtnl_lock();
349 for_each_netdev(net, dev) { 342 for_each_netdev(net, dev) {
350 if (dev->type != ARPHRD_CAIF) 343 if (dev->type != ARPHRD_CAIF)
351 continue; 344 continue;
352 res = dev_close(dev); 345 dev_close(dev);
353 caif_device_destroy(dev); 346 caif_device_destroy(dev);
354 } 347 }
355 rtnl_unlock(); 348 rtnl_unlock();