diff options
author | Maíra Canal <maira.canal@usp.br> | 2022-01-31 15:22:42 -0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2022-02-01 11:31:55 -0500 |
commit | 90b2433edb6d995bd23d6adde753095b4ab26104 (patch) | |
tree | 808609b1f7efc50d00639b0b0754008f821c1274 /include/linux/seq_file.h | |
parent | 6692531df62d812de5d22c8bca0d90edc163aa84 (diff) |
seq_file: fix NULL pointer arithmetic warning
Implement conditional logic in order to replace NULL pointer arithmetic.
The use of NULL pointer arithmetic was pointed out by clang with the
following warning:
fs/kernfs/file.c:128:15: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return NULL + !*ppos;
~~~~ ^
fs/seq_file.c:559:14: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return NULL + (*pos == 0);
Signed-off-by: Maíra Canal <maira.canal@usp.br>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/seq_file.h')
-rw-r--r-- | include/linux/seq_file.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 88cc16444b43..60820ab511d2 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -162,6 +162,7 @@ int seq_dentry(struct seq_file *, struct dentry *, const char *); int seq_path_root(struct seq_file *m, const struct path *path, const struct path *root, const char *esc); +void *single_start(struct seq_file *, loff_t *); int single_open(struct file *, int (*)(struct seq_file *, void *), void *); int single_open_size(struct file *, int (*)(struct seq_file *, void *), void *, size_t); int single_release(struct inode *, struct file *); |