aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/dlci.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-09-23 01:40:09 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-26 21:34:29 -0400
commit807540baae406c84dcb9c1c8ef07a56d2d2ae84a (patch)
treeccd5c2cb57710dd6b73cf8df11eedf67abc14ae4 /drivers/net/wan/dlci.c
parentcb4dfe562cac6fcb544df752e40c1d78000d0712 (diff)
drivers/net: return operator cleanup
Change "return (EXPR);" to "return EXPR;" return is not a function, parentheses are not required. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan/dlci.c')
-rw-r--r--drivers/net/wan/dlci.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c
index 421d0715310e..1481a446fefb 100644
--- a/drivers/net/wan/dlci.c
+++ b/drivers/net/wan/dlci.c
@@ -97,11 +97,11 @@ static int dlci_header(struct sk_buff *skb, struct net_device *dev,
97 97
98 dest = skb_push(skb, hlen); 98 dest = skb_push(skb, hlen);
99 if (!dest) 99 if (!dest)
100 return(0); 100 return 0;
101 101
102 memcpy(dest, &hdr, hlen); 102 memcpy(dest, &hdr, hlen);
103 103
104 return(hlen); 104 return hlen;
105} 105}
106 106
107static void dlci_receive(struct sk_buff *skb, struct net_device *dev) 107static void dlci_receive(struct sk_buff *skb, struct net_device *dev)
@@ -211,14 +211,14 @@ static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, in
211 if (copy_from_user(&config, conf, sizeof(struct dlci_conf))) 211 if (copy_from_user(&config, conf, sizeof(struct dlci_conf)))
212 return -EFAULT; 212 return -EFAULT;
213 if (config.flags & ~DLCI_VALID_FLAGS) 213 if (config.flags & ~DLCI_VALID_FLAGS)
214 return(-EINVAL); 214 return -EINVAL;
215 memcpy(&dlp->config, &config, sizeof(struct dlci_conf)); 215 memcpy(&dlp->config, &config, sizeof(struct dlci_conf));
216 dlp->configured = 1; 216 dlp->configured = 1;
217 } 217 }
218 218
219 err = (*flp->dlci_conf)(dlp->slave, dev, get); 219 err = (*flp->dlci_conf)(dlp->slave, dev, get);
220 if (err) 220 if (err)
221 return(err); 221 return err;
222 222
223 if (get) 223 if (get)
224 { 224 {
@@ -226,7 +226,7 @@ static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, in
226 return -EFAULT; 226 return -EFAULT;
227 } 227 }
228 228
229 return(0); 229 return 0;
230} 230}
231 231
232static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 232static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
@@ -234,7 +234,7 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
234 struct dlci_local *dlp; 234 struct dlci_local *dlp;
235 235
236 if (!capable(CAP_NET_ADMIN)) 236 if (!capable(CAP_NET_ADMIN))
237 return(-EPERM); 237 return -EPERM;
238 238
239 dlp = netdev_priv(dev); 239 dlp = netdev_priv(dev);
240 240
@@ -242,7 +242,7 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
242 { 242 {
243 case DLCI_GET_SLAVE: 243 case DLCI_GET_SLAVE:
244 if (!*(short *)(dev->dev_addr)) 244 if (!*(short *)(dev->dev_addr))
245 return(-EINVAL); 245 return -EINVAL;
246 246
247 strncpy(ifr->ifr_slave, dlp->slave->name, sizeof(ifr->ifr_slave)); 247 strncpy(ifr->ifr_slave, dlp->slave->name, sizeof(ifr->ifr_slave));
248 break; 248 break;
@@ -250,15 +250,15 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
250 case DLCI_GET_CONF: 250 case DLCI_GET_CONF:
251 case DLCI_SET_CONF: 251 case DLCI_SET_CONF:
252 if (!*(short *)(dev->dev_addr)) 252 if (!*(short *)(dev->dev_addr))
253 return(-EINVAL); 253 return -EINVAL;
254 254
255 return(dlci_config(dev, ifr->ifr_data, cmd == DLCI_GET_CONF)); 255 return dlci_config(dev, ifr->ifr_data, cmd == DLCI_GET_CONF);
256 break; 256 break;
257 257
258 default: 258 default:
259 return(-EOPNOTSUPP); 259 return -EOPNOTSUPP;
260 } 260 }
261 return(0); 261 return 0;
262} 262}
263 263
264static int dlci_change_mtu(struct net_device *dev, int new_mtu) 264static int dlci_change_mtu(struct net_device *dev, int new_mtu)
@@ -277,15 +277,15 @@ static int dlci_open(struct net_device *dev)
277 dlp = netdev_priv(dev); 277 dlp = netdev_priv(dev);
278 278
279 if (!*(short *)(dev->dev_addr)) 279 if (!*(short *)(dev->dev_addr))
280 return(-EINVAL); 280 return -EINVAL;
281 281
282 if (!netif_running(dlp->slave)) 282 if (!netif_running(dlp->slave))
283 return(-ENOTCONN); 283 return -ENOTCONN;
284 284
285 flp = netdev_priv(dlp->slave); 285 flp = netdev_priv(dlp->slave);
286 err = (*flp->activate)(dlp->slave, dev); 286 err = (*flp->activate)(dlp->slave, dev);
287 if (err) 287 if (err)
288 return(err); 288 return err;
289 289
290 netif_start_queue(dev); 290 netif_start_queue(dev);
291 291
@@ -365,14 +365,14 @@ static int dlci_add(struct dlci_add *dlci)
365 list_add(&dlp->list, &dlci_devs); 365 list_add(&dlp->list, &dlci_devs);
366 rtnl_unlock(); 366 rtnl_unlock();
367 367
368 return(0); 368 return 0;
369 369
370 err2: 370 err2:
371 rtnl_unlock(); 371 rtnl_unlock();
372 free_netdev(master); 372 free_netdev(master);
373 err1: 373 err1:
374 dev_put(slave); 374 dev_put(slave);
375 return(err); 375 return err;
376} 376}
377 377
378static int dlci_del(struct dlci_add *dlci) 378static int dlci_del(struct dlci_add *dlci)
@@ -385,10 +385,10 @@ static int dlci_del(struct dlci_add *dlci)
385 /* validate slave device */ 385 /* validate slave device */
386 master = __dev_get_by_name(&init_net, dlci->devname); 386 master = __dev_get_by_name(&init_net, dlci->devname);
387 if (!master) 387 if (!master)
388 return(-ENODEV); 388 return -ENODEV;
389 389
390 if (netif_running(master)) { 390 if (netif_running(master)) {
391 return(-EBUSY); 391 return -EBUSY;
392 } 392 }
393 393
394 dlp = netdev_priv(master); 394 dlp = netdev_priv(master);
@@ -406,7 +406,7 @@ static int dlci_del(struct dlci_add *dlci)
406 } 406 }
407 rtnl_unlock(); 407 rtnl_unlock();
408 408
409 return(err); 409 return err;
410} 410}
411 411
412static int dlci_ioctl(unsigned int cmd, void __user *arg) 412static int dlci_ioctl(unsigned int cmd, void __user *arg)
@@ -415,7 +415,7 @@ static int dlci_ioctl(unsigned int cmd, void __user *arg)
415 int err; 415 int err;
416 416
417 if (!capable(CAP_NET_ADMIN)) 417 if (!capable(CAP_NET_ADMIN))
418 return(-EPERM); 418 return -EPERM;
419 419
420 if (copy_from_user(&add, arg, sizeof(struct dlci_add))) 420 if (copy_from_user(&add, arg, sizeof(struct dlci_add)))
421 return -EFAULT; 421 return -EFAULT;
@@ -438,7 +438,7 @@ static int dlci_ioctl(unsigned int cmd, void __user *arg)
438 err = -EINVAL; 438 err = -EINVAL;
439 } 439 }
440 440
441 return(err); 441 return err;
442} 442}
443 443
444static const struct header_ops dlci_header_ops = { 444static const struct header_ops dlci_header_ops = {