Re: [PATCH] seq_file: fix clang warning for NULL pointer arithmetic

2020-10-27 Thread Arnd Bergmann
On Tue, Oct 27, 2020 at 11:45 AM Christoph Hellwig wrote: > > > index f277d023ebcd..b55e6ef4d677 100644 > > --- a/fs/kernfs/file.c > > +++ b/fs/kernfs/file.c > > @@ -124,7 +124,7 @@ static void *kernfs_seq_start(struct seq_file *sf, > > loff_t *ppos) > >* The same behavior and

Re: [PATCH] seq_file: fix clang warning for NULL pointer arithmetic

2020-10-27 Thread Christoph Hellwig
> index f277d023ebcd..b55e6ef4d677 100644 > --- a/fs/kernfs/file.c > +++ b/fs/kernfs/file.c > @@ -124,7 +124,7 @@ static void *kernfs_seq_start(struct seq_file *sf, loff_t > *ppos) >* The same behavior and code as single_open(). Returns >* !NULL if pos is at the

Re: [PATCH] seq_file: fix clang warning for NULL pointer arithmetic

2020-10-26 Thread Nathan Chancellor
On Mon, Oct 26, 2020 at 10:52:56PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > Clang points out that adding something to NULL is notallowed > in standard C: > > fs/kernfs/file.c:127:15: warning: performing pointer arithmetic on a > null pointer has undefined behavior

[PATCH] seq_file: fix clang warning for NULL pointer arithmetic

2020-10-26 Thread Arnd Bergmann
From: Arnd Bergmann Clang points out that adding something to NULL is notallowed in standard C: fs/kernfs/file.c:127:15: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] return NULL + !*ppos;