ptp: Belated spring cleaning of the chardev driver
Status from this message: This series was applied to netdev/net-next.git (main)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest13 patches 3 repliesApplied 13/13
- v113 patches 22 repliesSuperseded
Changes in v2 from the cover letter
- Picked up Reviewed tags as appropriate
- Dropped the pointless memset()s in GETFUNC/SETFUNC - Paolo
- Dropped the __free() in ptp_open/read() - Jakub
Patches in v2 All 13 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/13 | ptp: Split out PTP_CLOCK_GETCAPS ioctl codedrivers/ | +23 | 0 replies | Applied |
| 2/13 | ptp: Split out PTP_EXTTS_REQUEST ioctl codedrivers/ | +50 | 0 replies | Applied |
| 3/13 | ptp: Split out PTP_PEROUT_REQUEST ioctl codedrivers/ | +58 | 0 replies | Applied |
| 4/13 | ptp: Split out PTP_ENABLE_PPS ioctl codedrivers/ | +16 | 0 replies | Applied |
| 5/13 | ptp: Split out PTP_SYS_OFFSET_PRECISE ioctl codedrivers/ | +29 | 0 replies | Applied |
| 6/13 | ptp: Split out PTP_SYS_OFFSET_EXTENDED ioctl codedrivers/ | +39 | 0 replies | Applied |
| 7/13 | ptp: Split out PTP_SYS_OFFSET ioctl codedrivers/ | +40 | 0 replies | Applied |
| 8/13 | ptp: Split out PTP_PIN_GETFUNC ioctl codedrivers/ | +21 | 0 replies | Applied |
| 9/13 | ptp: Split out PTP_PIN_SETFUNC ioctl codedrivers/ | +24 | 0 replies | Applied |
| 10/13 | ptp: Split out PTP_MASK_CLEAR_ALL ioctl codedrivers/ | +7 | 0 replies | Applied |
| 11/13 | ptp: Split out PTP_MASK_EN_SINGLE ioctl codedrivers/ | +15 | 0 replies | Applied |
| 12/13 | ptp: Convert chardev code to lock guardsdrivers/ | +13 | 0 replies | Applied |
| 13/13 | ptp: Simplify ptp_read()drivers/ | +16 | 0 replies | Applied |
Reviews trailers per patch
10 of 13 patches have a Reviewed-by or Acked-by.
| Patch | Vadim Fedorenko |
|---|---|
| 1/13 | R-b |
| 2/13 | R-b |
| 3/13 | R-b |
| 4/13 | R-b |
| 5/13 | R-b |
| 6/13 | R-b |
| 7/13 | |
| 8/13 | R-b |
| 9/13 | R-b |
| 10/13 | R-b |
| 11/13 | R-b |
| 12/13 | |
| 13/13 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [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/[email protected]
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(-)