Commit 520191bb authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by David S. Miller

net: ipmr: adjust mroute.h style and drop extern

Remove extra spaces and tabs, adjust function definitions, remove an
unnecessary ifdef (already used below, just move code) and drop extern
from the functions.
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 06bd6c03
...@@ -9,38 +9,28 @@ ...@@ -9,38 +9,28 @@
#ifdef CONFIG_IP_MROUTE #ifdef CONFIG_IP_MROUTE
static inline int ip_mroute_opt(int opt) static inline int ip_mroute_opt(int opt)
{ {
return (opt >= MRT_BASE) && (opt <= MRT_MAX); return opt >= MRT_BASE && opt <= MRT_MAX;
} }
#else
static inline int ip_mroute_opt(int opt)
{
return 0;
}
#endif
#ifdef CONFIG_IP_MROUTE int ip_mroute_setsockopt(struct sock *, int, char __user *, unsigned int);
extern int ip_mroute_setsockopt(struct sock *, int, char __user *, unsigned int); int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg);
extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); int ipmr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg);
extern int ipmr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg); int ip_mr_init(void);
extern int ip_mr_init(void);
#else #else
static inline static inline int ip_mroute_setsockopt(struct sock *sock, int optname,
int ip_mroute_setsockopt(struct sock *sock, char __user *optval, unsigned int optlen)
int optname, char __user *optval, unsigned int optlen)
{ {
return -ENOPROTOOPT; return -ENOPROTOOPT;
} }
static inline static inline int ip_mroute_getsockopt(struct sock *sock, int optname,
int ip_mroute_getsockopt(struct sock *sock, char __user *optval, int __user *optlen)
int optname, char __user *optval, int __user *optlen)
{ {
return -ENOPROTOOPT; return -ENOPROTOOPT;
} }
static inline static inline int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg)
int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg)
{ {
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
...@@ -49,6 +39,11 @@ static inline int ip_mr_init(void) ...@@ -49,6 +39,11 @@ static inline int ip_mr_init(void)
{ {
return 0; return 0;
} }
static inline int ip_mroute_opt(int opt)
{
return 0;
}
#endif #endif
struct vif_device { struct vif_device {
...@@ -96,16 +91,16 @@ struct mfc_cache { ...@@ -96,16 +91,16 @@ struct mfc_cache {
struct rcu_head rcu; struct rcu_head rcu;
}; };
#define MFC_LINES 64 #define MFC_LINES 64
#ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN
#define MFC_HASH(a,b) (((((__force u32)(__be32)a)>>24)^(((__force u32)(__be32)b)>>26))&(MFC_LINES-1)) #define MFC_HASH(a,b) (((((__force u32)(__be32)a)>>24)^(((__force u32)(__be32)b)>>26))&(MFC_LINES-1))
#else #else
#define MFC_HASH(a,b) ((((__force u32)(__be32)a)^(((__force u32)(__be32)b)>>2))&(MFC_LINES-1)) #define MFC_HASH(a,b) ((((__force u32)(__be32)a)^(((__force u32)(__be32)b)>>2))&(MFC_LINES-1))
#endif #endif
struct rtmsg; struct rtmsg;
extern int ipmr_get_route(struct net *net, struct sk_buff *skb, int ipmr_get_route(struct net *net, struct sk_buff *skb,
__be32 saddr, __be32 daddr, __be32 saddr, __be32 daddr,
struct rtmsg *rtm, int nowait); struct rtmsg *rtm, int nowait);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment