[PATCH] ntfs: delete dead code

Dan Carpenter posted 1 patch 2 months ago
fs/ntfs/file.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
[PATCH] ntfs: delete dead code
Posted by Dan Carpenter 2 months ago
We know "ret2" is zero so there is no need to check.  Delete the
if statement.

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
 fs/ntfs/file.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
index e5b897a6c1e1..b04919124989 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -534,10 +534,9 @@ static ssize_t ntfs_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)
 			ret = -EIO;
 			goto out;
 		}
-		if (!ret2)
-			invalidate_mapping_pages(iocb->ki_filp->f_mapping,
-						 offset >> PAGE_SHIFT,
-						 end >> PAGE_SHIFT);
+		invalidate_mapping_pages(iocb->ki_filp->f_mapping,
+					 offset >> PAGE_SHIFT,
+					 end >> PAGE_SHIFT);
 	}
 
 out:
-- 
2.53.0
Re: [PATCH] ntfs: delete dead code
Posted by Hyunchul Lee 2 months ago
2026년 4월 10일 (금) 오후 7:11, Dan Carpenter <error27@gmail.com>님이 작성:
>
> We know "ret2" is zero so there is no need to check.  Delete the
> if statement.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Looks good to me.

Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>

> ---
>  fs/ntfs/file.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
> index e5b897a6c1e1..b04919124989 100644
> --- a/fs/ntfs/file.c
> +++ b/fs/ntfs/file.c
> @@ -534,10 +534,9 @@ static ssize_t ntfs_dio_write_iter(struct kiocb *iocb, struct iov_iter *from)
>                         ret = -EIO;
>                         goto out;
>                 }
> -               if (!ret2)
> -                       invalidate_mapping_pages(iocb->ki_filp->f_mapping,
> -                                                offset >> PAGE_SHIFT,
> -                                                end >> PAGE_SHIFT);
> +               invalidate_mapping_pages(iocb->ki_filp->f_mapping,
> +                                        offset >> PAGE_SHIFT,
> +                                        end >> PAGE_SHIFT);
>         }
>
>  out:
> --
> 2.53.0
>


-- 
Thanks,
Hyunchul