2021-12-05 11:54:17

by Leon Romanovsky

[permalink] [raw]
Subject: [PATCH net-next] Revert "net: hns3: add void before function which don't receive ret"

From: Leon Romanovsky <[email protected]>

There are two issues with this patch:
1. devlink_register() doesn't return any value. It is already void.
2. It is not kernel coding at all to cast return type to void.

This reverts commit 5ac4f180bd07116c1e57858bc3f6741adbca3eb6.

Link: https://lore.kernel.org/all/Yan8VDXC0BtBRVGz@unreal
Signed-off-by: Leon Romanovsky <[email protected]>
---
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_devlink.c | 2 +-
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_devlink.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_devlink.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_devlink.c
index 9c3199d3c8ee..4c441e6a5082 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_devlink.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_devlink.c
@@ -120,7 +120,7 @@ int hclge_devlink_init(struct hclge_dev *hdev)
hdev->devlink = devlink;

devlink_set_features(devlink, DEVLINK_F_RELOAD);
- (void)devlink_register(devlink);
+ devlink_register(devlink);
return 0;
}

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_devlink.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_devlink.c
index 75d2926729d3..fdc19868b818 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_devlink.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_devlink.c
@@ -122,7 +122,7 @@ int hclgevf_devlink_init(struct hclgevf_dev *hdev)
hdev->devlink = devlink;

devlink_set_features(devlink, DEVLINK_F_RELOAD);
- (void)devlink_register(devlink);
+ devlink_register(devlink);
return 0;
}

--
2.33.1



2021-12-05 12:18:37

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH net-next] Revert "net: hns3: add void before function which don't receive ret"

On Sun, Dec 05, 2021 at 01:51:37PM +0200, Leon Romanovsky wrote:
> From: Leon Romanovsky <[email protected]>
>
> There are two issues with this patch:
> 1. devlink_register() doesn't return any value. It is already void.
> 2. It is not kernel coding at all to cast return type to void.
>
> This reverts commit 5ac4f180bd07116c1e57858bc3f6741adbca3eb6.
>
> Link: https://lore.kernel.org/all/Yan8VDXC0BtBRVGz@unreal
> Signed-off-by: Leon Romanovsky <[email protected]>
> ---
> drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_devlink.c | 2 +-
> drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_devlink.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)

It was already sent, but not merged yet.
https://lore.kernel.org/all/[email protected]

Thanks

2021-12-07 00:34:30

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH net-next] Revert "net: hns3: add void before function which don't receive ret"

On Sun, 5 Dec 2021 14:18:21 +0200 Leon Romanovsky wrote:
> On Sun, Dec 05, 2021 at 01:51:37PM +0200, Leon Romanovsky wrote:
> > From: Leon Romanovsky <[email protected]>
> >
> > There are two issues with this patch:
> > 1. devlink_register() doesn't return any value. It is already void.
> > 2. It is not kernel coding at all to cast return type to void.
> >
> > This reverts commit 5ac4f180bd07116c1e57858bc3f6741adbca3eb6.
> >
> > Link: https://lore.kernel.org/all/Yan8VDXC0BtBRVGz@unreal
> > Signed-off-by: Leon Romanovsky <[email protected]>
> > ---
> > drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_devlink.c | 2 +-
> > drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_devlink.c | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
>
> It was already sent, but not merged yet.
> https://lore.kernel.org/all/[email protected]

Indeed, Guangbin in the future please make sure to CC the person whose
feedback the patches are based on.

2021-12-07 01:19:54

by Guangbin Huang

[permalink] [raw]
Subject: Re: [PATCH net-next] Revert "net: hns3: add void before function which don't receive ret"



On 2021/12/7 8:34, Jakub Kicinski wrote:
> On Sun, 5 Dec 2021 14:18:21 +0200 Leon Romanovsky wrote:
>> On Sun, Dec 05, 2021 at 01:51:37PM +0200, Leon Romanovsky wrote:
>>> From: Leon Romanovsky <[email protected]>
>>>
>>> There are two issues with this patch:
>>> 1. devlink_register() doesn't return any value. It is already void.
>>> 2. It is not kernel coding at all to cast return type to void.
>>>
>>> This reverts commit 5ac4f180bd07116c1e57858bc3f6741adbca3eb6.
>>>
>>> Link: https://lore.kernel.org/all/Yan8VDXC0BtBRVGz@unreal
>>> Signed-off-by: Leon Romanovsky <[email protected]>
>>> ---
>>> drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_devlink.c | 2 +-
>>> drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_devlink.c | 2 +-
>>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> It was already sent, but not merged yet.
>> https://lore.kernel.org/all/[email protected]
>
> Indeed, Guangbin in the future please make sure to CC the person whose
> feedback the patches are based on.
> .
>
Ok.