[dpdk-dev] [PATCH] devtools: ignore PREFER_FALLTHROUGH

Adrian Moreno amorenoz at redhat.com
Wed Aug 5 15:34:02 CEST 2020


Hi Thomas,

On 8/5/20 11:12 AM, Thomas Monjalon wrote:
> 04/08/2020 09:38, Adrian Moreno:
>> The PREFER_FALLTHROUGH check warns if a passthrough comment is found
>> because, in the kernel, the special macro "fallthrough" is prefered.
>>
>> Since that keyword is not defined in DPDK, ignore the warning.
> 
> We could ask why not defining a similar keyword?
> 

Surely, we can also add the keyword. Given that unintended fallthrough is
already protected by the "MISSING_BREAK" and that fallthrough comments are
already used in DPDK, I thought it made sense to ignore the check.

If you prefer to add the keyword, let me ask:
- Where is the right place for it? Maybe rte_common.h?
- Should all the comments be replaced with the pseudo-keyword?


>>
>> Ignoring this check does not affect the MISSING_BREAK check that will
>> warn if a switch case/default is not preceded by break or a fallthrough
>> comment.
>>
>> Signed-off-by: Adrian Moreno <amorenoz at redhat.com>
>> ---
>>  devtools/checkpatches.sh | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
>> index acf921ae0..4283ca82b 100755
>> --- a/devtools/checkpatches.sh
>> +++ b/devtools/checkpatches.sh
>> @@ -33,7 +33,7 @@ VOLATILE,PREFER_PACKED,PREFER_ALIGNED,PREFER_PRINTF,\
>>  PREFER_KERNEL_TYPES,BIT_MACRO,CONST_STRUCT,\
>>  SPLIT_STRING,LONG_LINE_STRING,C99_COMMENT_TOLERANCE,\
>>  LINE_SPACING,PARENTHESIS_ALIGNMENT,NETWORKING_BLOCK_COMMENT_STYLE,\
>> -NEW_TYPEDEFS,COMPARISON_TO_NULL"
>> +NEW_TYPEDEFS,COMPARISON_TO_NULL,PREFER_FALLTHROUGH"
> 
> I would add this option between PREFER_KERNEL_TYPES and BIT_MACRO
> to maintain a bit of logic ordering.
> 
OK. I'll reorder it if the final decision is to ignore the check.

Thanks
-- 
Adrián Moreno



More information about the dev mailing list