Thread (25 messages) 25 messages, 9 authors, 2020-11-10

Re: [PATCH net-next 01/11] atm: horizon: shut up clang null pointer arithmetic warning

From: Xie He <hidden>
Date: 2020-10-27 03:56:34
Also in: lkml

-  for (mem = (HDW *) memmap; mem < (HDW *) (memmap + 1); ++mem)
+  for (mem = (HDW *) memmap; mem < (HDW *) ((uintptr_t)memmap + 1); ++mem)
Note that these two lines are semantically different. In the first line,
"+ 1" moves the pointer by (sizeof memmap) bytes. However in the second
line, "+ 1" moves the pointer by only 1 byte.

This driver is old, but let's still keep its code correct!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help