Re: [patch 07/13] ptp: Split out PTP_SYS_OFFSET ioctl code
From: Thomas Gleixner
Date: Sat Jun 21 2025 - 16:43:23 EST
On Sat, Jun 21 2025 at 21:14, Vadim Fedorenko wrote:
> On 20/06/2025 14:24, Thomas Gleixner wrote:
>> + pct = &sysoff->ts[0];
>> + for (unsigned int i = 0; i < sysoff->n_samples; i++) {
>> + struct ptp_clock_info *ops = ptp->info;
>
> Looks like *ops initialization can be moved outside of the loop.
Well it can, but does it matter? No, because this is only a coding
artifact. The compiler can evaluate ptp->info inside of the loop at his
own peril even on both usage sites.
Though what's more important is that from a context point of view, ops
belongs into the loop, because that's where it is used and not outside,
no?
Thanks,
tglx