netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch V2 00/13] ptp: Belated spring cleaning of the chardev driver
@ 2025-06-25 11:52 Thomas Gleixner
  2025-06-25 11:52 ` [patch V2 01/13] ptp: Split out PTP_CLOCK_GETCAPS ioctl code Thomas Gleixner
                   ` (14 more replies)
  0 siblings, 15 replies; 18+ messages in thread
From: Thomas Gleixner @ 2025-06-25 11:52 UTC (permalink / raw)
  To: LKML; +Cc: Richard Cochran, netdev, Vadim Fedorenko, Paolo Abeni,
	Jakub Kicinski

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(-)



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2025-06-27  0:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-25 11:52 [patch V2 00/13] ptp: Belated spring cleaning of the chardev driver Thomas Gleixner
2025-06-25 11:52 ` [patch V2 01/13] ptp: Split out PTP_CLOCK_GETCAPS ioctl code Thomas Gleixner
2025-06-25 11:52 ` [patch V2 02/13] ptp: Split out PTP_EXTTS_REQUEST " Thomas Gleixner
2025-06-25 11:52 ` [patch V2 03/13] ptp: Split out PTP_PEROUT_REQUEST " Thomas Gleixner
2025-06-25 11:52 ` [patch V2 04/13] ptp: Split out PTP_ENABLE_PPS " Thomas Gleixner
2025-06-25 11:52 ` [patch V2 05/13] ptp: Split out PTP_SYS_OFFSET_PRECISE " Thomas Gleixner
2025-06-25 11:52 ` [patch V2 06/13] ptp: Split out PTP_SYS_OFFSET_EXTENDED " Thomas Gleixner
2025-06-25 11:52 ` [patch V2 07/13] ptp: Split out PTP_SYS_OFFSET " Thomas Gleixner
2025-06-25 11:52 ` [patch V2 08/13] ptp: Split out PTP_PIN_GETFUNC " Thomas Gleixner
2025-06-25 11:52 ` [patch V2 09/13] ptp: Split out PTP_PIN_SETFUNC " Thomas Gleixner
2025-06-25 11:52 ` [patch V2 10/13] ptp: Split out PTP_MASK_CLEAR_ALL " Thomas Gleixner
2025-06-25 11:52 ` [patch V2 11/13] ptp: Split out PTP_MASK_EN_SINGLE " Thomas Gleixner
2025-06-25 11:52 ` [patch V2 12/13] ptp: Convert chardev code to lock guards Thomas Gleixner
2025-06-25 11:52 ` [patch V2 13/13] ptp: Simplify ptp_read() Thomas Gleixner
2025-06-25 14:40 ` [patch V2 00/13] ptp: Belated spring cleaning of the chardev driver Richard Cochran
2025-06-25 16:05   ` Thomas Gleixner
2025-06-25 16:11     ` Richard Cochran
2025-06-27  1:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).