[02/10] common/sfc_efx/base: delete redundant handling
Checks
Commit Message
the default case in 'rhead_nic_get_bar_region' is unreachable.
This patch fixed that.
Fixes: 3c1c5cc4a786 ("common/sfc_efx/base: add Riverhead support to NIC module")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
drivers/common/sfc_efx/base/rhead_nic.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
On 4/19/21 4:34 PM, Min Hu (Connor) wrote:
> the default case in 'rhead_nic_get_bar_region' is unreachable.
Why? May be it is true right now, but default case is required
to handle future changes in enum and missing update here.
>
> This patch fixed that.
>
> Fixes: 3c1c5cc4a786 ("common/sfc_efx/base: add Riverhead support to NIC module")
> Cc: stable@dpdk.org
>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Nack
> ---
> drivers/common/sfc_efx/base/rhead_nic.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/common/sfc_efx/base/rhead_nic.c b/drivers/common/sfc_efx/base/rhead_nic.c
> index f2c18c1..b9af348 100644
> --- a/drivers/common/sfc_efx/base/rhead_nic.c
> +++ b/drivers/common/sfc_efx/base/rhead_nic.c
> @@ -483,8 +483,7 @@ rhead_nic_get_bar_region(
> break;
>
> default:
> - rc = EINVAL;
> - goto fail1;
> + break;
> }
>
> return (0);
>
在 2021/4/20 17:33, Andrew Rybchenko 写道:
> On 4/19/21 4:34 PM, Min Hu (Connor) wrote:
>> the default case in 'rhead_nic_get_bar_region' is unreachable.
>
> Why? May be it is true right now, but default case is required
> to handle future changes in enum and missing update here.
>
Well, agreed, this patch can be abandoned.
>>
>> This patch fixed that.
>>
>> Fixes: 3c1c5cc4a786 ("common/sfc_efx/base: add Riverhead support to NIC module")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>
> Nack
>
>> ---
>> drivers/common/sfc_efx/base/rhead_nic.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/common/sfc_efx/base/rhead_nic.c b/drivers/common/sfc_efx/base/rhead_nic.c
>> index f2c18c1..b9af348 100644
>> --- a/drivers/common/sfc_efx/base/rhead_nic.c
>> +++ b/drivers/common/sfc_efx/base/rhead_nic.c
>> @@ -483,8 +483,7 @@ rhead_nic_get_bar_region(
>> break;
>>
>> default:
>> - rc = EINVAL;
>> - goto fail1;
>> + break;
>> }
>>
>> return (0);
>>
>
> .
>
@@ -483,8 +483,7 @@ rhead_nic_get_bar_region(
break;
default:
- rc = EINVAL;
- goto fail1;
+ break;
}
return (0);