dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] dm-pcache: fix warnings found by smatch
@ 2025-08-19  3:43 Dongsheng Yang
  2025-08-19  3:43 ` [PATCH 1/2] dm-pcache: fix uninitialized variable issue " Dongsheng Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dongsheng Yang @ 2025-08-19  3:43 UTC (permalink / raw)
  To: mpatocka, agk, snitzer; +Cc: dm-devel, dan.carpenter, Dongsheng Yang

Hi Mikulas,
	Please help to apply these two changes into dm-6.18.
It fixes two warnings found by smatch.

Thanx for the report from Dan.

Dongsheng Yang (2):
  dm-pcache: fix uninitialized variable issue found by smatch
  dm-pcache: fix an indenting issue found by smatch

 drivers/md/dm-pcache/cache_req.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] dm-pcache: fix uninitialized variable issue found by smatch
  2025-08-19  3:43 [PATCH 0/2] dm-pcache: fix warnings found by smatch Dongsheng Yang
@ 2025-08-19  3:43 ` Dongsheng Yang
  2025-08-19  3:43 ` [PATCH 2/2] dm-pcache: fix an indenting " Dongsheng Yang
  2025-08-19  9:18 ` [PATCH 0/2] dm-pcache: fix warnings " Mikulas Patocka
  2 siblings, 0 replies; 4+ messages in thread
From: Dongsheng Yang @ 2025-08-19  3:43 UTC (permalink / raw)
  To: mpatocka, agk, snitzer; +Cc: dm-devel, dan.carpenter, Dongsheng Yang

Signed-off-by: Dongsheng Yang <dongsheng.yang@linux.dev>
---
 drivers/md/dm-pcache/cache_req.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-pcache/cache_req.c b/drivers/md/dm-pcache/cache_req.c
index 992a1ad98909..e0b90bfea4fe 100644
--- a/drivers/md/dm-pcache/cache_req.c
+++ b/drivers/md/dm-pcache/cache_req.c
@@ -45,6 +45,7 @@ static int cache_data_alloc(struct pcache_cache *cache, struct pcache_cache_key
 	preempt_disable();
 	data_head = get_data_head(cache);
 again:
+	to_alloc = key->len - allocated;
 	if (!data_head->head_pos.cache_seg) {
 		seg_remain = 0;
 	} else {
@@ -54,7 +55,6 @@ static int cache_data_alloc(struct pcache_cache *cache, struct pcache_cache_key
 		head_pos = &data_head->head_pos;
 		cache_seg = head_pos->cache_seg;
 		seg_remain = cache_seg_remain(head_pos);
-		to_alloc = key->len - allocated;
 	}
 
 	if (seg_remain > to_alloc) {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] dm-pcache: fix an indenting issue found by smatch
  2025-08-19  3:43 [PATCH 0/2] dm-pcache: fix warnings found by smatch Dongsheng Yang
  2025-08-19  3:43 ` [PATCH 1/2] dm-pcache: fix uninitialized variable issue " Dongsheng Yang
@ 2025-08-19  3:43 ` Dongsheng Yang
  2025-08-19  9:18 ` [PATCH 0/2] dm-pcache: fix warnings " Mikulas Patocka
  2 siblings, 0 replies; 4+ messages in thread
From: Dongsheng Yang @ 2025-08-19  3:43 UTC (permalink / raw)
  To: mpatocka, agk, snitzer; +Cc: dm-devel, dan.carpenter, Dongsheng Yang

Signed-off-by: Dongsheng Yang <dongsheng.yang@linux.dev>
---
 drivers/md/dm-pcache/cache_req.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-pcache/cache_req.c b/drivers/md/dm-pcache/cache_req.c
index e0b90bfea4fe..bd5cace7de71 100644
--- a/drivers/md/dm-pcache/cache_req.c
+++ b/drivers/md/dm-pcache/cache_req.c
@@ -298,7 +298,7 @@ static struct pcache_backing_dev_req *get_pre_alloc_req(struct pcache_cache_subt
 		return backing_req;
 	}
 
-       return cache_miss_req_alloc(cache, pcache_req, GFP_NOWAIT);
+	return cache_miss_req_alloc(cache, pcache_req, GFP_NOWAIT);
 }
 
 /*
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] dm-pcache: fix warnings found by smatch
  2025-08-19  3:43 [PATCH 0/2] dm-pcache: fix warnings found by smatch Dongsheng Yang
  2025-08-19  3:43 ` [PATCH 1/2] dm-pcache: fix uninitialized variable issue " Dongsheng Yang
  2025-08-19  3:43 ` [PATCH 2/2] dm-pcache: fix an indenting " Dongsheng Yang
@ 2025-08-19  9:18 ` Mikulas Patocka
  2 siblings, 0 replies; 4+ messages in thread
From: Mikulas Patocka @ 2025-08-19  9:18 UTC (permalink / raw)
  To: Dongsheng Yang; +Cc: agk, snitzer, dm-devel, dan.carpenter



On Tue, 19 Aug 2025, Dongsheng Yang wrote:

> Hi Mikulas,
> 	Please help to apply these two changes into dm-6.18.
> It fixes two warnings found by smatch.
> 
> Thanx for the report from Dan.
> 
> Dongsheng Yang (2):
>   dm-pcache: fix uninitialized variable issue found by smatch
>   dm-pcache: fix an indenting issue found by smatch
> 
>  drivers/md/dm-pcache/cache_req.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> -- 
> 2.43.0

Thanks. I folded them into the existing patch.

Mikulas


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-08-19  9:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19  3:43 [PATCH 0/2] dm-pcache: fix warnings found by smatch Dongsheng Yang
2025-08-19  3:43 ` [PATCH 1/2] dm-pcache: fix uninitialized variable issue " Dongsheng Yang
2025-08-19  3:43 ` [PATCH 2/2] dm-pcache: fix an indenting " Dongsheng Yang
2025-08-19  9:18 ` [PATCH 0/2] dm-pcache: fix warnings " Mikulas Patocka

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).