]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
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)
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>

Trivial merge