From: Yuesong Li Date: Fri, 30 Aug 2024 03:16:42 +0000 (+0800) Subject: dm: Convert to use ERR_CAST() X-Git-Tag: v6.12-rc1~30^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=00565cff01262c888512bffe9d41e4831a6f2cc7;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Mikulas Patocka --- diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index a0c1620e90c8c..89632ce977605 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);