'len' is set to 0 before it is printed, so printing it doesn't give any information. Drop this and print the erroneous len instead. Also, do not initialize 'len' initially as this initialization value is never used. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- drivers/net/liteeth.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/liteeth.c b/drivers/net/liteeth.c index 0d63e1da16..f8a3ed4a59 100644 --- a/drivers/net/liteeth.c +++ b/drivers/net/liteeth.c @@ -214,7 +214,7 @@ static int liteeth_eth_rx(struct eth_device *edev) { struct liteeth *priv = edev->priv; u8 rx_slot; - int len = 0; + int len; u8 reg; reg = litex_read8(priv->base + LITEETH_WRITER_EV_PENDING); @@ -224,7 +224,6 @@ static int liteeth_eth_rx(struct eth_device *edev) len = litex_read32(priv->base + LITEETH_WRITER_LENGTH); if (len == 0 || len > PKTSIZE) { - len = 0; dev_err(priv->dev, "%s: invalid len %d\n", __func__, len); litex_write8(priv->base + LITEETH_WRITER_EV_PENDING, reg); goto done; -- 2.39.2