1
0

ptp: Split out PTP_MASK_CLEAR_ALL ioctl code

Continue the ptp_ioctl() cleanup by splitting out the PTP_MASK_CLEAR_ALL ioctl
code into a helper function.

No functional change intended.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/20250625115133.302755618@linutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Thomas Gleixner
2025-06-25 13:52:35 +02:00
committed by Jakub Kicinski
parent d713f1ff64
commit 6a0f480478

View File

@@ -435,6 +435,12 @@ static long ptp_pin_setfunc(struct ptp_clock *ptp, unsigned int cmd, void __user
return ptp_set_pinfunc(ptp, pin_index, pd.func, pd.chan);
}
static long ptp_mask_clear_all(struct timestamp_event_queue *tsevq)
{
bitmap_clear(tsevq->mask, 0, PTP_MAX_CHANNELS);
return 0;
}
long ptp_ioctl(struct posix_clock_context *pccontext, unsigned int cmd,
unsigned long arg)
{
@@ -497,8 +503,7 @@ long ptp_ioctl(struct posix_clock_context *pccontext, unsigned int cmd,
return ptp_pin_setfunc(ptp, cmd, argptr);
case PTP_MASK_CLEAR_ALL:
bitmap_clear(tsevq->mask, 0, PTP_MAX_CHANNELS);
break;
return ptp_mask_clear_all(pccontext->private_clkdata);
case PTP_MASK_EN_SINGLE:
if (copy_from_user(&i, (void __user *)arg, sizeof(i))) {