]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Merge branch 'ptp-belated-spring-cleaning-of-the-chardev-driver'
authorJakub Kicinski <kuba@kernel.org>
Fri, 27 Jun 2025 00:54:10 +0000 (17:54 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 27 Jun 2025 00:54:11 +0000 (17:54 -0700)
commit1ea2e106130adc3e3424dd0607b72847313d2367
tree77cb988856340c4da84f1f3a439e6a5faedc8934
parentb7863babce0a7aacb252e50d75b192476aa81ea1
parentb66d28142dc43f25555b8c1321353ab4b1eccf8d
Merge branch 'ptp-belated-spring-cleaning-of-the-chardev-driver'

Thomas Gleixner says:

====================
ptp: Belated spring cleaning of the chardev driver

When looking into supporting auxiliary clocks in the PTP ioctl, the
inpenetrable ptp_ioctl() letter soup bothered me enough to clean it up.

The code (~400 lines!) is really hard to follow due to a gazillion of
local variables, which are only used in certain case scopes, and a
mixture of gotos, breaks and direct error return paths.

Clean it up by splitting out the IOCTL functionality into seperate
functions, which contain only the required local variables and are trivial
to follow. Complete the cleanup by converting the code to lock guards and
get rid of all gotos.

That reduces the code size by 48 lines and also the binary text size is
80 bytes smaller than the current maze.

The series is split up into one patch per IOCTL command group for easy
review.

v1: https://lore.kernel.org/20250620130144.351492917@linutronix.de
====================

Link: https://patch.msgid.link/20250625114404.102196103@linutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>