mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Jiri Kosina <jkosina@suse.cz>
Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org
Subject: Compiler warning about comparing result of !!test_bit() to an integer
Date: Mon, 27 Apr 2015 15:13:23 +0100	[thread overview]
Message-ID: <8828.1430144003@warthog.procyon.org.uk> (raw)

Hi Jiri,

This line in hid-input.c:

	if (usage->type == EV_KEY && !!test_bit(usage->code, input->key) != value)
		input_event(input, EV_MSC, MSC_SCAN, usage->hid);

gives:

../drivers/hid/hid-input.c: In function 'hidinput_hid_event':
../drivers/hid/hid-input.c:1160:167: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]

with gcc-5.1.  Given that 'value' doesn't appear to be a boolean, is this correct?

This was introduced by commit c01d50d181f074a60bf3ed54eb055ce1679afb98.

David

             reply	other threads:[~2015-04-27 14:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 14:13 David Howells [this message]
2015-04-27 14:25 ` Jiri Kosina
2015-04-27 15:17 ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8828.1430144003@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®