Patchwork [RFC,1/2] bt-l2cap: fix if statement with empty body, spotted by clang

login
register
mail settings
Submitter Blue Swirl
Date April 18, 2010, 8:51 a.m.
Message ID <u2nf43fc5581004180151ze489ed21s432b0531a2a1caf5@mail.gmail.com>
Download mbox | patch
Permalink /patch/50391/
State New
Headers show

Comments

Blue Swirl - April 18, 2010, 8:51 a.m.
Fix clang error:
  CC    bt-l2cap.o
/src/qemu/hw/bt-l2cap.c:1000:41: error: if statement has empty body
[-Wempty-body]
            /* TODO: Signal an error? */;

This means that l2cap_sframe_in() may now get called.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 hw/bt-l2cap.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/hw/bt-l2cap.c b/hw/bt-l2cap.c
index 70d731e..7e2f668 100644
--- a/hw/bt-l2cap.c
+++ b/hw/bt-l2cap.c
@@ -996,10 +996,10 @@  static void l2cap_iframe_in(struct l2cap_chan_s
*ch, uint16_t cid,
         l2cap_rexmit_enable(ch, !(hdr->data[0] >> 7));

     if (hdr->data[0] & 1) {
-        if (len != 4)
-            /* TODO: Signal an error? */;
+        if (len != 4) {
+            /* TODO: Signal an error? */
             return;
-
+        }
         return l2cap_sframe_in(ch, le16_to_cpup((void *) hdr->data));
     }