Commit 00565cff authored by Yuesong Li's avatar Yuesong Li Committed by Mikulas Patocka

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: default avatarYuesong Li <liyuesong@vivo.com>
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
parent 02c0207e
...@@ -2948,7 +2948,7 @@ static struct pool *pool_create(struct mapped_device *pool_md, ...@@ -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); pmd = dm_pool_metadata_open(metadata_dev, block_size, format_device);
if (IS_ERR(pmd)) { if (IS_ERR(pmd)) {
*error = "Error creating metadata object"; *error = "Error creating metadata object";
return (struct pool *)pmd; return ERR_CAST(pmd);
} }
pool = kzalloc(sizeof(*pool), GFP_KERNEL); pool = kzalloc(sizeof(*pool), GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment