lkml.org 
[lkml]   [2017]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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,
\
 
 \ /
  Last update: 2017-07-08 21:54    [W:0.071 / U:6.252 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site