Thread (32 messages) flat view 32 messages, 5 authors, 2019-12-20

Re: [PATCH V6 net-next 11/11] ptp: Add a driver for InES time stamping IP core.

From: Richard Cochran <richardcochran@gmail.com>
Date: 2019-12-17 04:34:38
Also in: linux-devicetree

On Mon, Dec 16, 2019 at 04:11:14PM -0800, Jakub Kicinski wrote:
On Mon, 16 Dec 2019 08:13:26 -0800, Richard Cochran wrote:
quoted
+	clkid = (u64 *)(data + offset + OFF_PTP_CLOCK_ID);
+	portn = (u16 *)(data + offset + OFF_PTP_PORT_NUM);
+	seqid = (u16 *)(data + offset + OFF_PTP_SEQUENCE_ID);
These should perhaps be __be types?

Looks like there is a few other sparse warnings in ptp_ines.c, would
you mind addressing those?
I saw the sparse warnings before (from one of the robots), but I
decided that they are false positives.  Or perhaps I don't appreciate
what the warnings mean...

Take the 'clkid' pointer for example:
 
quoted
+	if (cpu_to_be64(ts->clkid) != *clkid) {
+		pr_debug("clkid mismatch ts %llx != skb %llx\n",
+			 cpu_to_be64(ts->clkid), *clkid);
+		return false;
+	}
The field that to which 'clkid' points is in network byte order.  The
code correctly converts ts->clkid (in CPU byte order) to network byte
order before comparing it with the field.

So where is the error?

Thanks,
Richard
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help