[PATCH v3 5/9] net: liteeth: do not set len to 0 before printing it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



'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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux