diff options
author | Yuesong Li <liyuesong@vivo.com> | 2024-08-30 06:16:42 +0300 |
---|---|---|
committer | Mikulas Patocka <mpatocka@redhat.com> | 2024-09-02 12:41:11 +0300 |
commit | 00565cff01262c888512bffe9d41e4831a6f2cc7 (patch) | |
tree | 003ca1541fec81ae4cecd66e962e1dace0981772 | |
parent | 02c0207ecdcc9abdf3442676154f8fd2be0f649a (diff) | |
download | linux-00565cff01262c888512bffe9d41e4831a6f2cc7.tar.xz |
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@vivo.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
-rw-r--r-- | drivers/md/dm-thin.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |