From: Coly Li <colyli@suse.de>
To: Zhang Zhen <zhangzhen.email@gmail.com>
Cc: linux-bcache@vger.kernel.org
Subject: Re: [PATCH] bcache: remove return value from bch_cached_dev_error
Date: Mon, 27 Feb 2023 21:52:20 +0800 [thread overview]
Message-ID: <Y/y1lJ6wXt3Isw6I@enigma.lan> (raw)
In-Reply-To: <ddeb178d-4889-4c41-9638-fa8b4aa5cb71@gmail.com>
On Mon, Feb 27, 2023 at 08:44:33PM +0800, Zhang Zhen wrote:
> The only caller of bch_cached_dev_error does not check the return
> value. We can make it a void function.
>
> Signed-off-by: Zhen Zhang <zhangzhen15@kuaishou.com>
NACK. I prefer to have the return values for different conditions,
even they are not used for now.
Coly Li
> ---
> drivers/md/bcache/bcache.h | 2 +-
> drivers/md/bcache/super.c | 5 ++---
> 2 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
> index aebb7ef10e63..ff175a2fb2f0 100644
> --- a/drivers/md/bcache/bcache.h
> +++ b/drivers/md/bcache/bcache.h
> @@ -990,7 +990,7 @@ int bch_bucket_alloc_set(struct cache_set *c, unsigned
> int reserve,
> bool bch_alloc_sectors(struct cache_set *c, struct bkey *k,
> unsigned int sectors, unsigned int write_point,
> unsigned int write_prio, bool wait);
> -bool bch_cached_dev_error(struct cached_dev *dc);
> +void bch_cached_dev_error(struct cached_dev *dc);
> __printf(2, 3)
> bool bch_cache_set_error(struct cache_set *c, const char *fmt, ...);
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index ba3909bb6bea..9923bb5c4fbe 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -1607,10 +1607,10 @@ int bch_flash_dev_create(struct cache_set *c,
> uint64_t size)
> return flash_dev_run(c, u);
> }
> -bool bch_cached_dev_error(struct cached_dev *dc)
> +void bch_cached_dev_error(struct cached_dev *dc)
> {
> if (!dc || test_bit(BCACHE_DEV_CLOSING, &dc->disk.flags))
> - return false;
> + return;
> dc->io_disable = true;
> /* make others know io_disable is true earlier */
> @@ -1620,7 +1620,6 @@ bool bch_cached_dev_error(struct cached_dev *dc)
> dc->disk.disk->disk_name, dc->bdev);
> bcache_device_stop(&dc->disk);
> - return true;
> }
> /* Cache set */
> --
> 2.27.0
>
--
Coly Li
prev parent reply other threads:[~2023-02-27 13:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230227124132.1925274-1-zhangzhen15@kuaishou.com>
2023-02-27 12:44 ` [PATCH] bcache: remove return value from bch_cached_dev_error Zhang Zhen
2023-02-27 13:52 ` Coly Li [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=Y/y1lJ6wXt3Isw6I@enigma.lan \
--to=colyli@suse.de \
--cc=linux-bcache@vger.kernel.org \
--cc=zhangzhen.email@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).