Skip to contentSkip to conversation

hw/9pfs: Fix missing parentheses

PATCH In review Stefan Weil 2 participants 2 messages Oct 17, 2011 – Oct 18, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/9pfs: Fix missing parentheses

cppcheck report:
hw/9pfs/virtio-9p.c:2385:
style: Boolean result is used in bitwise operation. Clarify expression with parentheses
hw/9pfs/virtio-9p.c:2531:
style: Boolean result is used in bitwise operation. Clarify expression with parentheses

Cc Aneesh Kumar K.V <[email protected]>
---
 hw/9pfs/virtio-9p.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
hw/9pfs/virtio-9p.c +2 -2
index c01c31a..df0b22a 100644
@@ -2382,7 +2382,7 @@ static void v9fs_remove(void *opaque)
         goto out_nofid;
     }
     /* if fs driver is not path based, return EOPNOTSUPP */
-    if (!pdu->s->ctx.flags & PATHNAME_FSCONTEXT) {
+    if (!(pdu->s->ctx.flags & PATHNAME_FSCONTEXT)) {
         err = -EOPNOTSUPP;
         goto out_err;
     }
@@ -2528,7 +2528,7 @@ static void v9fs_rename(void *opaque)
     }
     BUG_ON(fidp->fid_type != P9_FID_NONE);
     /* if fs driver is not path based, return EOPNOTSUPP */
-    if (!pdu->s->ctx.flags & PATHNAME_FSCONTEXT) {
+    if (!(pdu->s->ctx.flags & PATHNAME_FSCONTEXT)) {
         err = -EOPNOTSUPP;
         goto out;
     }
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 28 lines · Stefan Weil

cppcheck report:
hw/9pfs/virtio-9p.c:2385:
style: Boolean result is used in bitwise operation. Clarify expression with parentheses
hw/9pfs/virtio-9p.c:2531:
style: Boolean result is used in bitwise operation. Clarify expression with parentheses

Cc Aneesh Kumar K.V <[email protected]>
---
 hw/9pfs/virtio-9p.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
hw/9pfs/virtio-9p.c +1 -1
index c01c31a..df0b22a 100644
@@ -2382,7 +2382,7 @@ static void v9fs_remove(void *opaque)
         goto out_nofid;
     }
     /* if fs driver is not path based, return EOPNOTSUPP */
-    if (!pdu->s->ctx.flags & PATHNAME_FSCONTEXT) {
+    if (!(pdu->s->ctx.flags & PATHNAME_FSCONTEXT)) {
         err = -EOPNOTSUPP;
         goto out_err;
     }

hw/9pfs/virtio-9p.c static void v9fs_rename(void *opaque) · line 2534

Quoted 8 lines
hw/9pfs/virtio-9p.c +1 -1
@@ -2528,7 +2528,7 @@ static void v9fs_rename(void *opaque)
     }
     BUG_ON(fidp->fid_type != P9_FID_NONE);
     /* if fs driver is not path based, return EOPNOTSUPP */
-    if (!pdu->s->ctx.flags & PATHNAME_FSCONTEXT) {
+    if (!(pdu->s->ctx.flags & PATHNAME_FSCONTEXT)) {
         err = -EOPNOTSUPP;
         goto out;
     }

This is fixed in the new pull request i sent.

http://article.gmane.org/gmane.comp.emulators.qemu/120990
http://repo.or.cz/w/qemu/v9fs.git/commitdiff/c98f1d4a8bb6f779313043d2490093451cf52065?hp=7cca27dfde6435a7846d88e8a1fa927d0ab99919

-aneesh