Linux: -Wparentheses in lib/test_user_copy.c

Created on 3 Oct 2019  路  2Comments  路  Source: ClangBuiltLinux/linux

lib/test_user_copy.c:96:10: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if (ret |= test(umem_src == NULL, "kmalloc failed"))
            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/test_user_copy.c:96:10: note: place parentheses around the assignment to silence this warning
        if (ret |= test(umem_src == NULL, "kmalloc failed"))
                ^
            (                                              )
lib/test_user_copy.c:96:10: note: use '!=' to turn this compound assignment into an inequality comparison
        if (ret |= test(umem_src == NULL, "kmalloc failed"))
                ^~
                !=

Patch sent: https://lore.kernel.org/lkml/[email protected]/

-Wparentheses [BUG] linux-next [FIXED][LINUX] -next

Most helpful comment

All 2 comments

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nickdesaulniers picture nickdesaulniers  路  3Comments

nickdesaulniers picture nickdesaulniers  路  5Comments

tpgxyz picture tpgxyz  路  4Comments

nathanchance picture nathanchance  路  4Comments

nickdesaulniers picture nickdesaulniers  路  4Comments