From: Colin Ian King <colin.king@canonical.com>
To: "Winkler, Tomas" <tomas.winkler@intel.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mei: fix incorrect logical operator in if statement
Date: Wed, 20 Dec 2017 09:10:14 +0000 [thread overview]
Message-ID: <fbefeafe-50d6-2c1f-aecb-f334c9e555e6@canonical.com> (raw)
In-Reply-To: <5B8DA87D05A7694D9FA63FD143655C1B74A82576@hasmsx108.ger.corp.intel.com>
On 20/12/17 08:58, Winkler, Tomas wrote:
>
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The current expression using the || operator is always true because
>> dev->dev_state cannot be equal to two different values at the same time.
>> Fix this by replacing the || with &&.
>>
>> Detected by CoverityScan, CID#1463042 ("Constant expression result")
>>
>> Fixes: 8d52af6795c0 ("mei: speed up the power down flow")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Shame on me.
No worries, that's why I run static analysis linux-next.
> Ack.
> Tomas
>
>> ---
>> drivers/misc/mei/hw-me.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index
>> 0b21f9ec00f5..334ab02e1de2 100644
>> --- a/drivers/misc/mei/hw-me.c
>> +++ b/drivers/misc/mei/hw-me.c
>> @@ -1261,7 +1261,7 @@ irqreturn_t mei_me_irq_thread_handler(int irq,
>> void *dev_id)
>> break;
>>
>> if (rets &&
>> - (dev->dev_state != MEI_DEV_RESETTING ||
>> + (dev->dev_state != MEI_DEV_RESETTING &&
>> dev->dev_state != MEI_DEV_POWER_DOWN)) {
>> dev_err(dev->dev, "mei_irq_read_handler ret =
>> %d.\n",
>> rets);
>> --
>> 2.14.1
>
> N�����r��y���b�X��ǧv�^�){.n�+���z�ޖ6���+�)���w*\x1fjg���\x1e�����ݢj/���z�ޖ��2�ޙ���&�)ߡ�a��\x7f��\x1e�G���h�\x0f�j:+v���w�٥
>
prev parent reply other threads:[~2017-12-20 9:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-19 17:35 Colin King
2017-12-20 8:58 ` Winkler, Tomas
2017-12-20 9:10 ` Colin Ian King [this message]
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=fbefeafe-50d6-2c1f-aecb-f334c9e555e6@canonical.com \
--to=colin.king@canonical.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tomas.winkler@intel.com \
/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®