ixgbevf: remove redundant initialization of variable 'dma'.

Message ID 20180201183539.24776-1-colin.king@canonical.com
State Accepted
Delegated to: Jeff Kirsher
Headers show
Series
  • ixgbevf: remove redundant initialization of variable 'dma'.
Related show

Commit Message

Colin King Feb. 1, 2018, 6:35 p.m.
From: Colin Ian King <colin.king@canonical.com>

Variable dma is initialized with a value that is never read, later
on it is re-assigned a new value, hence the initialization is redundant
and can be removed.

Cleans up clang warning:
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:584:13: warning: Value
stored to 'dma' during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexander Duyck Feb. 1, 2018, 8:29 p.m. | #1
On Thu, Feb 1, 2018 at 10:35 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Variable dma is initialized with a value that is never read, later
> on it is re-assigned a new value, hence the initialization is redundant
> and can be removed.
>
> Cleans up clang warning:
> drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:584:13: warning: Value
> stored to 'dma' during its initialization is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>

> ---
>  drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> index 9b3d43d28106..be50facec93f 100644
> --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> @@ -558,7 +558,7 @@ static bool ixgbevf_alloc_mapped_page(struct ixgbevf_ring *rx_ring,
>                                       struct ixgbevf_rx_buffer *bi)
>  {
>         struct page *page = bi->page;
> -       dma_addr_t dma = bi->dma;
> +       dma_addr_t dma;
>
>         /* since we are recycling buffers we should seldom need to alloc */
>         if (likely(page))
> --
> 2.15.1
>
> _______________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan@osuosl.org
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Bowers, AndrewX Feb. 6, 2018, 10:38 p.m. | #2
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On
> Behalf Of Colin King
> Sent: Thursday, February 1, 2018 10:36 AM
> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>; intel-wired-
> lan@lists.osuosl.org; netdev@vger.kernel.org
> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [Intel-wired-lan] [PATCH] ixgbevf: remove redundant initialization of
> variable 'dma'.
> 
> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable dma is initialized with a value that is never read, later on it is re-
> assigned a new value, hence the initialization is redundant and can be
> removed.
> 
> Cleans up clang warning:
> drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c:584:13: warning: Value
> stored to 'dma' during its initialization is never read
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>

Patch

diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 9b3d43d28106..be50facec93f 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -558,7 +558,7 @@  static bool ixgbevf_alloc_mapped_page(struct ixgbevf_ring *rx_ring,
 				      struct ixgbevf_rx_buffer *bi)
 {
 	struct page *page = bi->page;
-	dma_addr_t dma = bi->dma;
+	dma_addr_t dma;
 
 	/* since we are recycling buffers we should seldom need to alloc */
 	if (likely(page))