* Re: [patch net-next] net: microchip: sparx5: remove useless code in sparx5_qos_init()
2022-11-17 14:58 [patch net-next] net: microchip: sparx5: remove useless code in sparx5_qos_init() Lu Wei
@ 2022-11-17 14:08 ` Andrew Lunn
2022-11-17 14:21 ` Daniel.Machon
1 sibling, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2022-11-17 14:08 UTC (permalink / raw)
To: Lu Wei
Cc: davem, edumazet, kuba, pabeni, lars.povlsen, Steen.Hegelund,
daniel.machon, UNGLinuxDriver, netdev, linux-arm-kernel,
linux-kernel
On Thu, Nov 17, 2022 at 10:58:20PM +0800, Lu Wei wrote:
> There is no need to define variable ret, so remove it
> and return sparx5_leak_groups_init() directly.
>
> Signed-off-by: Lu Wei <luwei32@huawei.com>
> ---
> drivers/net/ethernet/microchip/sparx5/sparx5_qos.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
> index 1e79d0ef0cb8..2f39300d52cc 100644
> --- a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
> +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
> @@ -383,13 +383,7 @@ static int sparx5_leak_groups_init(struct sparx5 *sparx5)
>
> int sparx5_qos_init(struct sparx5 *sparx5)
> {
> - int ret;
> -
> - ret = sparx5_leak_groups_init(sparx5);
> - if (ret < 0)
> - return ret;
> -
> - return 0;
> + return sparx5_leak_groups_init(sparx5);
> }
Does sparx5_qos_init() even make sense given that all it does it call
a function?
Please don't do the minimum needed to make your robot happy. Think
about the code, the change, is this the best fix?
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch net-next] net: microchip: sparx5: remove useless code in sparx5_qos_init()
2022-11-17 14:58 [patch net-next] net: microchip: sparx5: remove useless code in sparx5_qos_init() Lu Wei
2022-11-17 14:08 ` Andrew Lunn
@ 2022-11-17 14:21 ` Daniel.Machon
2022-11-17 20:14 ` Andrew Lunn
1 sibling, 1 reply; 5+ messages in thread
From: Daniel.Machon @ 2022-11-17 14:21 UTC (permalink / raw)
To: luwei32
Cc: davem, edumazet, kuba, pabeni, Lars.Povlsen, Steen.Hegelund,
UNGLinuxDriver, netdev, linux-arm-kernel, linux-kernel
Den Thu, Nov 17, 2022 at 10:58:20PM +0800 skrev Lu Wei:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> There is no need to define variable ret, so remove it
> and return sparx5_leak_groups_init() directly.
>
> Signed-off-by: Lu Wei <luwei32@huawei.com>
> ---
> drivers/net/ethernet/microchip/sparx5/sparx5_qos.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
> index 1e79d0ef0cb8..2f39300d52cc 100644
> --- a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
> +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
> @@ -383,13 +383,7 @@ static int sparx5_leak_groups_init(struct sparx5 *sparx5)
>
> int sparx5_qos_init(struct sparx5 *sparx5)
> {
> - int ret;
> -
> - ret = sparx5_leak_groups_init(sparx5);
> - if (ret < 0)
> - return ret;
> -
> - return 0;
> + return sparx5_leak_groups_init(sparx5);
> }
>
> int sparx5_tc_mqprio_add(struct net_device *ndev, u8 num_tc)
> --
> 2.31.1
>
sparx5_qos_init() will be expanded in later patch series, as new QoS
features require new initializations - so this is actually somewhat
intentional.
/ Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [patch net-next] net: microchip: sparx5: remove useless code in sparx5_qos_init()
@ 2022-11-17 14:58 Lu Wei
2022-11-17 14:08 ` Andrew Lunn
2022-11-17 14:21 ` Daniel.Machon
0 siblings, 2 replies; 5+ messages in thread
From: Lu Wei @ 2022-11-17 14:58 UTC (permalink / raw)
To: davem, edumazet, kuba, pabeni, lars.povlsen, Steen.Hegelund,
daniel.machon, UNGLinuxDriver, netdev, linux-arm-kernel,
linux-kernel
There is no need to define variable ret, so remove it
and return sparx5_leak_groups_init() directly.
Signed-off-by: Lu Wei <luwei32@huawei.com>
---
drivers/net/ethernet/microchip/sparx5/sparx5_qos.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
index 1e79d0ef0cb8..2f39300d52cc 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
@@ -383,13 +383,7 @@ static int sparx5_leak_groups_init(struct sparx5 *sparx5)
int sparx5_qos_init(struct sparx5 *sparx5)
{
- int ret;
-
- ret = sparx5_leak_groups_init(sparx5);
- if (ret < 0)
- return ret;
-
- return 0;
+ return sparx5_leak_groups_init(sparx5);
}
int sparx5_tc_mqprio_add(struct net_device *ndev, u8 num_tc)
--
2.31.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [patch net-next] net: microchip: sparx5: remove useless code in sparx5_qos_init()
2022-11-17 14:21 ` Daniel.Machon
@ 2022-11-17 20:14 ` Andrew Lunn
2022-11-18 8:47 ` Daniel.Machon
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2022-11-17 20:14 UTC (permalink / raw)
To: Daniel.Machon
Cc: luwei32, davem, edumazet, kuba, pabeni, Lars.Povlsen,
Steen.Hegelund, UNGLinuxDriver, netdev, linux-arm-kernel,
linux-kernel
> sparx5_qos_init() will be expanded in later patch series, as new QoS
> features require new initializations - so this is actually somewhat
> intentional.
When do you expect such patches to land?
If it going to be soon, we can keep the code as it is. If it is going
to be a while, the bots are going to keep finding this and what to
remove it.
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch net-next] net: microchip: sparx5: remove useless code in sparx5_qos_init()
2022-11-17 20:14 ` Andrew Lunn
@ 2022-11-18 8:47 ` Daniel.Machon
0 siblings, 0 replies; 5+ messages in thread
From: Daniel.Machon @ 2022-11-18 8:47 UTC (permalink / raw)
To: andrew
Cc: luwei32, davem, edumazet, kuba, pabeni, Lars.Povlsen,
Steen.Hegelund, UNGLinuxDriver, netdev, linux-arm-kernel,
linux-kernel
Den Thu, Nov 17, 2022 at 09:14:38PM +0100 skrev Andrew Lunn:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> > sparx5_qos_init() will be expanded in later patch series, as new QoS
> > features require new initializations - so this is actually somewhat
> > intentional.
>
> When do you expect such patches to land?
Most likely sometime in the next window.
>
> If it going to be soon, we can keep the code as it is. If it is going
> to be a while, the bots are going to keep finding this and what to
> remove it.
I see. If bots will be bugging us regularly, then it might just be best
to let the patch through.
>
> Andrew
/ Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-11-18 8:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17 14:58 [patch net-next] net: microchip: sparx5: remove useless code in sparx5_qos_init() Lu Wei
2022-11-17 14:08 ` Andrew Lunn
2022-11-17 14:21 ` Daniel.Machon
2022-11-17 20:14 ` Andrew Lunn
2022-11-18 8:47 ` Daniel.Machon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).