Taking a look into every fall-through warning is not the most glamorous and sexy thing. But the ongoing efforts to enabling -Wimplicit-fallthrough
keep paying off. :) lore.kernel.org/patchwork/patc…

This bug has been out there for almost two years.
Roses are red,
Violets are blue,
I'm almost done,
With the -Wimplicit-fallthrough 💻🔍
Bugs, bugs, ancient bugs!
Another years-old bug found while working on the -Wimplicit-fallthrough stuff: lore.kernel.org/patchwork/patc…

This one was introduced in January 2012.
Happy to see we continue placing breaks where they should go 😀:
cgit.freedesktop.org/~agd5f/linux/c…
Yay! Another missing break makes it to multiple stable trees:
lwn.net/Articles/78271…
Two more of these bugfixes landed in stable during the weekend 🐧 lwn.net/Articles/78385…
Stephen Rothwell is now building linux-next with -Wimplicit-fallthrough. Newly introduced code that is buggy is detected, and now a bugfix takes hours instead of months or years:
lore.kernel.org/lkml/201904021…
Once -Wimplicit-fallthrough finally makes it to mainline, a bugfix should take seconds or minutes before the code is even submitted; therefore completely eliminating this bug class. 🐧
Another missing break years-old bug. This time in wireless-drivers:
lore.kernel.org/patchwork/patc…

It was introduced in July 2016. 🐧
This is certainly not the most glamorous and sexy thing... but it's worth it:
lore.kernel.org/lkml/8df20a3a-… 🐧
Another missing break bug:
lore.kernel.org/patchwork/patc… 🐧

This one was introduced just a week ago.
I've just sent my first pull-request to Linus. Fingers crossed! 🤞
lore.kernel.org/lkml/201905061… 🐧
"The pull request you sent on Mon, 6 May 2019 ... has been merged into torvalds/linux.git:"
git.kernel.org/torvalds/c/b4b… 🐧😃!!!

And today, we woke up with only 23 of these warnings left in linux-next. This means the work is 99% complete.
A bugfix for a 12-year-old bug has been finally pulled and will be merged into mainline soon:
git.kernel.org/pub/scm/linux/… 🐧

Yep; this bug has been out there since 2007. Briefly explained: the problem is that the code always returns "success" even on failure.
I'm happy that this bugfix made it to the last official 3.18.y release:
lwn.net/Articles/78868… 🐧
Two more of these bugfixes have landed in multiple stable trees:
lwn.net/Articles/78877… 🐧
Quick update:

There are only 5 of 2311 of these warnings left in linux-next. 🐧

All of them have a patch now.
Work progress: 99.78%
Stop introducing fall-through warnings, please. There are many cases in which it's much clearer (hence better for code maintenance) to add breaks instead of letting the code to fall through:
lore.kernel.org/patchwork/patc…

Last week we'd only 2 warnings left in linux-next. Today we've 4
Fingers crossed! 🤞

lore.kernel.org/lkml/858bd3e0-… 🐧
Stress is waiting for Linus to merge your final changes to complete a task you've been working on since the fall of 2017, hours before the merge window closes. So, here's a #Caturday pic for stress relief. Image
Two more of these bugfixes will land in -stable, soon:

lore.kernel.org/patchwork/patc…
lore.kernel.org/patchwork/patc… 🐧
After almost two years of work, -Wimplicit-fallthrough will be finally globally enabled in Linux v5.3. I'll go grab a beer. Have a great weekend everybody. 🐧
git.kernel.org/pub/scm/linux/… Image
"The C language allows switch cases to "fall through" when a "break" statement is missing at the end of a case. This, however, introduces ambiguity in the code, as it's not always clear if the missing break is intentional or a bug..." 🐧
kernel.org/doc/html/lates…
"One source of kernel bugs has been closed, a switch that can only be seen as a best-case scenario.". 🐧
lwn.net/SubscriberLink…
Friday night, casually building ARCH=sh for the first time, I found a 10-year-old bug thanks to -Wimplicit-fallthrough:
lore.kernel.org/patchwork/patc… 🐧

This is the perfect way to officially start my weekend. Cheers! 🍻
Happy to see other people finding more bugs (this time in ARM64) thanks to -Wimplicit-fallthrough:
git.kernel.org/pub/scm/linux/… 🐧

This bug was introduced in December 2017. It's fixed in mainline now and will be applied to 4.17+ stable kernels, soon.
This made my day:
lore.kernel.org/linux-iio/2019… 🐧

Mission accomplished. :)
Applied to mainline now:
git.kernel.org/pub/scm/linux/… 🐧
Kernel CI build for yesterday's linux-next (next-20190820):
lore.kernel.org/linux-next/5d5…
70 fall-through warnings.

Today's linux-next (next-20190821):
lore.kernel.org/linux-next/5d5…
0 fall-through warnings on x86_64, i386, arm, arm64, mips, riscv, arc and sh. 😀🐧
And yet another years-old bug is still out there in the wild. Hopefully, the bugfix will make it to mainline and land in stable, soon:
lore.kernel.org/lkml/201909090… 🐧

This bug was introduced in 2015.
ARCH=powerpc
mpc83xx_defconfig
Happy to see this bugfix finally landing in mainline. It should be applied to multiple stable trees, soon:
git.kernel.org/pub/scm/linux/… 🐧 Image
This bugfix has now been applied to stable trees 5.3.2, 5.2.18 and 4.19.76:
lwn.net/Articles/80101… 🐧 Image
As commented at @KernelRecipes a couple of weeks ago, 'fallthrough' pseudo-keyword will replace all /* fallthrough */ markings. So, yeah, we are now forking C to make the kernel more secure.😃

lore.kernel.org/lkml/CAHk-=whO… 🐧 Image
u-boot is about to globally enable -Wimplicit-fallthrough:

lists.denx.de/pipermail/u-bo…

and that's great news! 😃
I don't think I've documented this fix for a "missing continue" bug in this thread before, so here I go:
git.kernel.org/linus/2c930e3d… 🐧

The bug was introduced in August 2014 by commit
65c7843c942d0 ("usbtest: Add interrupt EP testcases").
The bugfix was applied to -stable in 2017.
The bugfix mentioned above was part of a small series:
mail-archive.com/linux-kernel@v… 🐧
mail-archive.com/linux-kernel@v… 🐧

At the time I was new to kernel development and I wasn't into the good practice of adding the "Fixes:" and "stable" tags to the changelog text.
Another fix (I haven't documented before) for a bug that was found thanks to the efforts to enable -Wimplicit-fallthrough:

"net: sched: cls_api: fix dead code in switch"
git.kernel.org/linus/2ed9db30… 🐧 Image

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Gustavo A. R. Silva

Gustavo A. R. Silva Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @embeddedgus

29 Oct 19
Linus is happy when people fix old bad code.😃 #OSSummit

git.kernel.org/pub/scm/linux/… 🐧

In this thread I'll start documenting all the years-old bugs I find and fix across the whole kernel tree.
Bugfix for a 10-year-old bug in arch sh:

git.kernel.org/pub/scm/linux/… 🐧

This bug was introduced in November 2009.
Bugfix for an 8-year-old bug in USB:

git.kernel.org/pub/scm/linux/… 🐧

This bug was introduced in June 2011.
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!