From: Dongsheng Yang <dongsheng.yang@linux.dev>
To: Qianfeng Rong <rongqianfeng@vivo.com>,
Zheng Gu <cengku@gmail.com>,
dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dm-pcache: use int type to store negative error codes
Date: Mon, 1 Sep 2025 14:25:08 +0800 [thread overview]
Message-ID: <eae2404f-1244-44a3-b0a2-c5393a508765@linux.dev> (raw)
In-Reply-To: <20250829133748.104119-1-rongqianfeng@vivo.com>
在 8/29/2025 9:37 PM, Qianfeng Rong 写道:
> Change the 'ret' variable from u32 to int to store negative error codes or
> zero returned by cache_kset_close().
>
> Storing the negative error codes in unsigned type, doesn't cause an issue
> at runtime but it's ugly. Additionally, assigning negative error codes to
> unsigned type may trigger a GCC warning when the -Wsign-conversion flag
> is enabled.
>
> No effect on runtime.
>
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Looks good to me.
Thanx
> ---
> drivers/md/dm-pcache/cache_req.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/md/dm-pcache/cache_req.c b/drivers/md/dm-pcache/cache_req.c
> index bd5cace7de71..27f94c1fa968 100644
> --- a/drivers/md/dm-pcache/cache_req.c
> +++ b/drivers/md/dm-pcache/cache_req.c
> @@ -805,7 +805,8 @@ static int cache_write(struct pcache_cache *cache, struct pcache_request *pcache
> int cache_flush(struct pcache_cache *cache)
> {
> struct pcache_cache_kset *kset;
> - u32 i, ret;
> + int ret;
> + u32 i;
>
> for (i = 0; i < cache->n_ksets; i++) {
> kset = get_kset(cache, i);
prev parent reply other threads:[~2025-09-01 6:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 13:37 [PATCH] dm-pcache: use int type to store negative error codes Qianfeng Rong
2025-09-01 6:25 ` Dongsheng Yang [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=eae2404f-1244-44a3-b0a2-c5393a508765@linux.dev \
--to=dongsheng.yang@linux.dev \
--cc=cengku@gmail.com \
--cc=dm-devel@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=rongqianfeng@vivo.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 NNTP newsgroup(s).