Skip to content

Commit eef5a7c

Browse files
arndbdavem330
authored andcommitted
isdn: isdnloop: fix logic error in isdnloop_sendbuf
gcc-7 found an ancient bug in the loop driver, leading to a condition that is always false, meaning we ignore the contents of 'card->flags' here: drivers/isdn/isdnloop/isdnloop.c:412:37: error: ?: using integer constants in boolean context, the expression will always evaluate to 'true' [-Werror=int-in-bool-context] This changes the braces in the expression to ensure we actually compare the flag bits, rather than comparing a constant. As Joe Perches pointed out, an earlier patch of mine incorrectly assumed this was a false-positive warning. Cc: Joe Perches <joe@perches.com> Link: https://patchwork.kernel.org/patch/9840289/ Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ca2c141 commit eef5a7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/isdn/isdnloop/isdnloop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ isdnloop_sendbuf(int channel, struct sk_buff *skb, isdnloop_card *card)
409409
return -EINVAL;
410410
}
411411
if (len) {
412-
if (!(card->flags & (channel) ? ISDNLOOP_FLAGS_B2ACTIVE : ISDNLOOP_FLAGS_B1ACTIVE))
412+
if (!(card->flags & (channel ? ISDNLOOP_FLAGS_B2ACTIVE : ISDNLOOP_FLAGS_B1ACTIVE)))
413413
return 0;
414414
if (card->sndcount[channel] > ISDNLOOP_MAX_SQUEUE)
415415
return 0;

0 commit comments

Comments
 (0)