[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250625114404.102196103@linutronix.de>
Date: Wed, 25 Jun 2025 13:52:23 +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,
Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
Paolo Abeni <pabeni@...hat.com>,
Jakub Kicinski <kuba@...nel.org>
Subject: [patch V2 00/13] ptp: Belated spring cleaning of the chardev driver
This is V2 of the series. V1 can be found here:
https://lore.kernel.org/all/20250620130144.351492917@linutronix.de
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.
Changes vs. V1:
- Picked up Reviewed tags as appropriate
- Dropped the pointless memset()s in GETFUNC/SETFUNC - Paolo
- Dropped the __free() in ptp_open/read() - Jakub
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 | 734 ++++++++++++++++++++++++++--------------------------------
1 file changed, 341 insertions(+), 393 deletions(-)
Powered by blists - more mailing lists