* [PATCH] amdgpu: use NULL instead of 0 for pointer
@ 2016-06-15 20:15 Arnd Bergmann
2016-06-15 20:32 ` Christian König
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2016-06-15 20:15 UTC (permalink / raw)
To: Alex Deucher
Cc: Arnd Bergmann, Christian König, David Airlie, Rex Zhu,
dri-devel, linux-kernel
In the AMD powerplay driver, a pointer is checked for validity by
comparing against an integer '0', which causes a harmless warning
when building with "make W=1":
drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/processpptables.c:1502:16: error: ordered comparison of pointer with integer zero [-Werror=extra]
This changes the code to the more conventional "if (pointer)" check.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
index 2f1a14fe05b1..b64f42d2c3ae 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
@@ -1499,7 +1499,7 @@ int get_number_of_vce_state_table_entries(
const ATOM_PPLIB_VCE_State_Table *vce_table =
get_vce_state_table(hwmgr, table);
- if (vce_table > 0)
+ if (vce_table)
return vce_table->numEntries;
return 0;
--
2.9.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] amdgpu: use NULL instead of 0 for pointer
2016-06-15 20:15 [PATCH] amdgpu: use NULL instead of 0 for pointer Arnd Bergmann
@ 2016-06-15 20:32 ` Christian König
2016-06-15 21:28 ` Alex Deucher
0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2016-06-15 20:32 UTC (permalink / raw)
To: Arnd Bergmann, Alex Deucher
Cc: David Airlie, Rex Zhu, dri-devel, linux-kernel
Am 15.06.2016 um 22:15 schrieb Arnd Bergmann:
> In the AMD powerplay driver, a pointer is checked for validity by
> comparing against an integer '0', which causes a harmless warning
> when building with "make W=1":
>
> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/processpptables.c:1502:16: error: ordered comparison of pointer with integer zero [-Werror=extra]
>
> This changes the code to the more conventional "if (pointer)" check.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Christian König <christian.koenig@amd.com>.
> ---
> drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
> index 2f1a14fe05b1..b64f42d2c3ae 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
> @@ -1499,7 +1499,7 @@ int get_number_of_vce_state_table_entries(
> const ATOM_PPLIB_VCE_State_Table *vce_table =
> get_vce_state_table(hwmgr, table);
>
> - if (vce_table > 0)
> + if (vce_table)
> return vce_table->numEntries;
>
> return 0;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] amdgpu: use NULL instead of 0 for pointer
2016-06-15 20:32 ` Christian König
@ 2016-06-15 21:28 ` Alex Deucher
0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2016-06-15 21:28 UTC (permalink / raw)
To: Christian König
Cc: Arnd Bergmann, Alex Deucher, Rex Zhu, LKML, Maling list - DRI developers
On Wed, Jun 15, 2016 at 4:32 PM, Christian König
<christian.koenig@amd.com> wrote:
> Am 15.06.2016 um 22:15 schrieb Arnd Bergmann:
>>
>> In the AMD powerplay driver, a pointer is checked for validity by
>> comparing against an integer '0', which causes a harmless warning
>> when building with "make W=1":
>>
>> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/processpptables.c:1502:16:
>> error: ordered comparison of pointer with integer zero [-Werror=extra]
>>
>> This changes the code to the more conventional "if (pointer)" check.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>.
Applied. thanks!
Alex
>
>> ---
>> drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
>> b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
>> index 2f1a14fe05b1..b64f42d2c3ae 100644
>> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
>> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c
>> @@ -1499,7 +1499,7 @@ int get_number_of_vce_state_table_entries(
>> const ATOM_PPLIB_VCE_State_Table *vce_table =
>> get_vce_state_table(hwmgr, table);
>> - if (vce_table > 0)
>> + if (vce_table)
>> return vce_table->numEntries;
>> return 0;
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-15 21:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-15 20:15 [PATCH] amdgpu: use NULL instead of 0 for pointer Arnd Bergmann
2016-06-15 20:32 ` Christian König
2016-06-15 21:28 ` Alex Deucher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).