mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [char-misc 4.3] mei: hbm: fix error in state check logic
@ 2015-09-13  7:29 Tomas Winkler
  2015-09-21  5:44 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Tomas Winkler @ 2015-09-13  7:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alexander Usyskin, linux-kernel, Tomas Winkler

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [char-misc 4.3] mei: hbm: fix error in state check logic
  2015-09-13  7:29 [char-misc 4.3] mei: hbm: fix error in state check logic Tomas Winkler
@ 2015-09-21  5:44 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2015-09-21  5:44 UTC (permalink / raw)
  To: Tomas Winkler; +Cc: Alexander Usyskin, linux-kernel

On Sun, Sep 13, 2015 at 10:29:26AM +0300, Tomas Winkler wrote:
> 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")

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-21  5:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-13  7:29 [char-misc 4.3] mei: hbm: fix error in state check logic Tomas Winkler
2015-09-21  5:44 ` Greg Kroah-Hartman

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®