From: "Darrick J. Wong" <djwong@kernel.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-xfs@vger.kernel.org, chandan.babu@oracle.com,
kent.overstreet@linux.dev, dchinner@redhat.com
Subject: Re: [PATCH -next] xfs: remove unnecessary check in xfile_create()
Date: Thu, 24 Aug 2023 09:14:28 -0700 [thread overview]
Message-ID: <20230824161428.GO11263@frogsfrogsfrogs> (raw)
In-Reply-To: <20230824091537.1072956-1-yangyingliang@huawei.com>
On Thu, Aug 24, 2023 at 05:15:37PM +0800, Yang Yingliang wrote:
> shmem_file_setup() returns ERR_PTR() when it fails,
> so remove the unnecessary null pointer check.
Technically correct, but what harm is there in leaving a null check in
case the shmem_file_setup function ever /does/ start returning NULL?
--D
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> 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.25.1
>
prev parent reply other threads:[~2023-08-24 16:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-24 9:15 [PATCH -next] xfs: remove unnecessary check in xfile_create() Yang Yingliang
2023-08-24 16:14 ` Darrick J. Wong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230824161428.GO11263@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=chandan.babu@oracle.com \
--cc=dchinner@redhat.com \
--cc=kent.overstreet@linux.dev \
--cc=linux-xfs@vger.kernel.org \
--cc=yangyingliang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox