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>
This commit is contained in:
parent
1ee86555b2
commit
6098d10749
|
@ -137,14 +137,18 @@
|
|||
|
||||
#ifdef CONFIG_INFINIBAND_NES_DEBUG
|
||||
#define nes_debug(level, fmt, args...) \
|
||||
do { \
|
||||
if (level & nes_debug_level) \
|
||||
printk(KERN_ERR PFX "%s[%u]: " fmt, __func__, __LINE__, ##args)
|
||||
printk(KERN_ERR PFX "%s[%u]: " fmt, __func__, __LINE__, ##args); \
|
||||
} while (0)
|
||||
|
||||
#define assert(expr) \
|
||||
if (!(expr)) { \
|
||||
printk(KERN_ERR PFX "Assertion failed! %s, %s, %s, line %d\n", \
|
||||
#expr, __FILE__, __func__, __LINE__); \
|
||||
}
|
||||
#define assert(expr) \
|
||||
do { \
|
||||
if (!(expr)) { \
|
||||
printk(KERN_ERR PFX "Assertion failed! %s, %s, %s, line %d\n", \
|
||||
#expr, __FILE__, __func__, __LINE__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define NES_EVENT_TIMEOUT 1200000
|
||||
#else
|
||||
|
|
|
@ -92,7 +92,7 @@ static int mini_cm_dealloc_core(struct nes_cm_core *);
|
|||
static int mini_cm_get(struct nes_cm_core *);
|
||||
static int mini_cm_set(struct nes_cm_core *, u32, u32);
|
||||
|
||||
static struct sk_buff *form_cm_frame(struct sk_buff *, struct nes_cm_node *,
|
||||
static void form_cm_frame(struct sk_buff *, struct nes_cm_node *,
|
||||
void *, u32, void *, u32, u8);
|
||||
static struct sk_buff *get_free_pkt(struct nes_cm_node *cm_node);
|
||||
static 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)
|
|||
* form_cm_frame - get a free packet and build empty frame Use
|
||||
* node info to build.
|
||||
*/
|
||||
static struct sk_buff *form_cm_frame(struct sk_buff *skb,
|
||||
static void form_cm_frame(struct sk_buff *skb,
|
||||
struct nes_cm_node *cm_node, void *options, u32 optionsize,
|
||||
void *data, u32 datasize, u8 flags)
|
||||
{
|
||||
|
@ -339,7 +339,6 @@ static struct sk_buff *form_cm_frame(struct sk_buff *skb,
|
|||
skb_shinfo(skb)->nr_frags = 0;
|
||||
cm_packets_created++;
|
||||
|
||||
return skb;
|
||||
}
|
||||
|
||||
|
||||
|
@ -381,8 +380,6 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb,
|
|||
int ret = 0;
|
||||
u32 was_timer_set;
|
||||
|
||||
if (!cm_node)
|
||||
return -EINVAL;
|
||||
new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC);
|
||||
if (!new_send)
|
||||
return -1;
|
||||
|
@ -1325,7 +1322,6 @@ static void drop_packet(struct sk_buff *skb)
|
|||
static void handle_fin_pkt(struct nes_cm_node *cm_node, struct sk_buff *skb,
|
||||
struct tcphdr *tcph)
|
||||
{
|
||||
atomic_inc(&cm_resets_recvd);
|
||||
nes_debug(NES_DBG_CM, "Received FIN, cm_node = %p, state = %u. "
|
||||
"refcnt=%d\n", cm_node, cm_node->state,
|
||||
atomic_read(&cm_node->ref_count));
|
||||
|
|
Loading…
Reference in New Issue