diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-03-16 11:37:44 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2022-03-17 13:40:35 +0100 |
commit | 58e06d05d43a9e37e121edabaada00a9d844444c (patch) | |
tree | d1947a507739ab1d7799c574f236498fc838bf96 /net/ipv6 | |
parent | 435fe1c0c1f74b682dba85641406abf4337aade6 (diff) | |
download | linux-58e06d05d43a9e37e121edabaada00a9d844444c.tar.gz linux-58e06d05d43a9e37e121edabaada00a9d844444c.tar.bz2 linux-58e06d05d43a9e37e121edabaada00a9d844444c.zip |
net: stmmac: clean up impossible condition
This code works but it has a static checker warning:
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1687 init_dma_rx_desc_rings()
warn: always true condition '(queue >= 0) => (0-u32max >= 0)'
Obviously, it makes no sense to check if an unsigned int is >= 0. What
prevents this code from being a forever loop is that later there is a
separate check for if (queue == 0).
The "queue" variable is less than MTL_MAX_RX_QUEUES (8) so it can easily
fit in an int type. Any larger value for "queue" would lead to an array
overflow when we assign "rx_q = &priv->rx_queue[queue]".
Fixes: de0b90e52a11 ("net: stmmac: rearrange RX and TX desc init into per-queue basis")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220316083744.GB30941@kili
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/ipv6')
0 files changed, 0 insertions, 0 deletions