[1/4] net/qede: fix build with gcc 11

Message ID 20200921133830.1575872-1-ferruh.yigit@intel.com (mailing list archive)
State Rejected, archived
Delegated to: David Marchand
Headers
Series [1/4] net/qede: fix build with gcc 11 |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ferruh Yigit Sept. 21, 2020, 1:38 p.m. UTC
  Error observed with gcc 11 under development
gcc (GCC) 11.0.0 20200920 (experimental)

build error:
../drivers/net/qede/qede_main.c: In function ‘qed_get_current_link’:
../drivers/net/qede/qede_main.c:587:17:
	warning: this ‘if’ clause does not guard...
                 [-Wmisleading-indentation]
  587 |                 if (!ptt)
      |                 ^~
../drivers/net/qede/qede_main.c:590:25:
	note: ...this statement, but the latter is misleadingly indented
              as if it were guarded by the ‘if’
  590 |                         qed_fill_link(hwfn, ptt, if_link);
      |                         ^~~~~~~~~~~~~

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
I am not clear what the exact intention of the original code is,
compiler warning is about wrong indentation of 'qed_fill_link(..)', I
have updated the code to keep the behavior same but fix the indentation.
Please send a proper fix if the existing behavior needs to be updated.
---
 drivers/net/qede/qede_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Rasesh Mody Sept. 25, 2020, 4:27 a.m. UTC | #1
Hi Ferruh,

>From: Ferruh Yigit <ferruh.yigit@intel.com>
>Sent: Monday, September 21, 2020 6:38 AM
>
>Error observed with gcc 11 under development gcc (GCC) 11.0.0 20200920
>(experimental)
>
>build error:
>../drivers/net/qede/qede_main.c: In function ‘qed_get_current_link’:
>../drivers/net/qede/qede_main.c:587:17:
>	warning: this ‘if’ clause does not guard...
>                 [-Wmisleading-indentation]
>  587 |                 if (!ptt)
>      |                 ^~
>../drivers/net/qede/qede_main.c:590:25:
>	note: ...this statement, but the latter is misleadingly indented
>              as if it were guarded by the ‘if’
>  590 |                         qed_fill_link(hwfn, ptt, if_link);
>      |                         ^~~~~~~~~~~~~
>
>Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>---
>I am not clear what the exact intention of the original code is, compiler
>warning is about wrong indentation of 'qed_fill_link(..)', I have updated the
>code to keep the behavior same but fix the indentation.
>Please send a proper fix if the existing behavior needs to be updated.

The existing behavior needs to be fixed, I'll send a proper fix for 20.11.

Thanks!
-Rasesh
  
David Marchand Oct. 6, 2020, 12:38 p.m. UTC | #2
On Fri, Sep 25, 2020 at 6:28 AM Rasesh Mody <rmody@marvell.com> wrote:
> >From: Ferruh Yigit <ferruh.yigit@intel.com>
> >Sent: Monday, September 21, 2020 6:38 AM
> >
> >Error observed with gcc 11 under development gcc (GCC) 11.0.0 20200920
> >(experimental)
> >
> >build error:
> >../drivers/net/qede/qede_main.c: In function ‘qed_get_current_link’:
> >../drivers/net/qede/qede_main.c:587:17:
> >       warning: this ‘if’ clause does not guard...
> >                 [-Wmisleading-indentation]
> >  587 |                 if (!ptt)
> >      |                 ^~
> >../drivers/net/qede/qede_main.c:590:25:
> >       note: ...this statement, but the latter is misleadingly indented
> >              as if it were guarded by the ‘if’
> >  590 |                         qed_fill_link(hwfn, ptt, if_link);
> >      |                         ^~~~~~~~~~~~~
> >
> >Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> >---
> >I am not clear what the exact intention of the original code is, compiler
> >warning is about wrong indentation of 'qed_fill_link(..)', I have updated the
> >code to keep the behavior same but fix the indentation.
> >Please send a proper fix if the existing behavior needs to be updated.
>
> The existing behavior needs to be fixed, I'll send a proper fix for 20.11.

I suppose this is fixed with:
https://patchwork.dpdk.org/patch/79562/

I'll mark Ferruh patch as rejected.
  

Patch

diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index aecb98261..0f82568d3 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -587,7 +587,7 @@  qed_get_current_link(struct ecore_dev *edev, struct qed_link_output *if_link)
 		if (!ptt)
 			DP_NOTICE(hwfn, true, "Failed to fill link; No PTT\n");
 
-			qed_fill_link(hwfn, ptt, if_link);
+		qed_fill_link(hwfn, ptt, if_link);
 
 		if (ptt)
 			ecore_ptt_release(hwfn, ptt);