diff mbox series

[RESEND,next] rtl8xxxu: Fix fall-through warnings for Clang

Message ID 20210305094850.GA141221@embeddedor (mailing list archive)
State Deferred
Delegated to: Netdev Maintainers
Headers show
Series [RESEND,next] rtl8xxxu: Fix fall-through warnings for Clang | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Gustavo A. R. Silva March 5, 2021, 9:48 a.m. UTC
In preparation to enable -Wimplicit-fallthrough for Clang, fix
multiple warnings by replacing /* fall through */ comments with
the new pseudo-keyword macro fallthrough; instead of letting the
code fall through to the next case.

Notice that Clang doesn't recognize /* fall through */ comments as
implicit fall-through markings.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Kalle Valo March 5, 2021, 1:40 p.m. UTC | #1
"Gustavo A. R. Silva" <gustavoars@kernel.org> writes:

> In preparation to enable -Wimplicit-fallthrough for Clang, fix
> multiple warnings by replacing /* fall through */ comments with
> the new pseudo-keyword macro fallthrough; instead of letting the
> code fall through to the next case.
>
> Notice that Clang doesn't recognize /* fall through */ comments as
> implicit fall-through markings.
>
> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>

It's not cool that you ignore the comments you got in [1], then after a
while mark the patch as "RESEND" and not even include a changelog why it
was resent.

[1] https://patchwork.kernel.org/project/linux-wireless/patch/d522f387b2d0dde774785c7169c1f25aa529989d.1605896060.git.gustavoars@kernel.org/
Gustavo A. R. Silva March 5, 2021, 4:49 p.m. UTC | #2
On 3/5/21 07:40, Kalle Valo wrote:
> "Gustavo A. R. Silva" <gustavoars@kernel.org> writes:
> 
>> In preparation to enable -Wimplicit-fallthrough for Clang, fix
>> multiple warnings by replacing /* fall through */ comments with
>> the new pseudo-keyword macro fallthrough; instead of letting the
>> code fall through to the next case.
>>
>> Notice that Clang doesn't recognize /* fall through */ comments as
>> implicit fall-through markings.
>>
>> Link: https://github.com/KSPP/linux/issues/115
>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> 
> It's not cool that you ignore the comments you got in [1], then after a
> while mark the patch as "RESEND" and not even include a changelog why it
> was resent.

I'm a bit confused. I replied to the same thread at the time. You can see
my response there. No one replied back. :/

--
Gustavo

> 
> [1] https://patchwork.kernel.org/project/linux-wireless/patch/d522f387b2d0dde774785c7169c1f25aa529989d.1605896060.git.gustavoars@kernel.org/
>
Kees Cook March 10, 2021, 7:14 p.m. UTC | #3
On Fri, Mar 05, 2021 at 03:40:33PM +0200, Kalle Valo wrote:
> "Gustavo A. R. Silva" <gustavoars@kernel.org> writes:
> 
> > In preparation to enable -Wimplicit-fallthrough for Clang, fix
> > multiple warnings by replacing /* fall through */ comments with
> > the new pseudo-keyword macro fallthrough; instead of letting the
> > code fall through to the next case.
> >
> > Notice that Clang doesn't recognize /* fall through */ comments as
> > implicit fall-through markings.
> >
> > Link: https://github.com/KSPP/linux/issues/115
> > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> 
> It's not cool that you ignore the comments you got in [1], then after a
> while mark the patch as "RESEND" and not even include a changelog why it
> was resent.
> 
> [1] https://patchwork.kernel.org/project/linux-wireless/patch/d522f387b2d0dde774785c7169c1f25aa529989d.1605896060.git.gustavoars@kernel.org/

Hm, this conversation looks like a miscommunication, mainly? I see
Gustavo, as requested by many others[1], replacing the fallthrough
comments with the "fallthrough" statement. (This is more than just a
"Clang doesn't parse comments" issue.)

This could be a tree-wide patch and not bother you, but Greg KH has
generally advised us to send these changes broken out. Anyway, this
change still needs to land, so what would be the preferred path? I think
Gustavo could just carry it for Linus to merge without bothering you if
that'd be preferred?

-Kees

[1] https://git.kernel.org/linus/294f69e662d1570703e9b56e95be37a9fd3afba5
Jes Sorensen March 10, 2021, 7:31 p.m. UTC | #4
On 3/10/21 2:14 PM, Kees Cook wrote:
> On Fri, Mar 05, 2021 at 03:40:33PM +0200, Kalle Valo wrote:
>> "Gustavo A. R. Silva" <gustavoars@kernel.org> writes:
>>
>>> In preparation to enable -Wimplicit-fallthrough for Clang, fix
>>> multiple warnings by replacing /* fall through */ comments with
>>> the new pseudo-keyword macro fallthrough; instead of letting the
>>> code fall through to the next case.
>>>
>>> Notice that Clang doesn't recognize /* fall through */ comments as
>>> implicit fall-through markings.
>>>
>>> Link: https://github.com/KSPP/linux/issues/115
>>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>>
>> It's not cool that you ignore the comments you got in [1], then after a
>> while mark the patch as "RESEND" and not even include a changelog why it
>> was resent.
>>
>> [1] https://patchwork.kernel.org/project/linux-wireless/patch/d522f387b2d0dde774785c7169c1f25aa529989d.1605896060.git.gustavoars@kernel.org/
> 
> Hm, this conversation looks like a miscommunication, mainly? I see
> Gustavo, as requested by many others[1], replacing the fallthrough
> comments with the "fallthrough" statement. (This is more than just a
> "Clang doesn't parse comments" issue.)
> 
> This could be a tree-wide patch and not bother you, but Greg KH has
> generally advised us to send these changes broken out. Anyway, this
> change still needs to land, so what would be the preferred path? I think
> Gustavo could just carry it for Linus to merge without bothering you if
> that'd be preferred?

I'll respond with the same I did last time, fallthrough is not C and
it's ugly.

Instead of mutilating the kernel, Gustavo should invest in fixing the
broken clang compiler.

Thanks,
Jes
Kees Cook March 10, 2021, 7:45 p.m. UTC | #5
On Wed, Mar 10, 2021 at 02:31:57PM -0500, Jes Sorensen wrote:
> On 3/10/21 2:14 PM, Kees Cook wrote:
> > On Fri, Mar 05, 2021 at 03:40:33PM +0200, Kalle Valo wrote:
> >> "Gustavo A. R. Silva" <gustavoars@kernel.org> writes:
> >>
> >>> In preparation to enable -Wimplicit-fallthrough for Clang, fix
> >>> multiple warnings by replacing /* fall through */ comments with
> >>> the new pseudo-keyword macro fallthrough; instead of letting the
> >>> code fall through to the next case.
> >>>
> >>> Notice that Clang doesn't recognize /* fall through */ comments as
> >>> implicit fall-through markings.
> >>>
> >>> Link: https://github.com/KSPP/linux/issues/115
> >>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> >>
> >> It's not cool that you ignore the comments you got in [1], then after a
> >> while mark the patch as "RESEND" and not even include a changelog why it
> >> was resent.
> >>
> >> [1] https://patchwork.kernel.org/project/linux-wireless/patch/d522f387b2d0dde774785c7169c1f25aa529989d.1605896060.git.gustavoars@kernel.org/
> > 
> > Hm, this conversation looks like a miscommunication, mainly? I see
> > Gustavo, as requested by many others[1], replacing the fallthrough
> > comments with the "fallthrough" statement. (This is more than just a
> > "Clang doesn't parse comments" issue.)
> > 
> > This could be a tree-wide patch and not bother you, but Greg KH has
> > generally advised us to send these changes broken out. Anyway, this
> > change still needs to land, so what would be the preferred path? I think
> > Gustavo could just carry it for Linus to merge without bothering you if
> > that'd be preferred?
> 
> I'll respond with the same I did last time, fallthrough is not C and
> it's ugly.

I understand your point of view, but this is not the consensus[1] of
the community. "fallthrough" is a macro, using the GCC fallthrough
attribute, with the expectation that we can move to the C17/C18
"[[fallthrough]]" statement once it is finalized by the C standards
body.

-Kees

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#implicit-switch-case-fall-through
Jes Sorensen March 10, 2021, 7:51 p.m. UTC | #6
On 3/10/21 2:45 PM, Kees Cook wrote:
> On Wed, Mar 10, 2021 at 02:31:57PM -0500, Jes Sorensen wrote:
>> On 3/10/21 2:14 PM, Kees Cook wrote:
>>> Hm, this conversation looks like a miscommunication, mainly? I see
>>> Gustavo, as requested by many others[1], replacing the fallthrough
>>> comments with the "fallthrough" statement. (This is more than just a
>>> "Clang doesn't parse comments" issue.)
>>>
>>> This could be a tree-wide patch and not bother you, but Greg KH has
>>> generally advised us to send these changes broken out. Anyway, this
>>> change still needs to land, so what would be the preferred path? I think
>>> Gustavo could just carry it for Linus to merge without bothering you if
>>> that'd be preferred?
>>
>> I'll respond with the same I did last time, fallthrough is not C and
>> it's ugly.
> 
> I understand your point of view, but this is not the consensus[1] of
> the community. "fallthrough" is a macro, using the GCC fallthrough
> attribute, with the expectation that we can move to the C17/C18
> "[[fallthrough]]" statement once it is finalized by the C standards
> body.

I don't know who decided on that, but I still disagree. It's an ugly and
pointless change that serves little purpose. We shouldn't have allowed
the ugly /* fall-through */ comments in either, but at least they didn't
mess with the code. I guess when you give someone an inch, they take a mile.

Last time this came up, the discussion was that clang refused to fix
their brokenness and therefore this nonsense was being pushed into the
kernel. It's still a pointless argument, if clang can't fix it's crap,
then stop using it.

As Kalle correctly pointed out, none of the previous comments to this
were addressed, the patches were just reposted as fact. Not exactly a
nice way to go about it either.

Jes
Kees Cook March 10, 2021, 8:59 p.m. UTC | #7
On Wed, Mar 10, 2021 at 02:51:24PM -0500, Jes Sorensen wrote:
> On 3/10/21 2:45 PM, Kees Cook wrote:
> > On Wed, Mar 10, 2021 at 02:31:57PM -0500, Jes Sorensen wrote:
> >> On 3/10/21 2:14 PM, Kees Cook wrote:
> >>> Hm, this conversation looks like a miscommunication, mainly? I see
> >>> Gustavo, as requested by many others[1], replacing the fallthrough
> >>> comments with the "fallthrough" statement. (This is more than just a
> >>> "Clang doesn't parse comments" issue.)
> >>>
> >>> This could be a tree-wide patch and not bother you, but Greg KH has
> >>> generally advised us to send these changes broken out. Anyway, this
> >>> change still needs to land, so what would be the preferred path? I think
> >>> Gustavo could just carry it for Linus to merge without bothering you if
> >>> that'd be preferred?
> >>
> >> I'll respond with the same I did last time, fallthrough is not C and
> >> it's ugly.
> > 
> > I understand your point of view, but this is not the consensus[1] of
> > the community. "fallthrough" is a macro, using the GCC fallthrough
> > attribute, with the expectation that we can move to the C17/C18
> > "[[fallthrough]]" statement once it is finalized by the C standards
> > body.
> 
> I don't know who decided on that, but I still disagree. It's an ugly and
> pointless change that serves little purpose. We shouldn't have allowed
> the ugly /* fall-through */ comments in either, but at least they didn't
> mess with the code. I guess when you give someone an inch, they take a mile.
> 
> Last time this came up, the discussion was that clang refused to fix
> their brokenness and therefore this nonsense was being pushed into the
> kernel. It's still a pointless argument, if clang can't fix it's crap,
> then stop using it.
> 
> As Kalle correctly pointed out, none of the previous comments to this
> were addressed, the patches were just reposted as fact. Not exactly a
> nice way to go about it either.

Do you mean changing the commit log to re-justify these changes? I
guess that could be done, but based on the thread, it didn't seem to
be needed. The change is happening to match the coding style consensus
reached to give the kernel the flexibility to move from a gcc extension
to the final C standards committee results without having to do treewide
commits again (i.e. via the macro).
Kalle Valo March 11, 2021, 7 a.m. UTC | #8
Kees Cook <keescook@chromium.org> writes:

> On Fri, Mar 05, 2021 at 03:40:33PM +0200, Kalle Valo wrote:
>> "Gustavo A. R. Silva" <gustavoars@kernel.org> writes:
>> 
>> > In preparation to enable -Wimplicit-fallthrough for Clang, fix
>> > multiple warnings by replacing /* fall through */ comments with
>> > the new pseudo-keyword macro fallthrough; instead of letting the
>> > code fall through to the next case.
>> >
>> > Notice that Clang doesn't recognize /* fall through */ comments as
>> > implicit fall-through markings.
>> >
>> > Link: https://github.com/KSPP/linux/issues/115
>> > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>> 
>> It's not cool that you ignore the comments you got in [1], then after a
>> while mark the patch as "RESEND" and not even include a changelog why it
>> was resent.
>> 
>> [1] https://patchwork.kernel.org/project/linux-wireless/patch/d522f387b2d0dde774785c7169c1f25aa529989d.1605896060.git.gustavoars@kernel.org/
>
> Hm, this conversation looks like a miscommunication, mainly? I see
> Gustavo, as requested by many others[1], replacing the fallthrough
> comments with the "fallthrough" statement. (This is more than just a
> "Clang doesn't parse comments" issue.)

v1 was clearly rejected by Jes, so sending a new version without any
changelog or comments is not the way to go. The changelog shoud at least
have had "v1 was rejected but I'm resending this again because <insert
reason here>" or something like that to make it clear what's happening.

> This could be a tree-wide patch and not bother you, but Greg KH has
> generally advised us to send these changes broken out. Anyway, this
> change still needs to land, so what would be the preferred path? I think
> Gustavo could just carry it for Linus to merge without bothering you if
> that'd be preferred?

I agree with Greg. Please don't do cleanups like this via another tree
as that just creates more work due to conflicts between the trees, which
is a lot more annoying to deal with than applying few patches. But when
submitting patches please follow the rules, don't cut corners.

Jes, I don't like 'fallthrough' either and prefer the original comment,
but the ship has sailed on this one. Maybe we should just take it?
Gustavo A. R. Silva March 11, 2021, 7:16 a.m. UTC | #9
On 3/11/21 01:00, Kalle Valo wrote:
> Kees Cook <keescook@chromium.org> writes:
> 
>> On Fri, Mar 05, 2021 at 03:40:33PM +0200, Kalle Valo wrote:
>>> "Gustavo A. R. Silva" <gustavoars@kernel.org> writes:
>>>
>>>> In preparation to enable -Wimplicit-fallthrough for Clang, fix
>>>> multiple warnings by replacing /* fall through */ comments with
>>>> the new pseudo-keyword macro fallthrough; instead of letting the
>>>> code fall through to the next case.
>>>>
>>>> Notice that Clang doesn't recognize /* fall through */ comments as
>>>> implicit fall-through markings.
>>>>
>>>> Link: https://github.com/KSPP/linux/issues/115
>>>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>>>
>>> It's not cool that you ignore the comments you got in [1], then after a
>>> while mark the patch as "RESEND" and not even include a changelog why it
>>> was resent.
>>>
>>> [1] https://patchwork.kernel.org/project/linux-wireless/patch/d522f387b2d0dde774785c7169c1f25aa529989d.1605896060.git.gustavoars@kernel.org/
>>
>> Hm, this conversation looks like a miscommunication, mainly? I see
>> Gustavo, as requested by many others[1], replacing the fallthrough
>> comments with the "fallthrough" statement. (This is more than just a
>> "Clang doesn't parse comments" issue.)
> 
> v1 was clearly rejected by Jes, so sending a new version without any
> changelog or comments is not the way to go. The changelog shoud at least
> have had "v1 was rejected but I'm resending this again because <insert
> reason here>" or something like that to make it clear what's happening.

Why the fact that I replied to that original thread with the message
below is being ignored?

"Just notice that the idea behind this and the following patch is exactly
the same:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?id=3f95e92c8a8516b745594049dfccc8c5f8895eea

I could resend this same patch with a different changelog text, but I
don't think such a thing is necessary. However, if people prefer that
approach, just let me know and I can do it.

Thanks
--
Gustavo"

Why no one replied to what I was proposing at the time?

It seems to me that the person that was ignored was actually me, and not the
other way around. :/

--
Gustavo

> 
>> This could be a tree-wide patch and not bother you, but Greg KH has
>> generally advised us to send these changes broken out. Anyway, this
>> change still needs to land, so what would be the preferred path? I think
>> Gustavo could just carry it for Linus to merge without bothering you if
>> that'd be preferred?
> 
> I agree with Greg. Please don't do cleanups like this via another tree
> as that just creates more work due to conflicts between the trees, which
> is a lot more annoying to deal with than applying few patches. But when
> submitting patches please follow the rules, don't cut corners.
> 
> Jes, I don't like 'fallthrough' either and prefer the original comment,
> but the ship has sailed on this one. Maybe we should just take it?
>
Kalle Valo April 17, 2021, 5:52 p.m. UTC | #10
"Gustavo A. R. Silva" <gustavoars@kernel.org> wrote:

> In preparation to enable -Wimplicit-fallthrough for Clang, fix
> multiple warnings by replacing /* fall through */ comments with
> the new pseudo-keyword macro fallthrough; instead of letting the
> code fall through to the next case.
> 
> Notice that Clang doesn't recognize /* fall through */ comments as
> implicit fall-through markings.
> 
> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Patch applied to wireless-drivers-next.git, thanks.

bf3365a856a1 rtl8xxxu: Fix fall-through warnings for Clang
Jes Sorensen April 17, 2021, 6:29 p.m. UTC | #11
On 3/10/21 3:59 PM, Kees Cook wrote:
> On Wed, Mar 10, 2021 at 02:51:24PM -0500, Jes Sorensen wrote:
>> On 3/10/21 2:45 PM, Kees Cook wrote:
>>> On Wed, Mar 10, 2021 at 02:31:57PM -0500, Jes Sorensen wrote:
>>>> On 3/10/21 2:14 PM, Kees Cook wrote:
>>>>> Hm, this conversation looks like a miscommunication, mainly? I see
>>>>> Gustavo, as requested by many others[1], replacing the fallthrough
>>>>> comments with the "fallthrough" statement. (This is more than just a
>>>>> "Clang doesn't parse comments" issue.)
>>>>>
>>>>> This could be a tree-wide patch and not bother you, but Greg KH has
>>>>> generally advised us to send these changes broken out. Anyway, this
>>>>> change still needs to land, so what would be the preferred path? I think
>>>>> Gustavo could just carry it for Linus to merge without bothering you if
>>>>> that'd be preferred?
>>>>
>>>> I'll respond with the same I did last time, fallthrough is not C and
>>>> it's ugly.
>>>
>>> I understand your point of view, but this is not the consensus[1] of
>>> the community. "fallthrough" is a macro, using the GCC fallthrough
>>> attribute, with the expectation that we can move to the C17/C18
>>> "[[fallthrough]]" statement once it is finalized by the C standards
>>> body.
>>
>> I don't know who decided on that, but I still disagree. It's an ugly and
>> pointless change that serves little purpose. We shouldn't have allowed
>> the ugly /* fall-through */ comments in either, but at least they didn't
>> mess with the code. I guess when you give someone an inch, they take a mile.
>>
>> Last time this came up, the discussion was that clang refused to fix
>> their brokenness and therefore this nonsense was being pushed into the
>> kernel. It's still a pointless argument, if clang can't fix it's crap,
>> then stop using it.
>>
>> As Kalle correctly pointed out, none of the previous comments to this
>> were addressed, the patches were just reposted as fact. Not exactly a
>> nice way to go about it either.
> 
> Do you mean changing the commit log to re-justify these changes? I
> guess that could be done, but based on the thread, it didn't seem to
> be needed. The change is happening to match the coding style consensus
> reached to give the kernel the flexibility to move from a gcc extension
> to the final C standards committee results without having to do treewide
> commits again (i.e. via the macro).

No, I am questioning why Gustavo continues to push this nonsense that
serves no purpose whatsoever. In addition he has consistently ignored
comments and just keep reposting it. But I guess that is how it works,
ignore feedback, repost junk, repeat.

Jes
Jes Sorensen April 17, 2021, 6:30 p.m. UTC | #12
On 4/17/21 1:52 PM, Kalle Valo wrote:
> "Gustavo A. R. Silva" <gustavoars@kernel.org> wrote:
> 
>> In preparation to enable -Wimplicit-fallthrough for Clang, fix
>> multiple warnings by replacing /* fall through */ comments with
>> the new pseudo-keyword macro fallthrough; instead of letting the
>> code fall through to the next case.
>>
>> Notice that Clang doesn't recognize /* fall through */ comments as
>> implicit fall-through markings.
>>
>> Link: https://github.com/KSPP/linux/issues/115
>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> 
> Patch applied to wireless-drivers-next.git, thanks.
> 
> bf3365a856a1 rtl8xxxu: Fix fall-through warnings for Clang
> 

Sorry this junk patch should not have been applied.

Jes
Gustavo A. R. Silva April 17, 2021, 7:24 p.m. UTC | #13
On 4/17/21 13:29, Jes Sorensen wrote:
> On 3/10/21 3:59 PM, Kees Cook wrote:
>> On Wed, Mar 10, 2021 at 02:51:24PM -0500, Jes Sorensen wrote:
>>> On 3/10/21 2:45 PM, Kees Cook wrote:
>>>> On Wed, Mar 10, 2021 at 02:31:57PM -0500, Jes Sorensen wrote:
>>>>> On 3/10/21 2:14 PM, Kees Cook wrote:
>>>>>> Hm, this conversation looks like a miscommunication, mainly? I see
>>>>>> Gustavo, as requested by many others[1], replacing the fallthrough
>>>>>> comments with the "fallthrough" statement. (This is more than just a
>>>>>> "Clang doesn't parse comments" issue.)
>>>>>>
>>>>>> This could be a tree-wide patch and not bother you, but Greg KH has
>>>>>> generally advised us to send these changes broken out. Anyway, this
>>>>>> change still needs to land, so what would be the preferred path? I think
>>>>>> Gustavo could just carry it for Linus to merge without bothering you if
>>>>>> that'd be preferred?
>>>>>
>>>>> I'll respond with the same I did last time, fallthrough is not C and
>>>>> it's ugly.
>>>>
>>>> I understand your point of view, but this is not the consensus[1] of
>>>> the community. "fallthrough" is a macro, using the GCC fallthrough
>>>> attribute, with the expectation that we can move to the C17/C18
>>>> "[[fallthrough]]" statement once it is finalized by the C standards
>>>> body.
>>>
>>> I don't know who decided on that, but I still disagree. It's an ugly and
>>> pointless change that serves little purpose. We shouldn't have allowed
>>> the ugly /* fall-through */ comments in either, but at least they didn't
>>> mess with the code. I guess when you give someone an inch, they take a mile.
>>>
>>> Last time this came up, the discussion was that clang refused to fix
>>> their brokenness and therefore this nonsense was being pushed into the
>>> kernel. It's still a pointless argument, if clang can't fix it's crap,
>>> then stop using it.
>>>
>>> As Kalle correctly pointed out, none of the previous comments to this
>>> were addressed, the patches were just reposted as fact. Not exactly a
>>> nice way to go about it either.
>>
>> Do you mean changing the commit log to re-justify these changes? I
>> guess that could be done, but based on the thread, it didn't seem to
>> be needed. The change is happening to match the coding style consensus
>> reached to give the kernel the flexibility to move from a gcc extension
>> to the final C standards committee results without having to do treewide
>> commits again (i.e. via the macro).
> 
> No, I am questioning why Gustavo continues to push this nonsense that
> serves no purpose whatsoever. In addition he has consistently ignored
> comments and just keep reposting it. But I guess that is how it works,
> ignore feedback, repost junk, repeat.

I was asking for feedback here[1] and here[2] after people (you and Kalle)
commented on this patch. How is that ignoring people? And -again- why
people ignored my requests for feedback in this conversation? It's a mystery
to me, honestly.

Thanks
--
Gustavo

[1] https://lore.kernel.org/lkml/20201124160906.GB17735@embeddedor/
[2] https://lore.kernel.org/lkml/e10b2a6a-d91a-9783-ddbe-ea2c10a1539a@embeddedor.com/
Joe Perches April 18, 2021, 12:09 a.m. UTC | #14
On Sat, 2021-04-17 at 14:30 -0400, Jes Sorensen wrote:
> On 4/17/21 1:52 PM, Kalle Valo wrote:
> > "Gustavo A. R. Silva" <gustavoars@kernel.org> wrote:
> > 
> > > In preparation to enable -Wimplicit-fallthrough for Clang, fix
> > > multiple warnings by replacing /* fall through */ comments with
> > > the new pseudo-keyword macro fallthrough; instead of letting the
> > > code fall through to the next case.
> > > 
> > > Notice that Clang doesn't recognize /* fall through */ comments as
> > > implicit fall-through markings.
> > > 
> > > Link: https://github.com/KSPP/linux/issues/115
> > > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> > 
> > Patch applied to wireless-drivers-next.git, thanks.
> > 
> > bf3365a856a1 rtl8xxxu: Fix fall-through warnings for Clang
> > 
> 
> Sorry this junk patch should not have been applied.

I don't believe it's a junk patch.
I believe your characterization of it as such is flawed.

You don't like the style, that's fine, but:

Any code in the kernel should not be a unique style of your own choosing
when it could cause various compilers to emit unnecessary warnings.

Please remember the kernel code base is a formed by a community with a
nominally generally accepted style.  There is a real desire in that
community to both enable compiler warnings that might show defects and
simultaneously avoid unnecessary compiler warnings.

This particular change just avoids a possible compiler warning.
Jes Sorensen April 19, 2021, 11:56 a.m. UTC | #15
On 4/17/21 8:09 PM, Joe Perches wrote:
> On Sat, 2021-04-17 at 14:30 -0400, Jes Sorensen wrote:
>> On 4/17/21 1:52 PM, Kalle Valo wrote:
>>> "Gustavo A. R. Silva" <gustavoars@kernel.org> wrote:
>>>
>>>> In preparation to enable -Wimplicit-fallthrough for Clang, fix
>>>> multiple warnings by replacing /* fall through */ comments with
>>>> the new pseudo-keyword macro fallthrough; instead of letting the
>>>> code fall through to the next case.
>>>>
>>>> Notice that Clang doesn't recognize /* fall through */ comments as
>>>> implicit fall-through markings.
>>>>
>>>> Link: https://github.com/KSPP/linux/issues/115
>>>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>>>
>>> Patch applied to wireless-drivers-next.git, thanks.
>>>
>>> bf3365a856a1 rtl8xxxu: Fix fall-through warnings for Clang
>>>
>>
>> Sorry this junk patch should not have been applied.
> 
> I don't believe it's a junk patch.
> I believe your characterization of it as such is flawed.
> 
> You don't like the style, that's fine, but:
> 
> Any code in the kernel should not be a unique style of your own choosing
> when it could cause various compilers to emit unnecessary warnings.
> 
> Please remember the kernel code base is a formed by a community with a
> nominally generally accepted style.  There is a real desire in that
> community to both enable compiler warnings that might show defects and
> simultaneously avoid unnecessary compiler warnings.
> 
> This particular change just avoids a possible compiler warning.

Please go back and look at the thread. This patch fixes nothing, it
mutilates the code by introducing non C for the sole purpose of avoiding
to work with the Clang community to fix their broken compiler. The
author of this patch ignored previous feedback and just reposted the
same patch unaltered and when it was called out, the answer was other
people was fine with it. None of the issues raised have been addressed,
so yes, that makes the patch junk.

Jes
Jes Sorensen April 19, 2021, 11:58 a.m. UTC | #16
On 4/17/21 3:24 PM, Gustavo A. R. Silva wrote:
> 
> 
> On 4/17/21 13:29, Jes Sorensen wrote:
>> On 3/10/21 3:59 PM, Kees Cook wrote:
>>> On Wed, Mar 10, 2021 at 02:51:24PM -0500, Jes Sorensen wrote:
>>>> On 3/10/21 2:45 PM, Kees Cook wrote:
>>>>> On Wed, Mar 10, 2021 at 02:31:57PM -0500, Jes Sorensen wrote:
>>>>>> On 3/10/21 2:14 PM, Kees Cook wrote:
>>>>>>> Hm, this conversation looks like a miscommunication, mainly? I see
>>>>>>> Gustavo, as requested by many others[1], replacing the fallthrough
>>>>>>> comments with the "fallthrough" statement. (This is more than just a
>>>>>>> "Clang doesn't parse comments" issue.)
>>>>>>>
>>>>>>> This could be a tree-wide patch and not bother you, but Greg KH has
>>>>>>> generally advised us to send these changes broken out. Anyway, this
>>>>>>> change still needs to land, so what would be the preferred path? I think
>>>>>>> Gustavo could just carry it for Linus to merge without bothering you if
>>>>>>> that'd be preferred?
>>>>>>
>>>>>> I'll respond with the same I did last time, fallthrough is not C and
>>>>>> it's ugly.
>>>>>
>>>>> I understand your point of view, but this is not the consensus[1] of
>>>>> the community. "fallthrough" is a macro, using the GCC fallthrough
>>>>> attribute, with the expectation that we can move to the C17/C18
>>>>> "[[fallthrough]]" statement once it is finalized by the C standards
>>>>> body.
>>>>
>>>> I don't know who decided on that, but I still disagree. It's an ugly and
>>>> pointless change that serves little purpose. We shouldn't have allowed
>>>> the ugly /* fall-through */ comments in either, but at least they didn't
>>>> mess with the code. I guess when you give someone an inch, they take a mile.
>>>>
>>>> Last time this came up, the discussion was that clang refused to fix
>>>> their brokenness and therefore this nonsense was being pushed into the
>>>> kernel. It's still a pointless argument, if clang can't fix it's crap,
>>>> then stop using it.
>>>>
>>>> As Kalle correctly pointed out, none of the previous comments to this
>>>> were addressed, the patches were just reposted as fact. Not exactly a
>>>> nice way to go about it either.
>>>
>>> Do you mean changing the commit log to re-justify these changes? I
>>> guess that could be done, but based on the thread, it didn't seem to
>>> be needed. The change is happening to match the coding style consensus
>>> reached to give the kernel the flexibility to move from a gcc extension
>>> to the final C standards committee results without having to do treewide
>>> commits again (i.e. via the macro).
>>
>> No, I am questioning why Gustavo continues to push this nonsense that
>> serves no purpose whatsoever. In addition he has consistently ignored
>> comments and just keep reposting it. But I guess that is how it works,
>> ignore feedback, repost junk, repeat.
> 
> I was asking for feedback here[1] and here[2] after people (you and Kalle)
> commented on this patch. How is that ignoring people? And -again- why
> people ignored my requests for feedback in this conversation? It's a mystery
> to me, honestly.

All you did was post a pointer to the fact that some other people
couldn't be bothered speaking out against the patch, and let it go in.
You haven't addressed any of the original concerns raised.

The big mistake here was of course to allow the pointless /* fallthrough
*/ changes to go in in the first place.

Jes
Gustavo A. R. Silva April 19, 2021, 10:58 p.m. UTC | #17
On 4/17/21 12:52, Kalle Valo wrote:
> "Gustavo A. R. Silva" <gustavoars@kernel.org> wrote:
> 
>> In preparation to enable -Wimplicit-fallthrough for Clang, fix
>> multiple warnings by replacing /* fall through */ comments with
>> the new pseudo-keyword macro fallthrough; instead of letting the
>> code fall through to the next case.
>>
>> Notice that Clang doesn't recognize /* fall through */ comments as
>> implicit fall-through markings.
>>
>> Link: https://github.com/KSPP/linux/issues/115
>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> 
> Patch applied to wireless-drivers-next.git, thanks.
> 
> bf3365a856a1 rtl8xxxu: Fix fall-through warnings for Clang

Thanks for this, Kalle.

Could you take this series too, please?

https://lore.kernel.org/lkml/cover.1618442265.git.gustavoars@kernel.org/

Thanks
--
Gustavo
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index 5cd7ef3625c5..afc97958fa4d 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -1145,7 +1145,7 @@  void rtl8xxxu_gen1_config_channel(struct ieee80211_hw *hw)
 	switch (hw->conf.chandef.width) {
 	case NL80211_CHAN_WIDTH_20_NOHT:
 		ht = false;
-		/* fall through */
+		fallthrough;
 	case NL80211_CHAN_WIDTH_20:
 		opmode |= BW_OPMODE_20MHZ;
 		rtl8xxxu_write8(priv, REG_BW_OPMODE, opmode);
@@ -1272,7 +1272,7 @@  void rtl8xxxu_gen2_config_channel(struct ieee80211_hw *hw)
 	switch (hw->conf.chandef.width) {
 	case NL80211_CHAN_WIDTH_20_NOHT:
 		ht = false;
-		/* fall through */
+		fallthrough;
 	case NL80211_CHAN_WIDTH_20:
 		rf_mode_bw |= WMAC_TRXPTCL_CTL_BW_20;
 		subchannel = 0;
@@ -1741,11 +1741,11 @@  static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv *priv)
 		case 3:
 			priv->ep_tx_low_queue = 1;
 			priv->ep_tx_count++;
-			/* fall through */
+			fallthrough;
 		case 2:
 			priv->ep_tx_normal_queue = 1;
 			priv->ep_tx_count++;
-			/* fall through */
+			fallthrough;
 		case 1:
 			priv->ep_tx_high_queue = 1;
 			priv->ep_tx_count++;