[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJht_EPSs6W-r6kpWUNQDPzCjL-+_8mqq2JBoY=qhsQREgn92g@mail.gmail.com>
Date: Mon, 26 Oct 2020 21:02:05 -0700
From: Xie He <xie.he.0141@...il.com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Chas Williams <3chas3@...il.com>, Arnd Bergmann <arnd@...db.de>,
Nathan Chancellor <natechancellor@...il.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
linux-atm-general@...ts.sourceforge.net,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
clang-built-linux@...glegroups.com
Subject: Re: [PATCH net-next 01/11] atm: horizon: shut up clang null pointer
arithmetic warning
On Mon, Oct 26, 2020 at 8:56 PM Xie He <xie.he.0141@...il.com> wrote:
>
> > - 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.
Correction: in the first line "+ 1" moves the pointer by (sizeof *memmap) bytes.
Powered by blists - more mailing lists