[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <80052862-683c-4a53-b7a2-8d767a057022@linux.dev>
Date: Sat, 21 Jun 2025 21:36:39 +0100
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Thomas Gleixner <tglx@...utronix.de>, LKML <linux-kernel@...r.kernel.org>
Cc: Richard Cochran <richardcochran@...il.com>, netdev@...r.kernel.org
Subject: Re: [patch 10/13] ptp: Split out PTP_MASK_CLEAR_ALL ioctl code
On 20/06/2025 14:24, Thomas Gleixner wrote:
> 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@...utronix.de>
> ---
> drivers/ptp/ptp_chardev.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> --- a/drivers/ptp/ptp_chardev.c
> +++ b/drivers/ptp/ptp_chardev.c
> @@ -442,6 +442,12 @@ static long ptp_pin_setfunc(struct ptp_c
> 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)
> {
> @@ -504,8 +510,7 @@ long ptp_ioctl(struct posix_clock_contex
> 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))) {
>
Not quite sure there is a benefit of having a function for this type,
apart from having one style. But it adds some LoC...
Powered by blists - more mailing lists