Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -9
+2 -9
net/caif/caif_dev.c
··· 133 133 static int modemcmd(struct cflayer *layr, enum caif_modemcmd ctrl) 134 134 { 135 135 struct caif_device_entry *caifd; 136 - struct caif_dev_common *caifdev; 137 136 caifd = container_of(layr, struct caif_device_entry, layer); 138 - caifdev = netdev_priv(caifd->netdev); 139 137 if (ctrl == _CAIF_MODEMCMD_PHYIF_USEFULL) { 140 138 atomic_set(&caifd->in_use, 1); 141 139 wake_up_interruptible(&caifd->event); ··· 152 154 static int receive(struct sk_buff *skb, struct net_device *dev, 153 155 struct packet_type *pkttype, struct net_device *orig_dev) 154 156 { 155 - struct net *net; 156 157 struct cfpkt *pkt; 157 158 struct caif_device_entry *caifd; 158 - net = dev_net(dev); 159 159 pkt = cfpkt_fromnative(CAIF_DIR_IN, skb); 160 160 caifd = caif_get(dev); 161 161 if (!caifd || !caifd->layer.up || !caifd->layer.up->receive) ··· 191 195 struct caif_device_entry *caifd = NULL; 192 196 struct caif_dev_common *caifdev; 193 197 enum cfcnfg_phy_preference pref; 194 - int res = -EINVAL; 195 198 enum cfcnfg_phy_type phy_type; 196 199 197 200 if (dev->type != ARPHRD_CAIF) ··· 205 210 caifdev = netdev_priv(dev); 206 211 caifdev->flowctrl = dev_flowctrl; 207 212 atomic_set(&caifd->state, what); 208 - res = 0; 209 213 break; 210 214 211 215 case NETDEV_UP: ··· 268 274 _CAIF_CTRLCMD_PHYIF_DOWN_IND, 269 275 caifd->layer.id); 270 276 might_sleep(); 271 - res = wait_event_interruptible_timeout(caifd->event, 277 + wait_event_interruptible_timeout(caifd->event, 272 278 atomic_read(&caifd->in_use) == 0, 273 279 TIMEOUT); 274 280 break; ··· 338 344 static void caif_exit_net(struct net *net) 339 345 { 340 346 struct net_device *dev; 341 - int res; 342 347 rtnl_lock(); 343 348 for_each_netdev(net, dev) { 344 349 if (dev->type != ARPHRD_CAIF) 345 350 continue; 346 - res = dev_close(dev); 351 + dev_close(dev); 347 352 caif_device_destroy(dev); 348 353 } 349 354 rtnl_unlock();