Skip to contentSkip to conversation

Avoid compiler warning about non-bool in logical expression

Drbd-dev David Butterfield 2 participants 2 messages Jun 5, 2019 – Jun 12, 2019 DRBD driver

lore
Share & tools
lore
#0 lore raw

Avoid a compiler warning:
drbd_receiver.c:1693:12: warning: logical ‘and’ applied to non-boolean constant [-Wlogical-op]

drbd/drbd_receiver.c +1 -1
@@ -1690,7 +1690,7 @@ next_bio:
                bio->bi_next = NULL;
 
                /* strip off REQ_UNPLUG unless it is the last bio */
-               if (bios && DRBD_REQ_UNPLUG)
+               if (bios && (DRBD_REQ_UNPLUG != 0))
                        bio->bi_opf &= ~DRBD_REQ_UNPLUG;
                drbd_generic_make_request(device, fault_type, bio);
 
maintainer
#1 lore raw
Quoted 2 lines · David Butterfield

Avoid a compiler warning:
drbd_receiver.c:1693:12: warning: logical ‘and’ applied to non-boolean constant [-Wlogical-op]

I don't care.

Quoted 9 lines
drbd/drbd_receiver.c +1 -1
@@ -1690,7 +1690,7 @@ next_bio:
                bio->bi_next = NULL;
 
                /* strip off REQ_UNPLUG unless it is the last bio */
-               if (bios && DRBD_REQ_UNPLUG)
+               if (bios && (DRBD_REQ_UNPLUG != 0))
                        bio->bi_opf &= ~DRBD_REQ_UNPLUG;
                drbd_generic_make_request(device, fault_type, bio);