Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1223558

[char-misc 4.3] mei: hbm: fix error in state check logic

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!diesel.cu.mi.it!bofh.it!news.nic.it!robomod
From Tomas Winkler <tomas.winkler@intel.com>
Newsgroups linux.kernel
Subject [char-misc 4.3] mei: hbm: fix error in state check logic
Date Sun, 13 Sep 2015 09:40:01 +0200
Message-ID <q8a3f-12B-7@gated-at.bofh.it> (permalink)
X-Original-To Greg Kroah-Hartman <gregkh@linuxfoundation.org>
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.17,521,1437462000"; d="scan'208";a="804125409"
X-Mailer git-send-email 2.4.3
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 36
Organization linux.* mail to news gateway
X-Original-Cc Alexander Usyskin <alexander.usyskin@intel.com>, linux-kernel@vger.kernel.org, Tomas Winkler <tomas.winkler@intel.com>
X-Original-Date Sun, 13 Sep 2015 10:29:26 +0300
X-Original-Message-ID <1442129366-13061-1-git-send-email-tomas.winkler@intel.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1223558

Show key headers only | View raw


From: Alexander Usyskin <alexander.usyskin@intel.com>

Use || instead && in state check.
Latter is bogus and leads to following warning:

drivers/misc/mei/hbm.c:1212:46: warning: logical ‘and’ of mutually exclusive tests is always false [-Wlogical-op]

Fixes: 073e6274 ("mei: support for dynamic clients")
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/misc/mei/hbm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c
index 8eec887c8f70..6d7c188fb65c 100644
--- a/drivers/misc/mei/hbm.c
+++ b/drivers/misc/mei/hbm.c
@@ -1209,7 +1209,7 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
 		 * after the host receives the enum_resp
 		 * message clients may be added or removed
 		 */
-		if (dev->hbm_state <= MEI_HBM_ENUM_CLIENTS &&
+		if (dev->hbm_state <= MEI_HBM_ENUM_CLIENTS ||
 		    dev->hbm_state >= MEI_HBM_STOPPED) {
 			dev_err(dev->dev, "hbm: add client: state mismatch, [%d, %d]\n",
 				dev->dev_state, dev->hbm_state);
-- 
2.4.3

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

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[char-misc 4.3] mei: hbm: fix error in state check logic Tomas Winkler <tomas.winkler@intel.com> - 2015-09-13 09:40 +0200
  Re: [char-misc 4.3] mei: hbm: fix error in state check logic Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-09-21 07:50 +0200

csiph-web