[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250829133748.104119-1-rongqianfeng@vivo.com>
Date: Fri, 29 Aug 2025 21:37:48 +0800
From: Qianfeng Rong <rongqianfeng@...o.com>
To: Dongsheng Yang <dongsheng.yang@...ux.dev>,
Zheng Gu <cengku@...il.com>,
dm-devel@...ts.linux.dev,
linux-kernel@...r.kernel.org
Cc: Qianfeng Rong <rongqianfeng@...o.com>
Subject: [PATCH] dm-pcache: use int type to store negative error codes
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@...o.com>
---
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);
--
2.34.1
Powered by blists - more mailing lists