]> git.baikalelectronics.ru Git - kernel.git/commit
dpaa_eth: Remove unnecessary boolean expression in dpaa_get_headroom
authorNathan Chancellor <natechancellor@gmail.com>
Tue, 10 Mar 2020 22:06:54 +0000 (15:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Mar 2020 20:36:56 +0000 (13:36 -0700)
commit3f49470b335f3f07c0aee03ba0378a06dae6012e
treeedc89c04527f05243f26540833dfea691ae73301
parentf18e1e2fdaa8b7b1d40d4cf4371df4c64eb4bacd
dpaa_eth: Remove unnecessary boolean expression in dpaa_get_headroom

Clang warns:

drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:2860:9: warning:
converting the result of '?:' with integer constants to a boolean always
evaluates to 'true' [-Wtautological-constant-compare]
        return DPAA_FD_DATA_ALIGNMENT ? ALIGN(headroom,
               ^
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:131:34: note: expanded
from macro 'DPAA_FD_DATA_ALIGNMENT'
\#define DPAA_FD_DATA_ALIGNMENT  (fman_has_errata_a050385() ? 64 : 16)
                                 ^
1 warning generated.

This was exposed by commit 0de6f31300b0 ("dpaa_eth: FMan erratum A050385
workaround") even though it appears to have been an issue since the
introductory commit 8535f4015c5c ("dpaa_eth: add support for DPAA
Ethernet") since DPAA_FD_DATA_ALIGNMENT has never been able to be zero.

Just replace the whole boolean expression with the true branch, as it is
always been true.

Link: https://github.com/ClangBuiltLinux/linux/issues/928
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c