mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
net: return operator cleanup
Change "return (EXPR);" to "return EXPR;" return is not a function, parentheses are not required. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
6a08d194ee
commit
a02cec2155
84 changed files with 220 additions and 222 deletions
|
|
@ -243,7 +243,7 @@ static inline bool addrconf_qdisc_ok(const struct net_device *dev)
|
|||
/* Check if a route is valid prefix route */
|
||||
static inline int addrconf_is_prefix_route(const struct rt6_info *rt)
|
||||
{
|
||||
return ((rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0);
|
||||
return (rt->rt6i_flags & (RTF_GATEWAY | RTF_DEFAULT)) == 0;
|
||||
}
|
||||
|
||||
static void addrconf_del_timer(struct inet6_ifaddr *ifp)
|
||||
|
|
|
|||
|
|
@ -513,10 +513,9 @@ static int ip6addrlbl_dump(struct sk_buff *skb, struct netlink_callback *cb)
|
|||
|
||||
static inline int ip6addrlbl_msgsize(void)
|
||||
{
|
||||
return (NLMSG_ALIGN(sizeof(struct ifaddrlblmsg))
|
||||
return NLMSG_ALIGN(sizeof(struct ifaddrlblmsg))
|
||||
+ nla_total_size(16) /* IFAL_ADDRESS */
|
||||
+ nla_total_size(4) /* IFAL_LABEL */
|
||||
);
|
||||
+ nla_total_size(4); /* IFAL_LABEL */
|
||||
}
|
||||
|
||||
static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr* nlh,
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr,
|
|||
if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL)
|
||||
sin->sin6_scope_id = sk->sk_bound_dev_if;
|
||||
*uaddr_len = sizeof(*sin);
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(inet6_getname);
|
||||
|
|
@ -488,7 +488,7 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
|||
case SIOCADDRT:
|
||||
case SIOCDELRT:
|
||||
|
||||
return(ipv6_route_ioctl(net, cmd, (void __user *)arg));
|
||||
return ipv6_route_ioctl(net, cmd, (void __user *)arg);
|
||||
|
||||
case SIOCSIFADDR:
|
||||
return addrconf_add_ifaddr(net, (void __user *) arg);
|
||||
|
|
@ -502,7 +502,7 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
|||
return sk->sk_prot->ioctl(sk, cmd, arg);
|
||||
}
|
||||
/*NOTREACHED*/
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(inet6_ioctl);
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@ int ipv6_ext_hdr(u8 nexthdr)
|
|||
/*
|
||||
* find out if nexthdr is an extension header or a protocol
|
||||
*/
|
||||
return ( (nexthdr == NEXTHDR_HOP) ||
|
||||
return (nexthdr == NEXTHDR_HOP) ||
|
||||
(nexthdr == NEXTHDR_ROUTING) ||
|
||||
(nexthdr == NEXTHDR_FRAGMENT) ||
|
||||
(nexthdr == NEXTHDR_AUTH) ||
|
||||
(nexthdr == NEXTHDR_NONE) ||
|
||||
(nexthdr == NEXTHDR_DEST) );
|
||||
(nexthdr == NEXTHDR_DEST);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -870,8 +870,8 @@ static inline int ip6_rt_check(struct rt6key *rt_key,
|
|||
struct in6_addr *fl_addr,
|
||||
struct in6_addr *addr_cache)
|
||||
{
|
||||
return ((rt_key->plen != 128 || !ipv6_addr_equal(fl_addr, &rt_key->addr)) &&
|
||||
(addr_cache == NULL || !ipv6_addr_equal(fl_addr, addr_cache)));
|
||||
return (rt_key->plen != 128 || !ipv6_addr_equal(fl_addr, &rt_key->addr)) &&
|
||||
(addr_cache == NULL || !ipv6_addr_equal(fl_addr, addr_cache));
|
||||
}
|
||||
|
||||
static struct dst_entry *ip6_sk_dst_check(struct sock *sk,
|
||||
|
|
|
|||
|
|
@ -228,12 +228,12 @@ static struct nd_opt_hdr *ndisc_next_option(struct nd_opt_hdr *cur,
|
|||
do {
|
||||
cur = ((void *)cur) + (cur->nd_opt_len << 3);
|
||||
} while(cur < end && cur->nd_opt_type != type);
|
||||
return (cur <= end && cur->nd_opt_type == type ? cur : NULL);
|
||||
return cur <= end && cur->nd_opt_type == type ? cur : NULL;
|
||||
}
|
||||
|
||||
static inline int ndisc_is_useropt(struct nd_opt_hdr *opt)
|
||||
{
|
||||
return (opt->nd_opt_type == ND_OPT_RDNSS);
|
||||
return opt->nd_opt_type == ND_OPT_RDNSS;
|
||||
}
|
||||
|
||||
static struct nd_opt_hdr *ndisc_next_useropt(struct nd_opt_hdr *cur,
|
||||
|
|
@ -244,7 +244,7 @@ static struct nd_opt_hdr *ndisc_next_useropt(struct nd_opt_hdr *cur,
|
|||
do {
|
||||
cur = ((void *)cur) + (cur->nd_opt_len << 3);
|
||||
} while(cur < end && !ndisc_is_useropt(cur));
|
||||
return (cur <= end && ndisc_is_useropt(cur) ? cur : NULL);
|
||||
return cur <= end && ndisc_is_useropt(cur) ? cur : NULL;
|
||||
}
|
||||
|
||||
static struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len,
|
||||
|
|
@ -319,7 +319,7 @@ static inline u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p,
|
|||
int prepad = ndisc_addr_option_pad(dev->type);
|
||||
if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len + prepad))
|
||||
return NULL;
|
||||
return (lladdr + prepad);
|
||||
return lladdr + prepad;
|
||||
}
|
||||
|
||||
int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir)
|
||||
|
|
|
|||
|
|
@ -82,13 +82,13 @@ EXPORT_SYMBOL_GPL(ip6t_alloc_initial_table);
|
|||
int
|
||||
ip6t_ext_hdr(u8 nexthdr)
|
||||
{
|
||||
return ( (nexthdr == IPPROTO_HOPOPTS) ||
|
||||
(nexthdr == IPPROTO_ROUTING) ||
|
||||
(nexthdr == IPPROTO_FRAGMENT) ||
|
||||
(nexthdr == IPPROTO_ESP) ||
|
||||
(nexthdr == IPPROTO_AH) ||
|
||||
(nexthdr == IPPROTO_NONE) ||
|
||||
(nexthdr == IPPROTO_DSTOPTS) );
|
||||
return (nexthdr == IPPROTO_HOPOPTS) ||
|
||||
(nexthdr == IPPROTO_ROUTING) ||
|
||||
(nexthdr == IPPROTO_FRAGMENT) ||
|
||||
(nexthdr == IPPROTO_ESP) ||
|
||||
(nexthdr == IPPROTO_AH) ||
|
||||
(nexthdr == IPPROTO_NONE) ||
|
||||
(nexthdr == IPPROTO_DSTOPTS);
|
||||
}
|
||||
|
||||
/* Returns whether matches rule or not. */
|
||||
|
|
|
|||
|
|
@ -764,7 +764,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
|
|||
return -EINVAL;
|
||||
|
||||
if (sin6->sin6_family && sin6->sin6_family != AF_INET6)
|
||||
return(-EAFNOSUPPORT);
|
||||
return -EAFNOSUPPORT;
|
||||
|
||||
/* port is the proto value [0..255] carried in nexthdr */
|
||||
proto = ntohs(sin6->sin6_port);
|
||||
|
|
@ -772,10 +772,10 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
|
|||
if (!proto)
|
||||
proto = inet->inet_num;
|
||||
else if (proto != inet->inet_num)
|
||||
return(-EINVAL);
|
||||
return -EINVAL;
|
||||
|
||||
if (proto > 255)
|
||||
return(-EINVAL);
|
||||
return -EINVAL;
|
||||
|
||||
daddr = &sin6->sin6_addr;
|
||||
if (np->sndflow) {
|
||||
|
|
@ -985,7 +985,7 @@ static int do_rawv6_setsockopt(struct sock *sk, int level, int optname,
|
|||
/* You may get strange result with a positive odd offset;
|
||||
RFC2292bis agrees with me. */
|
||||
if (val > 0 && (val&1))
|
||||
return(-EINVAL);
|
||||
return -EINVAL;
|
||||
if (val < 0) {
|
||||
rp->checksum = 0;
|
||||
} else {
|
||||
|
|
@ -997,7 +997,7 @@ static int do_rawv6_setsockopt(struct sock *sk, int level, int optname,
|
|||
break;
|
||||
|
||||
default:
|
||||
return(-ENOPROTOOPT);
|
||||
return -ENOPROTOOPT;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1190,7 +1190,7 @@ static int rawv6_init_sk(struct sock *sk)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct proto rawv6_prot = {
|
||||
|
|
|
|||
|
|
@ -217,14 +217,14 @@ static void ip6_dst_ifdown(struct dst_entry *dst, struct net_device *dev,
|
|||
|
||||
static __inline__ int rt6_check_expired(const struct rt6_info *rt)
|
||||
{
|
||||
return (rt->rt6i_flags & RTF_EXPIRES &&
|
||||
time_after(jiffies, rt->rt6i_expires));
|
||||
return (rt->rt6i_flags & RTF_EXPIRES) &&
|
||||
time_after(jiffies, rt->rt6i_expires);
|
||||
}
|
||||
|
||||
static inline int rt6_need_strict(struct in6_addr *daddr)
|
||||
{
|
||||
return (ipv6_addr_type(daddr) &
|
||||
(IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK));
|
||||
return ipv6_addr_type(daddr) &
|
||||
(IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -440,7 +440,7 @@ static struct rt6_info *rt6_select(struct fib6_node *fn, int oif, int strict)
|
|||
__func__, match);
|
||||
|
||||
net = dev_net(rt0->rt6i_dev);
|
||||
return (match ? match : net->ipv6.ip6_null_entry);
|
||||
return match ? match : net->ipv6.ip6_null_entry;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IPV6_ROUTE_INFO
|
||||
|
|
@ -859,7 +859,7 @@ int ip6_dst_blackhole(struct sock *sk, struct dst_entry **dstp, struct flowi *fl
|
|||
|
||||
dst_release(*dstp);
|
||||
*dstp = new;
|
||||
return (new ? 0 : -ENOMEM);
|
||||
return new ? 0 : -ENOMEM;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ip6_dst_blackhole);
|
||||
|
||||
|
|
@ -1070,7 +1070,7 @@ static int ip6_dst_gc(struct dst_ops *ops)
|
|||
net->ipv6.ip6_rt_gc_expire = rt_gc_timeout>>1;
|
||||
out:
|
||||
net->ipv6.ip6_rt_gc_expire -= net->ipv6.ip6_rt_gc_expire>>rt_elasticity;
|
||||
return (atomic_read(&ops->entries) > rt_max_size);
|
||||
return atomic_read(&ops->entries) > rt_max_size;
|
||||
}
|
||||
|
||||
/* Clean host part of a prefix. Not necessary in radix tree,
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
|
|||
return -EINVAL;
|
||||
|
||||
if (usin->sin6_family != AF_INET6)
|
||||
return(-EAFNOSUPPORT);
|
||||
return -EAFNOSUPPORT;
|
||||
|
||||
memset(&fl, 0, sizeof(fl));
|
||||
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ static inline int xfrm6_garbage_collect(struct dst_ops *ops)
|
|||
struct net *net = container_of(ops, struct net, xfrm.xfrm6_dst_ops);
|
||||
|
||||
xfrm6_policy_afinfo.garbage_collect(net);
|
||||
return (atomic_read(&ops->entries) > ops->gc_thresh * 2);
|
||||
return atomic_read(&ops->entries) > ops->gc_thresh * 2;
|
||||
}
|
||||
|
||||
static void xfrm6_update_pmtu(struct dst_entry *dst, u32 mtu)
|
||||
|
|
|
|||
Loading…
Reference in a new issue