[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240830031642.78849-1-liyuesong@vivo.com>
Date: Fri, 30 Aug 2024 11:16:42 +0800
From: Yuesong Li <liyuesong@...o.com>
To: agk@...hat.com,
snitzer@...nel.org
Cc: dm-devel@...ts.linux.dev,
linux-kernel@...r.kernel.org,
opensource.kernel@...o.com,
Yuesong Li <liyuesong@...o.com>
Subject: [PATCH v1] dm: Convert to use ERR_CAST()
Use ERR_CAST() as it is designed for casting an error pointer to
another type.
This macro utilizes the __force and __must_check modifiers, which instruct
the compiler to verify for errors at the locations where it is employed.
Signed-off-by: Yuesong Li <liyuesong@...o.com>
---
drivers/md/dm-thin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index a0c1620e90c8..89632ce97760 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -2948,7 +2948,7 @@ static struct pool *pool_create(struct mapped_device *pool_md,
pmd = dm_pool_metadata_open(metadata_dev, block_size, format_device);
if (IS_ERR(pmd)) {
*error = "Error creating metadata object";
- return (struct pool *)pmd;
+ return ERR_CAST(pmd);
}
pool = kzalloc(sizeof(*pool), GFP_KERNEL);
--
2.34.1
Powered by blists - more mailing lists