Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1333384 > unrolled thread

[PATCH] i40e: remove redundant check on vsi->active_vlans

Started byColin King <colin.king@canonical.com>
First post2016-02-14 01:00 +0100
Last post2016-02-16 19:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] i40e: remove redundant check on vsi->active_vlans Colin King <colin.king@canonical.com> - 2016-02-14 01:00 +0100
    Re: [PATCH] i40e: remove redundant check on vsi->active_vlans Shannon Nelson <shannon.nelson@intel.com> - 2016-02-16 19:00 +0100

#1333384 — [PATCH] i40e: remove redundant check on vsi->active_vlans

FromColin King <colin.king@canonical.com>
Date2016-02-14 01:00 +0100
Subject[PATCH] i40e: remove redundant check on vsi->active_vlans
Message-ID<r1Sgy-3dW-5@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

active_vlans is an unsigned long array, hence a null check on this
array is superfluous and can be removed.

Detected with static analysis by smatch:

drivers/net/ethernet/intel/i40e/i40e_debugfs.c:386
  i40e_dbg_dump_vsi_seid() warn: this array is probably
  non-NULL. 'vsi->active_vlans'

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
index 10744a6..aba28be 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
@@ -383,9 +383,8 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)
 		dev_info(&pf->pdev->dev,
 			 "    netdev: name = %s\n",
 			 vsi->netdev->name);
-	if (vsi->active_vlans)
-		dev_info(&pf->pdev->dev,
-			 "    vlgrp: & = %p\n", vsi->active_vlans);
+	dev_info(&pf->pdev->dev,
+		 "    vlgrp: & = %p\n", vsi->active_vlans);
 	dev_info(&pf->pdev->dev,
 		 "    netdev_registered = %i, current_netdev_flags = 0x%04x, state = %li flags = 0x%08lx\n",
 		 vsi->netdev_registered,
-- 
2.7.0

[toc] | [next] | [standalone]


#1335689

FromShannon Nelson <shannon.nelson@intel.com>
Date2016-02-16 19:00 +0100
Message-ID<r2S4O-2Fp-17@gated-at.bofh.it>
In reply to#1333384
On Sat, Feb 13, 2016 at 3:57 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> active_vlans is an unsigned long array, hence a null check on this
> array is superfluous and can be removed.
>
> Detected with static analysis by smatch:
>
> drivers/net/ethernet/intel/i40e/i40e_debugfs.c:386
>   i40e_dbg_dump_vsi_seid() warn: this array is probably
>   non-NULL. 'vsi->active_vlans'
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> index 10744a6..aba28be 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> @@ -383,9 +383,8 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)
>                 dev_info(&pf->pdev->dev,
>                          "    netdev: name = %s\n",
>                          vsi->netdev->name);
> -       if (vsi->active_vlans)
> -               dev_info(&pf->pdev->dev,
> -                        "    vlgrp: & = %p\n", vsi->active_vlans);
> +       dev_info(&pf->pdev->dev,
> +                "    vlgrp: & = %p\n", vsi->active_vlans);
>         dev_info(&pf->pdev->dev,
>                  "    netdev_registered = %i, current_netdev_flags = 0x%04x, state = %li flags = 0x%08lx\n",
>                  vsi->netdev_registered,
> --
> 2.7.0
>

Acked-by: Shannon Nelson <shannon.nelson@intel.com>

-- 
==============================================
Mr. Shannon Nelson                        Network Division, Intel Corp.
Shannon.Nelson@intel.com                I don't speak for Intel
                 Parents can't afford to be squeamish

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web