All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm: core: Fix incorrect flag check
@ 2020-11-15 20:22 Marek Vasut
  2020-11-18 14:37 ` Simon Glass
  2020-11-30 20:15 ` Simon Glass
  0 siblings, 2 replies; 3+ messages in thread
From: Marek Vasut @ 2020-11-15 20:22 UTC (permalink / raw)
  To: u-boot

The test should be checking whether $flags are non-zero and $drv_flags
contain specific flags, however these two sets of flags are separate,
and the two tests should be logically ANDed, not bitwise ANDed.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
---
 drivers/core/device-remove.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c
index efdb0f2905..0924a575f5 100644
--- a/drivers/core/device-remove.c
+++ b/drivers/core/device-remove.c
@@ -152,7 +152,7 @@ void device_free(struct udevice *dev)
 static bool flags_remove(uint flags, uint drv_flags)
 {
 	if ((flags & DM_REMOVE_NORMAL) ||
-	    (flags & (drv_flags & (DM_FLAG_ACTIVE_DMA | DM_FLAG_OS_PREPARE))))
+	    (flags && (drv_flags & (DM_FLAG_ACTIVE_DMA | DM_FLAG_OS_PREPARE))))
 		return true;
 
 	return false;
-- 
2.29.2

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

* [PATCH] dm: core: Fix incorrect flag check
  2020-11-15 20:22 [PATCH] dm: core: Fix incorrect flag check Marek Vasut
@ 2020-11-18 14:37 ` Simon Glass
  2020-11-30 20:15 ` Simon Glass
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2020-11-18 14:37 UTC (permalink / raw)
  To: u-boot

On Sun, 15 Nov 2020 at 13:23, Marek Vasut <marek.vasut@gmail.com> wrote:
>
> The test should be checking whether $flags are non-zero and $drv_flags
> contain specific flags, however these two sets of flags are separate,
> and the two tests should be logically ANDed, not bitwise ANDed.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
> Cc: Simon Glass <sjg@chromium.org>
> ---
>  drivers/core/device-remove.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

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

* [PATCH] dm: core: Fix incorrect flag check
  2020-11-15 20:22 [PATCH] dm: core: Fix incorrect flag check Marek Vasut
  2020-11-18 14:37 ` Simon Glass
@ 2020-11-30 20:15 ` Simon Glass
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2020-11-30 20:15 UTC (permalink / raw)
  To: u-boot

On Sun, 15 Nov 2020 at 13:23, Marek Vasut <marek.vasut@gmail.com> wrote:
>
> The test should be checking whether $flags are non-zero and $drv_flags
> contain specific flags, however these two sets of flags are separate,
> and the two tests should be logically ANDed, not bitwise ANDed.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
> Cc: Simon Glass <sjg@chromium.org>
> ---
>  drivers/core/device-remove.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm, thanks!

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

end of thread, other threads:[~2020-11-30 20:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-15 20:22 [PATCH] dm: core: Fix incorrect flag check Marek Vasut
2020-11-18 14:37 ` Simon Glass
2020-11-30 20:15 ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.