[dpdk-dev] [PATCH 3/9] net/bnxt: remove logically dead code

Kevin Traynor ktraynor at redhat.com
Tue Nov 5 16:39:17 CET 2019


On 30/10/2019 16:27, Ajit Khaparde wrote:
> On Wed, Oct 30, 2019 at 12:43 AM David Marchand <david.marchand at redhat.com>
> wrote:
> 
>> Hello Ajit, Kevin,
>>
>> On Wed, Oct 2, 2019 at 3:29 AM Ajit Khaparde <ajit.khaparde at broadcom.com>
>> wrote:
>>>
>>> On Tue, Oct 1, 2019 at 6:04 AM Kevin Traynor <ktraynor at redhat.com>
>> wrote:
>>>
>>>> If rc contains a non-zero return code from bnxt_hwrm_send_message(),
>>>> HWRM_CHECK_RESULT_SILENT() will return.
>>>>
>>>> Just after that code, there is an 'if (!rc) {...} else {...}'.
>>>> Coverity is complaining that this if else statement is dead code as
>>>> rc will always be 0 if that code is reached.
>>>>
>>>> 4309        rc = bnxt_hwrm_send_message(bp, &req, sizeof(req),
>>>>                    BNXT_USE_CHIMP_MB);
>>>>     cond_const: Condition rc, taking false branch.
>>>>     Now the value of rc is equal to 0.
>>>> 4310        HWRM_CHECK_RESULT_SILENT();
>>>> 4311
>>>>     const: At condition rc, the value of rc must be equal to 0.
>>>>     dead_error_condition: The condition !rc must be true.
>>>> 4312        if (!rc) {
>>>>
>>>> [snip]
>>>>
>>>> 4373        } else {
>>>>     CID 343450 (#1 of 1): Logically dead code
>>>>     (DEADCODE)dead_error_line: Execution cannot
>>>>     reach this statement: rc = 0;.
>>>> 4374                rc = 0;
>>>> 4375        }
>>>>
>>>> Coverity issue: 343450
>>>> Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
>>>> Cc: lance.richardson at broadcom.com
>>>> Cc: stable at dpdk.org
>>>>
>>>> Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
>>>>
>>> Acked-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
>>
>> I can see a *really* close patch has been submitted the day after.
>> http://patchwork.dpdk.org/patch/58352/
>>
>> And merged after a v3:
>>
>> https://git.dpdk.org/dpdk/commit/?id=b4f74051165560aa81814433dea7e6eb0bdb32b9
>>
>> So I suppose this patch can be dropped.
>>
>> Yes. That makes sense.
> Thanks for checking.
> 
> Thanks
> Ajit
> 

Thanks for catching it David.

>>
>> --
>> David Marchand
>>
> 



More information about the dev mailing list