Testing first we avoid enter the loop when count = 0.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
        if (type < HCI_ACLDATA_PKT || type > HCI_EVENT_PKT)
                return -EILSEQ;
 
-       do {
+       while (count) {
                rem = hci_reassembly(hdev, type, data, count,
                                                type - 1, GFP_ATOMIC);
                if (rem < 0)
 
                data += (count - rem);
                count = rem;
-       } while (count);
+       };
 
        return rem;
 }
        int type;
        int rem = 0;
 
-       do {
+       while (count) {
                struct sk_buff *skb = hdev->reassembly[STREAM_REASSEMBLY];
 
                if (!skb) {
 
                data += (count - rem);
                count = rem;
-       } while (count);
+       };
 
        return rem;
 }