public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] libfdt: use logical "or" instead of bitwise "or" with boolean operands
@ 2022-03-16  6:02 Bill Wendling
  2022-03-16  7:43 ` Andrew Jones
  2022-03-18  9:36 ` Andrew Jones
  0 siblings, 2 replies; 7+ messages in thread
From: Bill Wendling @ 2022-03-16  6:02 UTC (permalink / raw)
  To: kvm, Nikos Nikoleris, Andrew Jones; +Cc: Bill Wendling

Clang warns about using a bitwise '|' with boolean operands. This seems
to be due to a small typo.

  lib/libfdt/fdt_rw.c:438:6: warning: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
          if (can_assume(LIBFDT_ORDER) |

Using '||' removes this warnings.

Signed-off-by: Bill Wendling <morbo@google.com>
---
 lib/libfdt/fdt_rw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libfdt/fdt_rw.c b/lib/libfdt/fdt_rw.c
index 13854253ff86..3320e5559cac 100644
--- a/lib/libfdt/fdt_rw.c
+++ b/lib/libfdt/fdt_rw.c
@@ -435,7 +435,7 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)
 			return struct_size;
 	}
 
-	if (can_assume(LIBFDT_ORDER) |
+	if (can_assume(LIBFDT_ORDER) ||
 	    !fdt_blocks_misordered_(fdt, mem_rsv_size, struct_size)) {
 		/* no further work necessary */
 		err = fdt_move(fdt, buf, bufsize);
-- 
2.35.1.723.g4982287a31-goog


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

end of thread, other threads:[~2022-03-22 13:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-16  6:02 [kvm-unit-tests PATCH] libfdt: use logical "or" instead of bitwise "or" with boolean operands Bill Wendling
2022-03-16  7:43 ` Andrew Jones
2022-03-16  7:53   ` Thomas Huth
2022-03-16 18:49     ` Bill Wendling
2022-03-18  9:36 ` Andrew Jones
2022-03-18 13:41   ` Andrew Jones
2022-03-22 13:44   ` Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox