aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorChien Tung <chien.tin.tung@intel.com>2008-11-21 21:51:01 -0500
committerRoland Dreier <rolandd@cisco.com>2008-12-05 14:00:41 -0500
commit6098d107499e1335f899bfcb558253fb7ee4f73f (patch)
tree91887e03690c253ff5c591d5f95439c03fe113c1 /drivers/infiniband
parent1ee86555b2ad4d16a3c18253b7e4d70d34eb94f3 (diff)
RDMA/nes: Cleanup warnings
Wrap NES_DEBUG and assert macros with do while (0) to avoid ambiguous else. No one is using sk_buff * returned from form_cm_frame(), so drop the return. drop_packet() should not be incrementing reset counter on receiving a FIN. Signed-off-by: Chien Tung <chien.tin.tung@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/nes/nes.h18
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c8
2 files changed, 13 insertions, 13 deletions
diff --git a/drivers/infiniband/hw/nes/nes.h b/drivers/infiniband/hw/nes/nes.h
index 1595dc7bba9d..13a5bb1a7bcf 100644
--- a/drivers/infiniband/hw/nes/nes.h
+++ b/drivers/infiniband/hw/nes/nes.h
@@ -137,14 +137,18 @@
137 137
138#ifdef CONFIG_INFINIBAND_NES_DEBUG 138#ifdef CONFIG_INFINIBAND_NES_DEBUG
139#define nes_debug(level, fmt, args...) \ 139#define nes_debug(level, fmt, args...) \
140do { \
140 if (level & nes_debug_level) \ 141 if (level & nes_debug_level) \
141 printk(KERN_ERR PFX "%s[%u]: " fmt, __func__, __LINE__, ##args) 142 printk(KERN_ERR PFX "%s[%u]: " fmt, __func__, __LINE__, ##args); \
142 143} while (0)
143#define assert(expr) \ 144
144if (!(expr)) { \ 145#define assert(expr) \
145 printk(KERN_ERR PFX "Assertion failed! %s, %s, %s, line %d\n", \ 146do { \
146 #expr, __FILE__, __func__, __LINE__); \ 147 if (!(expr)) { \
147} 148 printk(KERN_ERR PFX "Assertion failed! %s, %s, %s, line %d\n", \
149 #expr, __FILE__, __func__, __LINE__); \
150 } \
151} while (0)
148 152
149#define NES_EVENT_TIMEOUT 1200000 153#define NES_EVENT_TIMEOUT 1200000
150#else 154#else
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index f241ca104d16..aa373c5f8d84 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -92,7 +92,7 @@ static int mini_cm_dealloc_core(struct nes_cm_core *);
92static int mini_cm_get(struct nes_cm_core *); 92static int mini_cm_get(struct nes_cm_core *);
93static int mini_cm_set(struct nes_cm_core *, u32, u32); 93static int mini_cm_set(struct nes_cm_core *, u32, u32);
94 94
95static struct sk_buff *form_cm_frame(struct sk_buff *, struct nes_cm_node *, 95static void form_cm_frame(struct sk_buff *, struct nes_cm_node *,
96 void *, u32, void *, u32, u8); 96 void *, u32, void *, u32, u8);
97static struct sk_buff *get_free_pkt(struct nes_cm_node *cm_node); 97static struct sk_buff *get_free_pkt(struct nes_cm_node *cm_node);
98static int add_ref_cm_node(struct nes_cm_node *); 98static int add_ref_cm_node(struct nes_cm_node *);
@@ -251,7 +251,7 @@ static int parse_mpa(struct nes_cm_node *cm_node, u8 *buffer, u32 len)
251 * form_cm_frame - get a free packet and build empty frame Use 251 * form_cm_frame - get a free packet and build empty frame Use
252 * node info to build. 252 * node info to build.
253 */ 253 */
254static struct sk_buff *form_cm_frame(struct sk_buff *skb, 254static void form_cm_frame(struct sk_buff *skb,
255 struct nes_cm_node *cm_node, void *options, u32 optionsize, 255 struct nes_cm_node *cm_node, void *options, u32 optionsize,
256 void *data, u32 datasize, u8 flags) 256 void *data, u32 datasize, u8 flags)
257{ 257{
@@ -339,7 +339,6 @@ static struct sk_buff *form_cm_frame(struct sk_buff *skb,
339 skb_shinfo(skb)->nr_frags = 0; 339 skb_shinfo(skb)->nr_frags = 0;
340 cm_packets_created++; 340 cm_packets_created++;
341 341
342 return skb;
343} 342}
344 343
345 344
@@ -381,8 +380,6 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb,
381 int ret = 0; 380 int ret = 0;
382 u32 was_timer_set; 381 u32 was_timer_set;
383 382
384 if (!cm_node)
385 return -EINVAL;
386 new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC); 383 new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC);
387 if (!new_send) 384 if (!new_send)
388 return -1; 385 return -1;
@@ -1325,7 +1322,6 @@ static void drop_packet(struct sk_buff *skb)
1325static void handle_fin_pkt(struct nes_cm_node *cm_node, struct sk_buff *skb, 1322static void handle_fin_pkt(struct nes_cm_node *cm_node, struct sk_buff *skb,
1326 struct tcphdr *tcph) 1323 struct tcphdr *tcph)
1327{ 1324{
1328 atomic_inc(&cm_resets_recvd);
1329 nes_debug(NES_DBG_CM, "Received FIN, cm_node = %p, state = %u. " 1325 nes_debug(NES_DBG_CM, "Received FIN, cm_node = %p, state = %u. "
1330 "refcnt=%d\n", cm_node, cm_node->state, 1326 "refcnt=%d\n", cm_node, cm_node->state,
1331 atomic_read(&cm_node->ref_count)); 1327 atomic_read(&cm_node->ref_count));