]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ptp: Split out PTP_MASK_CLEAR_ALL ioctl code
authorThomas Gleixner <tglx@linutronix.de>
Wed, 25 Jun 2025 11:52:35 +0000 (13:52 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 27 Jun 2025 00:54:06 +0000 (17:54 -0700)
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>
drivers/ptp/ptp_chardev.c

index 176bdfdcc35bb6dcd9af8353375c40ba28a630da..3fbbbc09a7ba7645f8efb903a72a424edd5ff9ec 100644 (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))) {