Skip to content

Commit 00565cf

Browse files
Yuesong LiMikulas Patocka
authored andcommitted
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 <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]>
1 parent 02c0207 commit 00565cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/md/dm-thin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2948,7 +2948,7 @@ static struct pool *pool_create(struct mapped_device *pool_md,
29482948
pmd = dm_pool_metadata_open(metadata_dev, block_size, format_device);
29492949
if (IS_ERR(pmd)) {
29502950
*error = "Error creating metadata object";
2951-
return (struct pool *)pmd;
2951+
return ERR_CAST(pmd);
29522952
}
29532953

29542954
pool = kzalloc(sizeof(*pool), GFP_KERNEL);

0 commit comments

Comments
 (0)