From: Dan Carpenter Date: Sat, 29 May 2010 09:49:07 +0000 (+0000) Subject: Btrfs: The file argument for fsync() is never null X-Git-Tag: v3.0~4244^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f902af400b2499c80865c62a06fbbd15cf804fd;p=platform%2Fkernel%2Flinux-amlogic.git Btrfs: The file argument for fsync() is never null The "file" argument for fsync is never null so we can remove this check. What drew my attention here is that 7ea8085910e: "drop unused dentry argument to ->fsync" introduced an unconditional dereference at the start of the function and that generated a smatch warning. Signed-off-by: Dan Carpenter Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index ce0cd29..7f29464 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1139,7 +1139,7 @@ int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync) /* * ok we haven't committed the transaction yet, lets do a commit */ - if (file && file->private_data) + if (file->private_data) btrfs_ioctl_trans_end(file); trans = btrfs_start_transaction(root, 0);