All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] armv8: ls1012a: correction in delay implementation
@ 2020-08-04 11:42 Chaitanya Sakinam
  2020-08-04 11:42 ` [PATCH] armv8: ls1012a: Avoid resource leak Chaitanya Sakinam
  0 siblings, 1 reply; 2+ messages in thread
From: Chaitanya Sakinam @ 2020-08-04 11:42 UTC (permalink / raw)
  To: u-boot

correction in delay implementation before we exit out of timeout.

Signed-off-by: Chaitanya Sakinam <chaitanya.sakinam@nxp.com>
---
 drivers/net/pfe_eth/pfe_eth.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/pfe_eth/pfe_eth.c b/drivers/net/pfe_eth/pfe_eth.c
index 6e22041..5bfcaa4 100644
--- a/drivers/net/pfe_eth/pfe_eth.c
+++ b/drivers/net/pfe_eth/pfe_eth.c
@@ -174,9 +174,10 @@ static int pfe_eth_send(struct udevice *dev, void *packet, int length)
 
 		udelay(100);
 		i++;
-		if (i == 30000)
+		if (i == 30000) {
 			printf("Tx timeout, send failed\n");
-		break;
+			break;
+		}
 	}
 
 	return 0;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] armv8: ls1012a: Avoid resource leak
  2020-08-04 11:42 [PATCH] armv8: ls1012a: correction in delay implementation Chaitanya Sakinam
@ 2020-08-04 11:42 ` Chaitanya Sakinam
  0 siblings, 0 replies; 2+ messages in thread
From: Chaitanya Sakinam @ 2020-08-04 11:42 UTC (permalink / raw)
  To: u-boot

PFE DDR addresses are now stored on to a stack varaiable rather
dynamic allocation.

Signed-off-by: Chaitanya Sakinam <chaitanya.sakinam@nxp.com>
---
 drivers/net/pfe_eth/pfe_eth.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/net/pfe_eth/pfe_eth.c b/drivers/net/pfe_eth/pfe_eth.c
index 6e22041..08d76bb 100644
--- a/drivers/net/pfe_eth/pfe_eth.c
+++ b/drivers/net/pfe_eth/pfe_eth.c
@@ -211,27 +211,22 @@ static int pfe_eth_recv(struct udevice *dev, int flags, uchar **packetp)
 static int pfe_eth_probe(struct udevice *dev)
 {
 	struct pfe_eth_dev *priv = dev_get_priv(dev);
-	struct pfe_ddr_address *pfe_addr;
+	struct pfe_ddr_address pfe_addr;
 	struct pfe_eth_pdata *pdata = dev_get_platdata(dev);
 	int ret = 0;
 	static int init_done;
 
 	if (!init_done) {
-		pfe_addr = (struct pfe_ddr_address *)malloc(sizeof
-						    (struct pfe_ddr_address));
-		if (!pfe_addr)
-			return -ENOMEM;
-
-		pfe_addr->ddr_pfe_baseaddr =
+		pfe_addr.ddr_pfe_baseaddr =
 				(void *)pdata->pfe_ddr_addr.ddr_pfe_baseaddr;
-		pfe_addr->ddr_pfe_phys_baseaddr =
+		pfe_addr.ddr_pfe_phys_baseaddr =
 		(unsigned long)pdata->pfe_ddr_addr.ddr_pfe_phys_baseaddr;
 
 		debug("ddr_pfe_baseaddr: %p, ddr_pfe_phys_baseaddr: %08x\n",
-		      pfe_addr->ddr_pfe_baseaddr,
-		      (u32)pfe_addr->ddr_pfe_phys_baseaddr);
+		      pfe_addr.ddr_pfe_baseaddr,
+		      (u32)pfe_addr.ddr_pfe_phys_baseaddr);
 
-		ret = pfe_drv_init(pfe_addr);
+		ret = pfe_drv_init(&pfe_addr);
 		if (ret)
 			return ret;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-04 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-04 11:42 [PATCH] armv8: ls1012a: correction in delay implementation Chaitanya Sakinam
2020-08-04 11:42 ` [PATCH] armv8: ls1012a: Avoid resource leak Chaitanya Sakinam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.