From: kernel test robot <lkp@xxxxxxxxx> drivers/md/dm.c:2204:12-19: WARNING: ERR_CAST can be used with ksm Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)) Generated by: scripts/coccinelle/api/err_cast.cocci CC: Satya Tangirala <satyat@xxxxxxxxxx> Signed-off-by: kernel test robot <lkp@xxxxxxxxx> --- url: https://github.com/0day-ci/linux/commits/Satya-Tangirala/add-support-for-inline-encryption-to-device-mapper/20201016-054900 base: https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git for-next dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2201,7 +2201,7 @@ static struct dm_table *__bind(struct ma ksm = dm_init_inline_encryption(md, t); if (IS_ERR(ksm)) { - old_map = ERR_PTR(PTR_ERR(ksm)); + old_map = ERR_CAST(ksm); goto out; }