qlge: Fix compilation warning
authorHarish Patil <harish.patil@qlogic.com>
Thu, 18 Sep 2014 21:27:24 +0000 (17:27 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Sep 2014 18:35:33 +0000 (14:35 -0400)
Fix the below warning message:
qlge_main.c:1754: warning: 'lbq_desc' may be used uninitialized in this function

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlge/qlge_main.c

index 3e96f269150d197253fdcdf3066c1a2da5b62985..6c904a6cad2a177036b42190cffb17a25e194708 100644 (file)
@@ -1922,7 +1922,7 @@ static struct sk_buff *ql_build_rx_skb(struct ql_adapter *qdev,
                        sbq_desc->p.skb = NULL;
                        skb_reserve(skb, NET_IP_ALIGN);
                }
-               while (length > 0) {
+               do {
                        lbq_desc = ql_get_curr_lchunk(qdev, rx_ring);
                        size = (length < rx_ring->lbq_buf_size) ? length :
                                rx_ring->lbq_buf_size;
@@ -1939,7 +1939,7 @@ static struct sk_buff *ql_build_rx_skb(struct ql_adapter *qdev,
                        skb->truesize += size;
                        length -= size;
                        i++;
-               }
+               } while (length > 0);
                ql_update_mac_hdr_len(qdev, ib_mac_rsp, lbq_desc->p.pg_chunk.va,
                                      &hlen);
                __pskb_pull_tail(skb, hlen);