Re: [PATCH] drm/i915: Fix clang -Wimplicit-fallthrough in intel_async_flip_check_hw()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Nick,

On 24/05/2023 20:56, Nick Desaulniers wrote:
> On Wed, May 24, 2023 at 11:41 AM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>>
>> On Wed, May 24, 2023 at 11:32:32AM -0700, Nick Desaulniers wrote:
>>> On Wed, May 24, 2023 at 8:38 AM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>>>>
>>>> Clang warns:
>>>>
>>>>   drivers/gpu/drm/i915/display/intel_display.c:6012:3: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
>>>>                   case I915_FORMAT_MOD_X_TILED:
>>>>                   ^
>>>>   drivers/gpu/drm/i915/display/intel_display.c:6012:3: note: insert 'break;' to avoid fall-through
>>>>                   case I915_FORMAT_MOD_X_TILED:
>>>>                   ^
>>>>                   break;
>>>>   1 error generated.
>>>>
>>>> Clang is a little more pedantic than GCC, which does not warn when
>>>> falling through to a case that is just break or return. Clang's version
>>>> is more in line with the kernel's own stance in deprecated.rst, which
>>>> states that all switch/case blocks must end in either break,
>>>> fallthrough, continue, goto, or return. Add the missing break to silence
>>>> the warning.
>>>>
>>>> Fixes: 937859485aef ("drm/i915: Support Async Flip on Linear buffers")
>>>> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>>>> Closes: https://lore.kernel.org/202305241902.UvHtMoxa-lkp@xxxxxxxxx/
>>>> Reported-by: Naresh Kamboju <naresh.kamboju@xxxxxxxxxx>
>>>> Closes: https://lore.kernel.org/CA+G9fYv68V3ewK0Qj-syQj7qX-hQr0H1MFL=QFNuDoE_J2Zu-g@xxxxxxxxxxxxxx/
>>>> Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx>
>>>
>>> Thanks for the patch! I've never seen the closes tag before, that's
>>> new to me. Can you tell me more about it?
>>
>> It is new to me (at least in the context of the kernel) as well. I only
>> used it over Link: because checkpatch.pl told me to:
>>
>> WARNING: Reported-by: should be immediately followed by Closes: with a URL to the report
>> #26:
>> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>> Reported-by: Naresh Kamboju <naresh.kamboju@xxxxxxxxxx>
>>
>> WARNING: Reported-by: should be immediately followed by Closes: with a URL to the report
>> #27:
>> Reported-by: Naresh Kamboju <naresh.kamboju@xxxxxxxxxx>
>> Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx>
>>
>> It was Link: for a bit but commit 44c31888098a ("checkpatch: allow
>> Closes tags with links") changed it to Closes:. Looks odd to me but
>> whatever the linter says I suppose.
>>
>> Thanks for the review!
>>
>> Cheers,
>> Nathan
>>
>>> A few more tags
>>>
>>> Reported-by: Tom Rix <trix@xxxxxxxxxx>
>>> Link: https://lore.kernel.org/all/20230523125116.1669057-1-trix@xxxxxxxxxx/
>>> Reviewed-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
> 
> Ah then I guess my link tag should have been
> 
> Closes: https://lore.kernel.org/all/20230523125116.1669057-1-trix@xxxxxxxxxx/
> 
> I hope the author of
> commit 44c31888098a ("checkpatch: allow Closes tags with links")
> has coordinated with the maintainer of b4, so that b4 recognizes Closes tags.
> b4 v0.12.2 does not pick up Closes tags.

I'm sorry for the troubles caused by this series, that was not the
intension.

When looking at modifying b4 to support the Closes tag, I realised the
Link tag from your previous message [1] was not taken as well. Was it
just me?

If no, I just sent patches for b4, see [2]. I hope it will help!

Cheers,
Matt

[1]
https://lore.kernel.org/all/CAKwvOd=jZJouuNMd3Rvc--goA0EXPHcf6cHXUA6W1kXJg2ay2w@xxxxxxxxxxxxxx/
[2]
https://lore.kernel.org/tools/20230525-closes-tags-v1-0-ed41b1773cb6@xxxxxxxxxxxx/T/
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux