All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: fec: no need to test for the return type of of_property_read_u32
@ 2015-11-23 13:51 Saurabh Sengar
  2015-11-24 21:09 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Saurabh Sengar @ 2015-11-23 13:51 UTC (permalink / raw)
  To: davem, B38611, fabio.estevam, netdev, linux-kernel; +Cc: Saurabh Sengar

in case of error no need to set num_tx and num_rx = 1, because in case of error
these variables will remain unchanged by of_property_read_u32 ie 1 only

Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index b2a3220..d2328fc 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3277,7 +3277,6 @@ static void
 fec_enet_get_queue_num(struct platform_device *pdev, int *num_tx, int *num_rx)
 {
 	struct device_node *np = pdev->dev.of_node;
-	int err;
 
 	*num_tx = *num_rx = 1;
 
@@ -3285,13 +3284,9 @@ fec_enet_get_queue_num(struct platform_device *pdev, int *num_tx, int *num_rx)
 		return;
 
 	/* parse the num of tx and rx queues */
-	err = of_property_read_u32(np, "fsl,num-tx-queues", num_tx);
-	if (err)
-		*num_tx = 1;
+	of_property_read_u32(np, "fsl,num-tx-queues", num_tx);
 
-	err = of_property_read_u32(np, "fsl,num-rx-queues", num_rx);
-	if (err)
-		*num_rx = 1;
+	of_property_read_u32(np, "fsl,num-rx-queues", num_rx);
 
 	if (*num_tx < 1 || *num_tx > FEC_ENET_MAX_TX_QS) {
 		dev_warn(&pdev->dev, "Invalid num_tx(=%d), fall back to 1\n",
-- 
1.9.1


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

* Re: [PATCH] net: fec: no need to test for the return type of of_property_read_u32
  2015-11-23 13:51 [PATCH] net: fec: no need to test for the return type of of_property_read_u32 Saurabh Sengar
@ 2015-11-24 21:09 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-11-24 21:09 UTC (permalink / raw)
  To: saurabh.truth; +Cc: B38611, fabio.estevam, netdev, linux-kernel

From: Saurabh Sengar <saurabh.truth@gmail.com>
Date: Mon, 23 Nov 2015 19:21:48 +0530

> in case of error no need to set num_tx and num_rx = 1, because in case of error
> these variables will remain unchanged by of_property_read_u32 ie 1 only
> 
> Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>

Applied.

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

end of thread, other threads:[~2015-11-24 21:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-23 13:51 [PATCH] net: fec: no need to test for the return type of of_property_read_u32 Saurabh Sengar
2015-11-24 21:09 ` David Miller

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.