Skip to contentSkip to conversation

mei: hbm: fix error in state check logic

char-misc 4.3 Tomas Winkler 2 participants 2 messages Sep 13, 2015 – Sep 21, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

From: Alexander Usyskin <[email protected]>

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")
---
 drivers/misc/mei/hbm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/mei/hbm.c +1 -1
index 8eec887c8f70..6d7c188fb65c 100644
@@ -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);
Signature · 1 line
2.4.3
#1 lore raw
Quoted 8 lines · Tomas Winkler

From: Alexander Usyskin <[email protected]>

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")

This isn't a commit id in Linus's tree anywhere, where did you get that number from? Please fix it and use a valid one.

thanks,

greg k-h