[Drbd-dev] Avoid compiler warning about non-bool in logical expression

Lars Ellenberg lars.ellenberg at linbit.com
Wed Jun 12 16:10:21 CEST 2019


On Wed, Jun 05, 2019 at 10:07:51AM -0600, David Butterfield wrote:
> Avoid a compiler warning:
>     drbd_receiver.c:1693:12: warning: logical ‘and’ applied to non-boolean constant [-Wlogical-op]

I don't care.

> diff --git a/drbd/drbd_receiver.c b/drbd/drbd_receiver.c
> @@ -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);


More information about the drbd-dev mailing list