diff mbox series

[net,1/2] net: hns3: Remove the left over redundant check & assignment

Message ID 20210403013520.22108-2-salil.mehta@huawei.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series Misc. fixes for hns3 driver | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers fail 2 blamed authors not CCed: lipeng321@huawei.com tanhuazhong@huawei.com; 8 maintainers not CCed: liaoguojia@huawei.com yisen.zhuang@huawei.com lipeng321@huawei.com moyufeng@huawei.com tanhuazhong@huawei.com shenjian15@huawei.com huangguangbin2@huawei.com liuyonglong@huawei.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Salil Mehta April 3, 2021, 1:35 a.m. UTC
This removes the left over check and assignment which is no longer used
anywhere in the function and should have been removed as part of the
below mentioned patch.

Fixes: 012fcb52f67c ("net: hns3: activate reset timer when calling reset_event")
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Leon Romanovsky April 4, 2021, 6:25 a.m. UTC | #1
On Sat, Apr 03, 2021 at 02:35:19AM +0100, Salil Mehta wrote:
> This removes the left over check and assignment which is no longer used
> anywhere in the function and should have been removed as part of the
> below mentioned patch.
> 
> Fixes: 012fcb52f67c ("net: hns3: activate reset timer when calling reset_event")
> Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> ---
>  drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> index e3f81c7e0ce7..7ad0722383f5 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> @@ -3976,8 +3976,6 @@ static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle)
>  	 * want to make sure we throttle the reset request. Therefore, we will
>  	 * not allow it again before 3*HZ times.
>  	 */
> -	if (!handle)
> -		handle = &hdev->vport[0].nic;

The comment above should be updated too, and probably the signature of
hclge_reset_event() worth to be changed.

Thanks

>  
>  	if (time_before(jiffies, (hdev->last_reset_time +
>  				  HCLGE_RESET_INTERVAL))) {
> -- 
> 2.17.1
>
Salil Mehta April 5, 2021, 12:26 p.m. UTC | #2
Hi Leon,
Thanks for the review.

> From: Leon Romanovsky [mailto:leon@kernel.org]
> Sent: Sunday, April 4, 2021 7:26 AM
> To: Salil Mehta <salil.mehta@huawei.com>
> Cc: davem@davemloft.net; kuba@kernel.org; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org; Linuxarm <linuxarm@huawei.com>;
> linuxarm@openeuler.org
> Subject: Re: [PATCH net 1/2] net: hns3: Remove the left over redundant check
> & assignment
> 
> On Sat, Apr 03, 2021 at 02:35:19AM +0100, Salil Mehta wrote:
> > This removes the left over check and assignment which is no longer used
> > anywhere in the function and should have been removed as part of the
> > below mentioned patch.
> >
> > Fixes: 012fcb52f67c ("net: hns3: activate reset timer when calling
> reset_event")
> > Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> > ---
> >  drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > index e3f81c7e0ce7..7ad0722383f5 100644
> > --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > @@ -3976,8 +3976,6 @@ static void hclge_reset_event(struct pci_dev *pdev,
> struct hnae3_handle *handle)
> >  	 * want to make sure we throttle the reset request. Therefore, we will
> >  	 * not allow it again before 3*HZ times.
> >  	 */
> > -	if (!handle)
> > -		handle = &hdev->vport[0].nic;
> 
> The comment above should be updated too, and probably the signature of
> hclge_reset_event() worth to be changed.


Yes, true. Both the comment and the prototype will be updated in near future.
I can assure you this did not go un-noticed during the change. There are
some internal subtleties which I am trying to sort out. Those might come
as part of different patch-set which deals with other related changes as well.

The current change(and some other) will pave the way for necessary refactoring
Of the code being done.


> 
> Thanks
> 
> >
> >  	if (time_before(jiffies, (hdev->last_reset_time +
> >  				  HCLGE_RESET_INTERVAL))) {
> > --
> > 2.17.1
> >
Leon Romanovsky April 5, 2021, 12:43 p.m. UTC | #3
On Mon, Apr 05, 2021 at 12:26:37PM +0000, Salil Mehta wrote:
> Hi Leon,
> Thanks for the review.
> 
> > From: Leon Romanovsky [mailto:leon@kernel.org]
> > Sent: Sunday, April 4, 2021 7:26 AM
> > To: Salil Mehta <salil.mehta@huawei.com>
> > Cc: davem@davemloft.net; kuba@kernel.org; netdev@vger.kernel.org;
> > linux-kernel@vger.kernel.org; Linuxarm <linuxarm@huawei.com>;
> > linuxarm@openeuler.org
> > Subject: Re: [PATCH net 1/2] net: hns3: Remove the left over redundant check
> > & assignment
> > 
> > On Sat, Apr 03, 2021 at 02:35:19AM +0100, Salil Mehta wrote:
> > > This removes the left over check and assignment which is no longer used
> > > anywhere in the function and should have been removed as part of the
> > > below mentioned patch.
> > >
> > > Fixes: 012fcb52f67c ("net: hns3: activate reset timer when calling
> > reset_event")
> > > Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> > > ---
> > >  drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 --
> > >  1 file changed, 2 deletions(-)
> > >
> > > diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > > index e3f81c7e0ce7..7ad0722383f5 100644
> > > --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > > +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > > @@ -3976,8 +3976,6 @@ static void hclge_reset_event(struct pci_dev *pdev,
> > struct hnae3_handle *handle)
> > >  	 * want to make sure we throttle the reset request. Therefore, we will
> > >  	 * not allow it again before 3*HZ times.
> > >  	 */
> > > -	if (!handle)
> > > -		handle = &hdev->vport[0].nic;
> > 
> > The comment above should be updated too, and probably the signature of
> > hclge_reset_event() worth to be changed.
> 
> 
> Yes, true. Both the comment and the prototype will be updated in near future.
> I can assure you this did not go un-noticed during the change. There are
> some internal subtleties which I am trying to sort out. Those might come
> as part of different patch-set which deals with other related changes as well.

I can buy such explanation for the change in function signature, but have hard
time to believe that extra commit is needed to change comment above.

Thanks

> 
> The current change(and some other) will pave the way for necessary refactoring
> Of the code being done.
> 
> 
> > 
> > Thanks
> > 
> > >
> > >  	if (time_before(jiffies, (hdev->last_reset_time +
> > >  				  HCLGE_RESET_INTERVAL))) {
> > > --
> > > 2.17.1
> > >
Salil Mehta April 5, 2021, 4:21 p.m. UTC | #4
> From: Leon Romanovsky [mailto:leon@kernel.org]
> Sent: Monday, April 5, 2021 1:43 PM
> To: Salil Mehta <salil.mehta@huawei.com>
> Cc: davem@davemloft.net; kuba@kernel.org; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org; Linuxarm <linuxarm@huawei.com>;
> linuxarm@openeuler.org
> Subject: Re: [PATCH net 1/2] net: hns3: Remove the left over redundant check
> & assignment
> 
> On Mon, Apr 05, 2021 at 12:26:37PM +0000, Salil Mehta wrote:
> > Hi Leon,
> > Thanks for the review.
> >
> > > From: Leon Romanovsky [mailto:leon@kernel.org]
> > > Sent: Sunday, April 4, 2021 7:26 AM
> > > To: Salil Mehta <salil.mehta@huawei.com>
> > > Cc: davem@davemloft.net; kuba@kernel.org; netdev@vger.kernel.org;
> > > linux-kernel@vger.kernel.org; Linuxarm <linuxarm@huawei.com>;
> > > linuxarm@openeuler.org
> > > Subject: Re: [PATCH net 1/2] net: hns3: Remove the left over redundant check
> > > & assignment
> > >
> > > On Sat, Apr 03, 2021 at 02:35:19AM +0100, Salil Mehta wrote:
> > > > This removes the left over check and assignment which is no longer used
> > > > anywhere in the function and should have been removed as part of the
> > > > below mentioned patch.
> > > >
> > > > Fixes: 012fcb52f67c ("net: hns3: activate reset timer when calling
> > > reset_event")
> > > > Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> > > > ---
> > > >  drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 --
> > > >  1 file changed, 2 deletions(-)
> > > >
> > > > diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > > b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > > > index e3f81c7e0ce7..7ad0722383f5 100644
> > > > --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > > > +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> > > > @@ -3976,8 +3976,6 @@ static void hclge_reset_event(struct pci_dev *pdev,
> > > struct hnae3_handle *handle)
> > > >  	 * want to make sure we throttle the reset request. Therefore, we will
> > > >  	 * not allow it again before 3*HZ times.
> > > >  	 */
> > > > -	if (!handle)
> > > > -		handle = &hdev->vport[0].nic;
> > >
> > > The comment above should be updated too, and probably the signature of
> > > hclge_reset_event() worth to be changed.
> >
> >
> > Yes, true. Both the comment and the prototype will be updated in near future.
> > I can assure you this did not go un-noticed during the change. There are
> > some internal subtleties which I am trying to sort out. Those might come
> > as part of different patch-set which deals with other related changes as well.
> 
> I can buy such explanation for the change in function signature, but have hard
> time to believe that extra commit is needed to change comment above.

Sure, I understand your point. Earlier I thought to retain the comment for reference
and make it part of the refactor change. But will send another version changing
the comment now. No issues :)

Many thanks

> 
> Thanks
> 
> >
> > The current change(and some other) will pave the way for necessary refactoring
> > Of the code being done.
> >
> >
> > >
> > > Thanks
> > >
> > > >
> > > >  	if (time_before(jiffies, (hdev->last_reset_time +
> > > >  				  HCLGE_RESET_INTERVAL))) {
> > > > --
> > > > 2.17.1
> > > >
diff mbox series

Patch

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index e3f81c7e0ce7..7ad0722383f5 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -3976,8 +3976,6 @@  static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle)
 	 * want to make sure we throttle the reset request. Therefore, we will
 	 * not allow it again before 3*HZ times.
 	 */
-	if (!handle)
-		handle = &hdev->vport[0].nic;
 
 	if (time_before(jiffies, (hdev->last_reset_time +
 				  HCLGE_RESET_INTERVAL))) {