Messages in this thread Patch in this message | | | Date | Sun, 9 Jul 2017 03:52:27 +0800 | From | kbuild test robot <> | Subject | [PATCH] mux: fix err_cast.cocci warnings |
| |
drivers/mux/mux-core.c:491:9-16: WARNING: ERR_CAST can be used with mux_chip
Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
Generated by: scripts/coccinelle/api/err_cast.cocci
Fixes: 1203d8a531ed ("mux: Add new API to get mux_control ref by device name.") CC: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> ---
mux-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/mux/mux-core.c +++ b/drivers/mux/mux-core.c @@ -488,7 +488,7 @@ struct mux_control *mux_control_get_by_i mux_chip = mux_chip_get_by_index(devname, chip_index); if (IS_ERR(mux_chip)) - return ERR_PTR(PTR_ERR(mux_chip)); + return ERR_CAST(mux_chip); if (ctrl_index >= mux_chip->controllers) { dev_err(&mux_chip->dev,
| |