linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: fix warning about Using plain integer as NULL pointer
@ 2019-03-22 22:10 Hariprasad Kelam
  2019-03-25 16:28 ` Jan Kara
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Hariprasad Kelam @ 2019-03-22 22:10 UTC (permalink / raw)
  To: Jaegeuk Kim, Chao Yu, Jan Kara, Amir Goldstein,
	Richard Weinberger, Artem Bityutskiy, Adrian Hunter,
	linux-f2fs-devel, linux-kernel, linux-fsdevel, linux-mtd

Sparse warning below:

sudo make C=2 CF=-D__CHECK_ENDIAN__ M=fs

CHECK   fs/f2fs/data.c
fs/f2fs/data.c:426:47: warning: Using plain integer as NULL pointer
CHECK   fs/notify/fdinfo.c
fs/notify/fdinfo.c:53:87: warning: Using plain integer as NULL pointer
 CHECK   fs/ubifs/xattr.c
fs/ubifs/xattr.c:615:58: warning: Using plain integer as NULL pointer

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
 fs/f2fs/data.c     | 2 +-
 fs/notify/fdinfo.c | 2 +-
 fs/ubifs/xattr.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 97279441..15a2381 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -423,7 +423,7 @@ static void __submit_merged_write_cond(struct f2fs_sb_info *sbi,
 
 void f2fs_submit_merged_write(struct f2fs_sb_info *sbi, enum page_type type)
 {
-	__submit_merged_write_cond(sbi, NULL, 0, 0, type, true);
+	__submit_merged_write_cond(sbi, NULL, NULL, 0, type, true);
 }
 
 void f2fs_submit_merged_write_cond(struct f2fs_sb_info *sbi,
diff --git a/fs/notify/fdinfo.c b/fs/notify/fdinfo.c
index 1e2bfd2..ef83f40 100644
--- a/fs/notify/fdinfo.c
+++ b/fs/notify/fdinfo.c
@@ -50,7 +50,7 @@ static void show_mark_fhandle(struct seq_file *m, struct inode *inode)
 	f.handle.handle_bytes = sizeof(f.pad);
 	size = f.handle.handle_bytes >> 2;
 
-	ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, 0);
+	ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, NULL);
 	if ((ret == FILEID_INVALID) || (ret < 0)) {
 		WARN_ONCE(1, "Can't encode file handler for inotify: %d\n", ret);
 		return;
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
index f5ad1ed..066a566 100644
--- a/fs/ubifs/xattr.c
+++ b/fs/ubifs/xattr.c
@@ -612,7 +612,7 @@ int ubifs_init_security(struct inode *dentry, struct inode *inode,
 	int err;
 
 	err = security_inode_init_security(inode, dentry, qstr,
-					   &init_xattrs, 0);
+					   &init_xattrs, NULL);
 	if (err) {
 		struct ubifs_info *c = dentry->i_sb->s_fs_info;
 		ubifs_err(c, "cannot initialize security for inode %lu, error %d",
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] fs: fix warning about Using plain integer as NULL pointer
  2019-03-22 22:10 [PATCH] fs: fix warning about Using plain integer as NULL pointer Hariprasad Kelam
@ 2019-03-25 16:28 ` Jan Kara
  2019-03-26  1:02 ` Chao Yu
  2019-03-27 13:53 ` Mukesh Ojha
  2 siblings, 0 replies; 4+ messages in thread
From: Jan Kara @ 2019-03-25 16:28 UTC (permalink / raw)
  To: Hariprasad Kelam
  Cc: Jaegeuk Kim, Chao Yu, Jan Kara, Amir Goldstein,
	Richard Weinberger, Artem Bityutskiy, Adrian Hunter,
	linux-f2fs-devel, linux-kernel, linux-fsdevel, linux-mtd

On Sat 23-03-19 03:40:21, Hariprasad Kelam wrote:
> Sparse warning below:
> 
> sudo make C=2 CF=-D__CHECK_ENDIAN__ M=fs
> 
> CHECK   fs/f2fs/data.c
> fs/f2fs/data.c:426:47: warning: Using plain integer as NULL pointer
> CHECK   fs/notify/fdinfo.c
> fs/notify/fdinfo.c:53:87: warning: Using plain integer as NULL pointer
>  CHECK   fs/ubifs/xattr.c
> fs/ubifs/xattr.c:615:58: warning: Using plain integer as NULL pointer
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>

fs/notify part looks good to me. Feel free to add:

Acked-by: Jan Kara <jack@suse.cz>

								Honza


> ---
>  fs/f2fs/data.c     | 2 +-
>  fs/notify/fdinfo.c | 2 +-
>  fs/ubifs/xattr.c   | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 97279441..15a2381 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -423,7 +423,7 @@ static void __submit_merged_write_cond(struct f2fs_sb_info *sbi,
>  
>  void f2fs_submit_merged_write(struct f2fs_sb_info *sbi, enum page_type type)
>  {
> -	__submit_merged_write_cond(sbi, NULL, 0, 0, type, true);
> +	__submit_merged_write_cond(sbi, NULL, NULL, 0, type, true);
>  }
>  
>  void f2fs_submit_merged_write_cond(struct f2fs_sb_info *sbi,
> diff --git a/fs/notify/fdinfo.c b/fs/notify/fdinfo.c
> index 1e2bfd2..ef83f40 100644
> --- a/fs/notify/fdinfo.c
> +++ b/fs/notify/fdinfo.c
> @@ -50,7 +50,7 @@ static void show_mark_fhandle(struct seq_file *m, struct inode *inode)
>  	f.handle.handle_bytes = sizeof(f.pad);
>  	size = f.handle.handle_bytes >> 2;
>  
> -	ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, 0);
> +	ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, NULL);
>  	if ((ret == FILEID_INVALID) || (ret < 0)) {
>  		WARN_ONCE(1, "Can't encode file handler for inotify: %d\n", ret);
>  		return;
> diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
> index f5ad1ed..066a566 100644
> --- a/fs/ubifs/xattr.c
> +++ b/fs/ubifs/xattr.c
> @@ -612,7 +612,7 @@ int ubifs_init_security(struct inode *dentry, struct inode *inode,
>  	int err;
>  
>  	err = security_inode_init_security(inode, dentry, qstr,
> -					   &init_xattrs, 0);
> +					   &init_xattrs, NULL);
>  	if (err) {
>  		struct ubifs_info *c = dentry->i_sb->s_fs_info;
>  		ubifs_err(c, "cannot initialize security for inode %lu, error %d",
> -- 
> 2.7.4
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fs: fix warning about Using plain integer as NULL pointer
  2019-03-22 22:10 [PATCH] fs: fix warning about Using plain integer as NULL pointer Hariprasad Kelam
  2019-03-25 16:28 ` Jan Kara
@ 2019-03-26  1:02 ` Chao Yu
  2019-03-27 13:53 ` Mukesh Ojha
  2 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2019-03-26  1:02 UTC (permalink / raw)
  To: Hariprasad Kelam, Jaegeuk Kim, Jan Kara, Amir Goldstein,
	Richard Weinberger, Artem Bityutskiy, Adrian Hunter,
	linux-f2fs-devel, linux-kernel, linux-fsdevel, linux-mtd

On 2019/3/23 6:10, Hariprasad Kelam wrote:
> Sparse warning below:
> 
> sudo make C=2 CF=-D__CHECK_ENDIAN__ M=fs
> 
> CHECK   fs/f2fs/data.c
> fs/f2fs/data.c:426:47: warning: Using plain integer as NULL pointer
> CHECK   fs/notify/fdinfo.c
> fs/notify/fdinfo.c:53:87: warning: Using plain integer as NULL pointer
>  CHECK   fs/ubifs/xattr.c
> fs/ubifs/xattr.c:615:58: warning: Using plain integer as NULL pointer
> 
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>

f2fs part looks good to me.

Acked-by: Chao Yu <yuchao0@huawei.com>

Thanks,

> ---
>  fs/f2fs/data.c     | 2 +-
>  fs/notify/fdinfo.c | 2 +-
>  fs/ubifs/xattr.c   | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 97279441..15a2381 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -423,7 +423,7 @@ static void __submit_merged_write_cond(struct f2fs_sb_info *sbi,
>  
>  void f2fs_submit_merged_write(struct f2fs_sb_info *sbi, enum page_type type)
>  {
> -	__submit_merged_write_cond(sbi, NULL, 0, 0, type, true);
> +	__submit_merged_write_cond(sbi, NULL, NULL, 0, type, true);
>  }
>  
>  void f2fs_submit_merged_write_cond(struct f2fs_sb_info *sbi,
> diff --git a/fs/notify/fdinfo.c b/fs/notify/fdinfo.c
> index 1e2bfd2..ef83f40 100644
> --- a/fs/notify/fdinfo.c
> +++ b/fs/notify/fdinfo.c
> @@ -50,7 +50,7 @@ static void show_mark_fhandle(struct seq_file *m, struct inode *inode)
>  	f.handle.handle_bytes = sizeof(f.pad);
>  	size = f.handle.handle_bytes >> 2;
>  
> -	ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, 0);
> +	ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, NULL);
>  	if ((ret == FILEID_INVALID) || (ret < 0)) {
>  		WARN_ONCE(1, "Can't encode file handler for inotify: %d\n", ret);
>  		return;
> diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
> index f5ad1ed..066a566 100644
> --- a/fs/ubifs/xattr.c
> +++ b/fs/ubifs/xattr.c
> @@ -612,7 +612,7 @@ int ubifs_init_security(struct inode *dentry, struct inode *inode,
>  	int err;
>  
>  	err = security_inode_init_security(inode, dentry, qstr,
> -					   &init_xattrs, 0);
> +					   &init_xattrs, NULL);
>  	if (err) {
>  		struct ubifs_info *c = dentry->i_sb->s_fs_info;
>  		ubifs_err(c, "cannot initialize security for inode %lu, error %d",
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fs: fix warning about Using plain integer as NULL pointer
  2019-03-22 22:10 [PATCH] fs: fix warning about Using plain integer as NULL pointer Hariprasad Kelam
  2019-03-25 16:28 ` Jan Kara
  2019-03-26  1:02 ` Chao Yu
@ 2019-03-27 13:53 ` Mukesh Ojha
  2 siblings, 0 replies; 4+ messages in thread
From: Mukesh Ojha @ 2019-03-27 13:53 UTC (permalink / raw)
  To: Hariprasad Kelam, Jaegeuk Kim, Chao Yu, Jan Kara, Amir Goldstein,
	Richard Weinberger, Artem Bityutskiy, Adrian Hunter,
	linux-f2fs-devel, linux-kernel, linux-fsdevel, linux-mtd


On 3/23/2019 3:40 AM, Hariprasad Kelam wrote:
> Sparse warning below:
>
> sudo make C=2 CF=-D__CHECK_ENDIAN__ M=fs
>
> CHECK   fs/f2fs/data.c
> fs/f2fs/data.c:426:47: warning: Using plain integer as NULL pointer
> CHECK   fs/notify/fdinfo.c
> fs/notify/fdinfo.c:53:87: warning: Using plain integer as NULL pointer
>   CHECK   fs/ubifs/xattr.c
> fs/ubifs/xattr.c:615:58: warning: Using plain integer as NULL pointer
>
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>


Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

-Mukesh

> ---
>   fs/f2fs/data.c     | 2 +-
>   fs/notify/fdinfo.c | 2 +-
>   fs/ubifs/xattr.c   | 2 +-
>   3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 97279441..15a2381 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -423,7 +423,7 @@ static void __submit_merged_write_cond(struct f2fs_sb_info *sbi,
>   
>   void f2fs_submit_merged_write(struct f2fs_sb_info *sbi, enum page_type type)
>   {
> -	__submit_merged_write_cond(sbi, NULL, 0, 0, type, true);
> +	__submit_merged_write_cond(sbi, NULL, NULL, 0, type, true);
>   }
>   
>   void f2fs_submit_merged_write_cond(struct f2fs_sb_info *sbi,
> diff --git a/fs/notify/fdinfo.c b/fs/notify/fdinfo.c
> index 1e2bfd2..ef83f40 100644
> --- a/fs/notify/fdinfo.c
> +++ b/fs/notify/fdinfo.c
> @@ -50,7 +50,7 @@ static void show_mark_fhandle(struct seq_file *m, struct inode *inode)
>   	f.handle.handle_bytes = sizeof(f.pad);
>   	size = f.handle.handle_bytes >> 2;
>   
> -	ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, 0);
> +	ret = exportfs_encode_inode_fh(inode, (struct fid *)f.handle.f_handle, &size, NULL);
>   	if ((ret == FILEID_INVALID) || (ret < 0)) {
>   		WARN_ONCE(1, "Can't encode file handler for inotify: %d\n", ret);
>   		return;
> diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
> index f5ad1ed..066a566 100644
> --- a/fs/ubifs/xattr.c
> +++ b/fs/ubifs/xattr.c
> @@ -612,7 +612,7 @@ int ubifs_init_security(struct inode *dentry, struct inode *inode,
>   	int err;
>   
>   	err = security_inode_init_security(inode, dentry, qstr,
> -					   &init_xattrs, 0);
> +					   &init_xattrs, NULL);
>   	if (err) {
>   		struct ubifs_info *c = dentry->i_sb->s_fs_info;
>   		ubifs_err(c, "cannot initialize security for inode %lu, error %d",

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-27 13:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-22 22:10 [PATCH] fs: fix warning about Using plain integer as NULL pointer Hariprasad Kelam
2019-03-25 16:28 ` Jan Kara
2019-03-26  1:02 ` Chao Yu
2019-03-27 13:53 ` Mukesh Ojha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).