libfdt: use logical "or" instead of bitwise "or" with boolean operands
PATCH 1/1 libfdt: use logical "or" instead of bitwise "or" with boolean operands
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.
--- lib/libfdt/fdt_rw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/libfdt/fdt_rw.c +1 -1
@@ -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);
Signature · 1 line
2.35.1.723.g4982287a31-goog
Quoted 29 lines · 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 <[email protected]>--- lib/libfdt/fdt_rw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/libfdt/fdt_rw.c +1
-1@@ -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);Signature · 1 line
2.35.1.723.g4982287a31-goog
This is fixed in libfdt upstream with commit 7be250b4 ("libfdt:
Correct condition for reordering blocks"), which is in v1.6.1. We can either take this patch as a backport of 7be250b4 or we can rebase all of our libfdt to v1.6.1. Based on the number of fixes in v1.6.1, which appear to be mostly for compiling with later compilers, I'm in favor of rebasing.
Actually, we can also use this opportunity to [re]visit the idea of changing libfdt to a git submodule. I'd like to hear opinions on that.
Thanks,
drew
Quoted 22 lines · Andrew Jones
Quoted 21 lines · 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 <[email protected]>--- lib/libfdt/fdt_rw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/libfdt/fdt_rw.c +0
-0@@ -435,7 +435,7 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)return struct_size; }
Quoted 15 lines
Quoted 8 lines
lib/libfdt/fdt_rw.c +1
-1-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);Signature · 1 line
2.35.1.723.g4982287a31-googThis is fixed in libfdt upstream with commit
7be250b4("libfdt:
Correct condition for reordering blocks"), which is in v1.6.1. We can either take this patch as a backport of7be250b4or we can rebase all of our libfdt to v1.6.1. Based on the number of fixes in v1.6.1, which appear to be mostly for compiling with later compilers, I'm in favor of rebasing.
+1 for updating to v1.6.1 completely.
Quoted 3 lines
Actually, we can also use this opportunity to [re]visit the idea of changing libfdt to a git submodule. I'd like to hear opinions on that.
I'm always a little bit torn when it comes to this question. Sure, git submodules maybe make the update easier ... but they are a real pita when you're working with remote machines that might not have direct connection to the internet. For example, I'm used to rsync my sources to the non-x86 machines, and if you forget to update the submodule to the right state before the sync, you've just lost. So from my side, it's a preference for continuing without submodules (but I won't insist if everybody else wants to have them instead).
Thomas
Quoted 40 lines · Thomas Huth
Quoted 22 lines · Andrew Jones
Quoted 21 lines · 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 <[email protected]>--- lib/libfdt/fdt_rw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/libfdt/fdt_rw.c +0
-0@@ -435,7 +435,7 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)return struct_size; }Quoted 15 lines
Quoted 8 lines
lib/libfdt/fdt_rw.c +1
-2-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
This is fixed in libfdt upstream with commit
7be250b4("libfdt:
Correct condition for reordering blocks"), which is in v1.6.1. We can either take this patch as a backport of7be250b4or we can rebase all of our libfdt to v1.6.1. Based on the number of fixes in v1.6.1, which appear to be mostly for compiling with later compilers, I'm in favor of rebasing.
Quoted 2 lines
+1 for updating to v1.6.1 completely.
Also +1. :-) Thank you!
-bw
Quoted 15 lines
Quoted 3 lines
Actually, we can also use this opportunity to [re]visit the idea of changing libfdt to a git submodule. I'd like to hear opinions on that.
I'm always a little bit torn when it comes to this question. Sure, git submodules maybe make the update easier ... but they are a real pita when you're working with remote machines that might not have direct connection to the internet. For example, I'm used to rsync my sources to the non-x86 machines, and if you forget to update the submodule to the right state before the sync, you've just lost. So from my side, it's a preference for continuing without submodules (but I won't insist if everybody else wants to have them instead).
Thomas
Quoted 29 lines · 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 <[email protected]>--- lib/libfdt/fdt_rw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/libfdt/fdt_rw.c +1
-1@@ -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);Signature · 1 line
2.35.1.723.g4982287a31-goog
We're not getting as much interest in the submodule discussion as I hoped. I see one vote against on this thread and one vote for on a different thread[1]. For now I'll just commit a big rebase patch for libfdt. We can revisit it again after we decide what to do for QCBOR.
Thanks,
drew
Quoted 22 lines · Andrew Jones
Quoted 21 lines · 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 <[email protected]>--- lib/libfdt/fdt_rw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/libfdt/fdt_rw.c +0
-0@@ -435,7 +435,7 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)return struct_size; }
Quoted 14 lines
Quoted 8 lines
lib/libfdt/fdt_rw.c +1
-1-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);Signature · 1 line
2.35.1.723.g4982287a31-googWe're not getting as much interest in the submodule discussion as I hoped. I see one vote against on this thread and one vote for on a different thread[1]. For now I'll just commit a big rebase patch for libfdt. We can revisit it again after we decide what to do for QCBOR.
Now merged through misc/queue.
Thanks,
drew
Quoted 22 lines · Andrew Jones
Quoted 21 lines · 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 <[email protected]>--- lib/libfdt/fdt_rw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/libfdt/fdt_rw.c +0
-0@@ -435,7 +435,7 @@ int fdt_open_into(const void *fdt, void *buf, int bufsize)return struct_size; }
Quoted 13 lines
Quoted 8 lines
lib/libfdt/fdt_rw.c +1
-1-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);Signature · 1 line
2.35.1.723.g4982287a31-googWe're not getting as much interest in the submodule discussion as I hoped. I see one vote against on this thread and one vote for on a different thread[1]. For now I'll just commit a big rebase patch for libfdt. We can revisit it again after we decide what to do for QCBOR.
I recently learnt that there are indeed people who ship kvm-unit-tests with their distro - at least buildroot has a package:
https://git.busybox.net/buildroot/tree/package/kvm-unit-tests
So one more argument for copying the files over instead of using submodules:
The tarballs for tags will be self-contained, e.g.:
If we use submodules, I guess the content of the submodule content will be missing in there?
Thomas