[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20181007.203739.679737551060624652.davem@davemloft.net>
Date: Sun, 07 Oct 2018 20:37:39 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: gustavo@...eddedor.com
Cc: michael.chan@...adcom.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] bnxt_en: Remove unnecessary unsigned integer
comparison and initialize variable
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Date: Fri, 5 Oct 2018 22:12:09 +0200
> There is no need to compare *val.vu32* with < 0 because
> such variable is of type u32 (32 bits, unsigned), making it
> impossible to hold a negative value. Fix this by removing
> such comparison.
>
> Also, initialize variable *max_val* to -1, just in case
> it is not initialized to either BNXT_MSIX_VEC_MAX or
> BNXT_MSIX_VEC_MIN_MAX before using it in a comparison
> with val.vu32 at line 159:
>
> if (val.vu32 > max_val)
>
> Addresses-Coverity-ID: 1473915 ("Unsigned compared against 0")
> Addresses-Coverity-ID: 1473920 ("Uninitialized scalar variable")
> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
Applied.
Powered by blists - more mailing lists