, replace -1
by false, and 0 by true.
This issue was found by the following Coccinelle semantic patch:
@@
identifier f, ret;
constant C;
typedef bool;
@@
bool f (...){
<+...
ret = -C;
...
* return ret;
...+>
}
Signed-off-by: Peter Senna Tschudin
Signed-off-by: Andrew Shadura
---
tools/t
ct a boolean value here.
>>
>> This issue has been found using the following Coccinelle semantic patch
>> written by Peter Senna Tschudin:
>>
>> @@
>> identifier f;
>> constant C;
>> typedef bool;
>> @@
>> bool f (...){
>> <+...
<+...
* return -C;
...+>
}
Signed-off-by: Andrew Shadura
---
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
index 7
<+...
* return -C;
...+>
}
Signed-off-by: Andrew Shadura
---
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
index 7
On 17/09/15 13:03, Peter Senna Tschudin wrote:
> Returning a negative value for a boolean function seem to have the
> undesired effect of returning true. require_paranoia_below() is a
> boolean function, but the variable used to store the return value is an
> integer, receiving -1 or 0. This patch
5 matches
Mail list logo