Skip to content

Commit 4466dd3

Browse files
qianfengrongMikulas Patocka
authored andcommitted
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 <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]>
1 parent 9f5c33b commit 4466dd3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/md/dm-pcache/cache_req.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,8 @@ static int cache_write(struct pcache_cache *cache, struct pcache_request *pcache
805805
int cache_flush(struct pcache_cache *cache)
806806
{
807807
struct pcache_cache_kset *kset;
808-
u32 i, ret;
808+
int ret;
809+
u32 i;
809810

810811
for (i = 0; i < cache->n_ksets; i++) {
811812
kset = get_kset(cache, i);

0 commit comments

Comments
 (0)