Re: [PATCH] Revert "platform/x86/toshiba-apci.c possible bad if test?"

From: Ari Sundholm
Date: Wed Aug 20 2014 - 14:17:00 EST



On Wed, 20 Aug 2014, Ari Sundholm wrote:

> - if (sscanf(buf, "%i", &mode) != 1 || (mode != 2 || mode != 1))
> + if (sscanf(buf, "%i", &mode) != 1 && (mode != 2 || mode != 1))
> return -EINVAL;

Note that the condition still looks wrong even after the revert, as
(mode != 2 || mode != 1) is always true. Anybody guess what the actual
intent was?

Best regards,
Ari Sundholm
asundhol@xxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/