Skip to content

Commit 6a0f480

Browse files
KAGA-KOKOkuba-moo
authored andcommitted
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 <[email protected]> Reviewed-by: Vadim Fedorenko <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d713f1f commit 6a0f480

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/ptp/ptp_chardev.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,12 @@ static long ptp_pin_setfunc(struct ptp_clock *ptp, unsigned int cmd, void __user
435435
return ptp_set_pinfunc(ptp, pin_index, pd.func, pd.chan);
436436
}
437437

438+
static long ptp_mask_clear_all(struct timestamp_event_queue *tsevq)
439+
{
440+
bitmap_clear(tsevq->mask, 0, PTP_MAX_CHANNELS);
441+
return 0;
442+
}
443+
438444
long ptp_ioctl(struct posix_clock_context *pccontext, unsigned int cmd,
439445
unsigned long arg)
440446
{
@@ -497,8 +503,7 @@ long ptp_ioctl(struct posix_clock_context *pccontext, unsigned int cmd,
497503
return ptp_pin_setfunc(ptp, cmd, argptr);
498504

499505
case PTP_MASK_CLEAR_ALL:
500-
bitmap_clear(tsevq->mask, 0, PTP_MAX_CHANNELS);
501-
break;
506+
return ptp_mask_clear_all(pccontext->private_clkdata);
502507

503508
case PTP_MASK_EN_SINGLE:
504509
if (copy_from_user(&i, (void __user *)arg, sizeof(i))) {

0 commit comments

Comments
 (0)