mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Yangtao Li <frank.li@vivo.com>
Cc: jaegeuk@kernel.org, chao@kernel.org,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: introduce f2fs_is_readonly() for readability
Date: Wed, 23 Nov 2022 18:32:32 +0000	[thread overview]
Message-ID: <Y35nQMuFRqiln0En@gmail.com> (raw)
In-Reply-To: <20221123170153.15888-1-frank.li@vivo.com>

On Thu, Nov 24, 2022 at 01:01:53AM +0800, Yangtao Li via Linux-f2fs-devel wrote:
> Introduce f2fs_is_readonly() and use it to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  fs/f2fs/f2fs.h  | 5 +++++
>  fs/f2fs/super.c | 5 ++---
>  2 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index f0833638f59e..efc9d6d7b506 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -4576,6 +4576,11 @@ static inline void f2fs_handle_page_eio(struct f2fs_sb_info *sbi, pgoff_t ofs,
>  	}
>  }
>  
> +static inline bool f2fs_is_readonly(struct f2fs_sb_info *sbi)
> +{
> +	return !!f2fs_sb_has_readonly(sbi) || f2fs_readonly(sbi->sb);
> +}

There is no need for the !! here.

- Eric

      reply	other threads:[~2022-11-23 18:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 17:01 Yangtao Li
2022-11-23 18:32 ` Eric Biggers [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=Y35nQMuFRqiln0En@gmail.com \
    --to=ebiggers@kernel.org \
    --cc=chao@kernel.org \
    --cc=frank.li@vivo.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®