[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250620130144.351492917@linutronix.de>
Date: Fri, 20 Jun 2025 15:24:25 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Richard Cochran <richardcochran@...il.com>,
netdev@...r.kernel.org
Subject: [patch 00/13] 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
_free(), which gets rid of all gotos.
That reduces the code size by 58 lines and also the binary text size is
90 bytes smaller than the current maze.
The series is split up into one patch per IOCTL command group for easy
review.
Applies against v6.16-rc1 and also cleanly against next. It's also
available from git:
git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git timers/ptp/driver
Thanks,
tglx
---
ptp_chardev.c | 754 ++++++++++++++++++++++++++--------------------------------
1 file changed, 348 insertions(+), 406 deletions(-)
Powered by blists - more mailing lists