summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@kernel.bkbits.net>2003-09-22 21:04:36 -0700
committerDavid S. Miller <davem@kernel.bkbits.net>2003-09-22 21:04:36 -0700
commit843a763d740fa12ebe6c50d44638670fcf881224 (patch)
treef6df69653f1ca1e5157c17482f2cc514ca5fb2ce /include
parent0873a5d658e715b0e6450339b5d0e3a8cdcb97b7 (diff)
parent9ca399c5774ffa81dfe45d722cc3daa6be4a9529 (diff)
Merge davem@nuts.ninka.net:/disk1/davem/BK/net-2.5
into kernel.bkbits.net:/home/davem/net-2.5
Diffstat (limited to 'include')
-rw-r--r--include/linux/rtnetlink.h32
-rw-r--r--include/net/atmclip.h8
2 files changed, 30 insertions, 10 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 502a1389f689..1141ec3c5321 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -618,7 +618,7 @@ enum
#include <linux/config.h>
-static __inline__ int rtattr_strcmp(struct rtattr *rta, char *str)
+static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
{
int len = strlen(str) + 1;
return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len);
@@ -642,8 +642,9 @@ extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics);
extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data);
#define RTA_PUT(skb, attrtype, attrlen, data) \
-({ if (skb_tailroom(skb) < (int)RTA_SPACE(attrlen)) goto rtattr_failure; \
- __rta_fill(skb, attrtype, attrlen, data); })
+({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \
+ goto rtattr_failure; \
+ __rta_fill(skb, attrtype, attrlen, data); })
static inline struct rtattr *
__rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
@@ -658,8 +659,9 @@ __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
}
#define __RTA_PUT(skb, attrtype, attrlen) \
-({ if (skb_tailroom(skb) < (int)RTA_SPACE(attrlen)) goto rtattr_failure; \
- __rta_reserve(skb, attrtype, attrlen); })
+({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \
+ goto rtattr_failure; \
+ __rta_reserve(skb, attrtype, attrlen); })
extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change);
@@ -681,11 +683,21 @@ extern void rtnl_lock(void);
extern void rtnl_unlock(void);
extern void rtnetlink_init(void);
-#define ASSERT_RTNL() do { if (down_trylock(&rtnl_sem) == 0) { up(&rtnl_sem); \
-printk("RTNL: assertion failed at " __FILE__ "(%d)\n", __LINE__); } \
- } while(0)
-#define BUG_TRAP(x) if (!(x)) { printk("KERNEL: assertion (" #x ") failed at " __FILE__ "(%d)\n", __LINE__); }
-
+#define ASSERT_RTNL() do { \
+ if (unlikely(down_trylock(&rtnl_sem) == 0)) { \
+ up(&rtnl_sem); \
+ printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \
+ __FILE__, __LINE__); \
+ dump_stack(); \
+ } \
+} while(0)
+
+#define BUG_TRAP(x) do { \
+ if (unlikely(!(x))) { \
+ printk(KERN_ERR "KERNEL: assertion (%s) failed at %s (%d)\n", \
+ #x, __FILE__ , __LINE__); \
+ } \
+} while(0)
#endif /* __KERNEL__ */
diff --git a/include/net/atmclip.h b/include/net/atmclip.h
index fdbbb71cdb0e..a9ec5e4fed66 100644
--- a/include/net/atmclip.h
+++ b/include/net/atmclip.h
@@ -67,7 +67,15 @@ struct atm_clip_ops {
};
void atm_clip_ops_set(struct atm_clip_ops *);
+#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE)
int try_atm_clip_ops(void);
+#else
+static inline int try_atm_clip_ops(void)
+{
+ return 0;
+}
+#endif
+
extern struct neigh_table *clip_tbl_hook;
extern struct atm_clip_ops *atm_clip_ops;