diff mbox

i40e: fix misleading indentation

Message ID 1461951855-2038011-1-git-send-email-arnd@arndb.de
State Accepted
Delegated to: Jeff Kirsher
Headers show

Commit Message

Arnd Bergmann April 29, 2016, 5:44 p.m. UTC
Newly added code in i40e_vc_config_promiscuous_mode_msg() is indented
in a way that gcc rightly complains about:

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c: In function 'i40e_vc_config_promiscuous_mode_msg':
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:1543:4: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
    if (f->vlan >= 0 && f->vlan <= I40E_MAX_VLANID)
    ^~
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:1550:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
     aq_err = pf->hw.aq.asq_last_status;

From the context, it looks like the aq_err assignment was meant to be
inside of the conditional expression, so I'm adding the appropriate
curly braces now.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 5676a8b9cd9a ("i40e: Add VF promiscuous mode driver support")
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Bowers, AndrewX April 29, 2016, 9:38 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@lists.osuosl.org] On
> Behalf Of Arnd Bergmann
> Sent: Friday, April 29, 2016 10:44 AM
> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>
> Cc: Arnd Bergmann <arnd@arndb.de>; linux-kernel@vger.kernel.org; intel-
> wired-lan@lists.osuosl.org; netdev@vger.kernel.org
> Subject: [Intel-wired-lan] [PATCH] i40e: fix misleading indentation
> 
> Newly added code in i40e_vc_config_promiscuous_mode_msg() is indented
> in a way that gcc rightly complains about:
> 
> drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c: In function
> 'i40e_vc_config_promiscuous_mode_msg':
> drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:1543:4: error: this 'if'
> clause does not guard... [-Werror=misleading-indentation]
>     if (f->vlan >= 0 && f->vlan <= I40E_MAX_VLANID)
>     ^~
> drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:1550:5: note: ...this
> statement, but the latter is misleadingly indented as if it is guarded by the 'if'
>      aq_err = pf->hw.aq.asq_last_status;
> 
> From the context, it looks like the aq_err assignment was meant to be inside
> of the conditional expression, so I'm adding the appropriate curly braces
> now.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 5676a8b9cd9a ("i40e: Add VF promiscuous mode driver support")
> ---
>  drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
No warnings at compile
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index c226c2dad247..30f9cc404707 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1540,7 +1540,7 @@  static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf,
 	} else if (i40e_getnum_vf_vsi_vlan_filters(vsi)) {
 		list_for_each_entry(f, &vsi->mac_filter_list, list) {
 			aq_ret = 0;
-			if (f->vlan >= 0 && f->vlan <= I40E_MAX_VLANID)
+			if (f->vlan >= 0 && f->vlan <= I40E_MAX_VLANID) {
 				aq_ret =
 				i40e_aq_set_vsi_uc_promisc_on_vlan(hw,
 								   vsi->seid,
@@ -1548,6 +1548,7 @@  static int i40e_vc_config_promiscuous_mode_msg(struct i40e_vf *vf,
 								   f->vlan,
 								   NULL);
 				aq_err = pf->hw.aq.asq_last_status;
+			}
 			if (aq_ret)
 				dev_err(&pf->pdev->dev,
 					"Could not add VLAN %d to Unicast promiscuous domain err %s aq_err %s\n",