public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: delete some dead code in xfile_create()
@ 2023-09-12 15:18 Dan Carpenter
  2023-09-12 15:38 ` Darrick J. Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2023-09-12 15:18 UTC (permalink / raw)
  To: Darrick J. Wong
  Cc: Chandan Babu R, Dave Chinner, Kent Overstreet, linux-xfs,
	kernel-janitors

The shmem_file_setup() function can't return NULL so there is no need
to check and doing so is a bit confusing.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
No fixes tag because this is not a bug, just some confusing code.

 fs/xfs/scrub/xfile.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/xfs/scrub/xfile.c b/fs/xfs/scrub/xfile.c
index d98e8e77c684..71779d81cad7 100644
--- a/fs/xfs/scrub/xfile.c
+++ b/fs/xfs/scrub/xfile.c
@@ -70,8 +70,6 @@ xfile_create(
 		return -ENOMEM;
 
 	xf->file = shmem_file_setup(description, isize, 0);
-	if (!xf->file)
-		goto out_xfile;
 	if (IS_ERR(xf->file)) {
 		error = PTR_ERR(xf->file);
 		goto out_xfile;
-- 
2.39.2


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

end of thread, other threads:[~2023-09-13  7:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-12 15:18 [PATCH] xfs: delete some dead code in xfile_create() Dan Carpenter
2023-09-12 15:38 ` Darrick J. Wong
2023-09-12 15:41   ` Alex Elder
2023-09-12 16:23     ` Darrick J. Wong
2023-09-13  7:01       ` Dan Carpenter
2023-09-13  6:32   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox