drivers/regulator: fix when type is different from REGULATOR_VOLTAGE
Subsystems (2)
PATCH 1/1 drivers/regulator: fix when type is different from REGULATOR_VOLTAGE
From: Diego Liziero <[email protected]>
When regulator_desc->type is something different from REGULATOR_VOLTAGE or REGULATOR_CURRENT the if should probably return ERR_PTR(-EINVAL)
The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
@@ expression E; constant C; @@
(
- !E = C
+ E != C
)
---
tmp/cocci-output-26453-5bbb39-core.c renamed from drivers/regulator/core.c +2 -2
@@ -2001,8 +2001,8 @@ struct regulator_dev *regulator_registerif (regulator_desc->name =NULL || regulator_desc->ops =NULL )return ERR_PTR (-EINVAL ); -if (!regulator_desc->type =REGULATOR_VOLTAGE && - !regulator_desc->type =REGULATOR_CURRENT ) +if (regulator_desc->type !=REGULATOR_VOLTAGE && + regulator_desc->type !=REGULATOR_CURRENT )return ERR_PTR (-EINVAL );if (!init_data)
Re: [PATCH] drivers/regulator: fix when type is different from
Quoted 7 lines · Diego Liziero
From: Diego Liziero <[email protected]>
When
regulator_desc->typeis something different fromREGULATOR_VOLTAGEorREGULATOR_CURRENTthe if should probably returnERR_PTR(-EINVAL)The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
Liam Girdwood
AppliedRe: [PATCH] drivers/regulator: fix when type is different from
In reply to Diego LizieroQuoted 8 lines · Diego Liziero
From: Diego Liziero <[email protected]>
When
regulator_desc->typeis something different fromREGULATOR_VOLTAGEorREGULATOR_CURRENTthe if should probably returnERR_PTR(-EINVAL)The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
Quoted 8 lines
@@ expression E; constant C; @@
(
- !E = C
+ E != C
)Signed-off-by Diego Liziero <[email protected]>
Applied.
Thanks
Liam