fbdev: bfin-t350mcqb-fb: avoid unused warnings in backlight code
[safe/jmp/linux-2.6] / drivers / bluetooth / hci_ll.c
index b91d45a..fb8445c 100644 (file)
@@ -163,8 +163,7 @@ static int ll_close(struct hci_uart *hu)
        skb_queue_purge(&ll->tx_wait_q);
        skb_queue_purge(&ll->txq);
 
-       if (ll->rx_skb)
-               kfree_skb(ll->rx_skb);
+       kfree_skb(ll->rx_skb);
 
        hu->priv = NULL;
 
@@ -403,7 +402,7 @@ static int ll_recv(struct hci_uart *hu, void *data, int count)
                                continue;
 
                        case HCILL_W4_EVENT_HDR:
-                               eh = (struct hci_event_hdr *) ll->rx_skb->data;
+                               eh = hci_event_hdr(ll->rx_skb);
 
                                BT_DBG("Event header: evt 0x%2.2x plen %d", eh->evt, eh->plen);
 
@@ -411,7 +410,7 @@ static int ll_recv(struct hci_uart *hu, void *data, int count)
                                continue;
 
                        case HCILL_W4_ACL_HDR:
-                               ah = (struct hci_acl_hdr *) ll->rx_skb->data;
+                               ah = hci_acl_hdr(ll->rx_skb);
                                dlen = __le16_to_cpu(ah->dlen);
 
                                BT_DBG("ACL header: dlen %d", dlen);
@@ -420,7 +419,7 @@ static int ll_recv(struct hci_uart *hu, void *data, int count)
                                continue;
 
                        case HCILL_W4_SCO_HDR:
-                               sh = (struct hci_sco_hdr *) ll->rx_skb->data;
+                               sh = hci_sco_hdr(ll->rx_skb);
 
                                BT_DBG("SCO header: dlen %d", sh->dlen);
 
@@ -492,7 +491,7 @@ static int ll_recv(struct hci_uart *hu, void *data, int count)
                        BT_ERR("Can't allocate mem for new packet");
                        ll->rx_state = HCILL_W4_PACKET_TYPE;
                        ll->rx_count = 0;
-                       return 0;
+                       return -ENOMEM;
                }
 
                ll->rx_skb->dev = (void *) hu->hdev;