Use IS_ERR_OR_NULL() rather than open coding it.
Signed-off-by: Viresh Kumar viresh.kumar@linaro.org --- drivers/regulator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 78387a6cbae5..55b49acfd9b3 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1595,7 +1595,7 @@ static void _regulator_put(struct regulator *regulator) { struct regulator_dev *rdev;
- if (regulator == NULL || IS_ERR(regulator)) + if (IS_ERR_OR_NULL(regulator)) return;
rdev = regulator->rdev;
On 17-08-15, 13:06, Mark Brown wrote:
That's the last I wanted to get ranted about, Sigh.
I thought, my base is the latest linux-next/master, which will have your latest updates. But that wasn't the case. I was sitting on a slightly older base. Sorry about that.
Will base out of your tree directly in future.
On Monday 17 August 2015 12:30:58 Viresh Kumar wrote:
The use of IS_ERR_OR_NULL is almost always a bug (as is the open-coded equivalent). Please try to find out why this is done here and add a comment if it's actually correct, or fix it if not.
My guess is that it is not ok to pass an error pointer as the argument of _regulator_put(), so maybe there should be WARN_ON()?
Arnd
linaro-kernel@lists.linaro.org