Thread (3 messages) 3 messages, 2 authors, 2024-08-22

Re: [PATCH v4] ptp: Add vDSO-style vmclock support

From: Simon Horman <horms@kernel.org>
Date: 2024-08-22 11:49:55
Also in: linux-arm-kernel, linux-rtc, lkml, qemu-devel, virtualization

On Wed, Aug 21, 2024 at 10:50:47PM +0100, David Woodhouse wrote:

...
quoted hunk ↗ jump to hunk
diff --git a/drivers/ptp/ptp_vmclock.c b/drivers/ptp/ptp_vmclock.c
...
+#define VMCLOCK_FIELD_PRESENT(_c, _f)			  \
+	(_c)->size >= (offsetof(struct vmclock_abi, _f) + \
+		       sizeof((_c)->_f))
+
...
+static int vmclock_probe(struct platform_device *pdev)
...
+	/* If there is valid clock information, register a PTP clock */
+	if (VMCLOCK_FIELD_PRESENT(st->clk, time_frac_sec)) {
Hi David,

Sorry to be always the one with the nit-pick.
Sparse complains about the line above, I believe because the
type of st->clk->size is __le32.

.../ptp_vmclock.c:562:13: warning: restricted __le32 degrades to integer
+		/* Can return a silent NULL, or an error. */
+		st->ptp_clock = vmclock_ptp_register(dev, st);
+		if (IS_ERR(st->ptp_clock)) {
+			ret = PTR_ERR(st->ptp_clock);
+			st->ptp_clock = NULL;
+			vmclock_remove(pdev);
+			goto out;
+		}
+	}
...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help