[ewg] [PATCH 8/8 warnings] sdp_bcopy.c warning

Jack Morgenstein jackm at dev.mellanox.co.il
Thu Oct 25 01:05:43 PDT 2007


Jeremy,

Why did you remove the "likely" and "unlikely" macros?

Isn't the compiler warning just on the missing "!= NULL" ?

- Jack

On Saturday 06 October 2007 01:48, Jeremy Brown wrote:
> Tziporet, Vlad,
> 
> I've included the eighth of the eight warning fix patches.
> 
> Thanks!
> 
> Jeremy Brown
> 
> ---
> 
> recode to silence compiler warning
> 
> Signed-off-by: John Gregor <john.gregor at qlogic.com>
> 
> diff -r 140ba6d3ae7c drivers/infiniband/ulp/sdp/sdp_bcopy.c
> --- a/drivers/infiniband/ulp/sdp/sdp_bcopy.c	Wed May 30 16:21:38 2007 -0700
> +++ b/drivers/infiniband/ulp/sdp/sdp_bcopy.c	Wed May 30 16:28:57 2007 -0700
> @@ -347,8 +347,9 @@ static inline struct sk_buff *sdp_sock_q
>  	TCP_SKB_CB(skb)->seq = ssk->rcv_nxt;
>  	ssk->rcv_nxt += skb_len;
>  
> -	if (likely(skb_len && (tail = skb_peek_tail(&sk->sk_receive_queue))) &&
> -	    unlikely(skb_tailroom(tail) >= skb_len)) {
> +	if (skb_len &&
> +	    (tail = skb_peek_tail(&sk->sk_receive_queue)) != NULL &&
> +	    skb_tailroom(tail) >= skb_len) {
>  		skb_copy_bits(skb, 0, skb_put(tail, skb_len), skb_len);
>  		__kfree_skb(skb);
>  		skb = tail;
> 
> 
> _______________________________________________
> ewg mailing list
> ewg at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg
> 



More information about the ewg mailing list