* [PATCH] gpu: drm: radeon: r600_cp.c: Cleaning up uninitialized variables
@ 2014-05-31 23:10 Rickard Strandqvist
2014-06-02 7:48 ` Christian König
0 siblings, 1 reply; 3+ messages in thread
From: Rickard Strandqvist @ 2014-05-31 23:10 UTC (permalink / raw)
To: Alex Deucher, Christian König
Cc: Rickard Strandqvist, David Airlie, dri-devel, linux-kernel
There is a risk that the variable will be used without being initialized.
This was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
drivers/gpu/drm/radeon/r600_cp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/r600_cp.c b/drivers/gpu/drm/radeon/r600_cp.c
index 8c9b7e2..0770ad6 100644
--- a/drivers/gpu/drm/radeon/r600_cp.c
+++ b/drivers/gpu/drm/radeon/r600_cp.c
@@ -2615,7 +2615,7 @@ int r600_cs_legacy_ioctl(struct drm_device *dev, void *data, struct drm_file *fp
struct drm_radeon_cs *cs = data;
struct drm_buf *buf;
unsigned family;
- int l, r = 0;
+ int l = 0, r = 0;
u32 *ib, cs_id = 0;
if (dev_priv == NULL) {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gpu: drm: radeon: r600_cp.c: Cleaning up uninitialized variables
2014-05-31 23:10 [PATCH] gpu: drm: radeon: r600_cp.c: Cleaning up uninitialized variables Rickard Strandqvist
@ 2014-06-02 7:48 ` Christian König
2014-06-02 16:47 ` Rickard Strandqvist
0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2014-06-02 7:48 UTC (permalink / raw)
To: Rickard Strandqvist, Alex Deucher, Christian König
Cc: linux-kernel, dri-devel
Am 01.06.2014 01:10, schrieb Rickard Strandqvist:
> There is a risk that the variable will be used without being initialized.
>
> This was largely found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
On the one hand it looks like a valid fix to me, but on the other hand
the r600_cp.c code is deprecated for something like five years now.
I would like to avoid touching it in any way and just let it rest
peacefully until we can remove it entirely.
Christian.
> ---
> drivers/gpu/drm/radeon/r600_cp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/r600_cp.c b/drivers/gpu/drm/radeon/r600_cp.c
> index 8c9b7e2..0770ad6 100644
> --- a/drivers/gpu/drm/radeon/r600_cp.c
> +++ b/drivers/gpu/drm/radeon/r600_cp.c
> @@ -2615,7 +2615,7 @@ int r600_cs_legacy_ioctl(struct drm_device *dev, void *data, struct drm_file *fp
> struct drm_radeon_cs *cs = data;
> struct drm_buf *buf;
> unsigned family;
> - int l, r = 0;
> + int l = 0, r = 0;
> u32 *ib, cs_id = 0;
>
> if (dev_priv == NULL) {
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gpu: drm: radeon: r600_cp.c: Cleaning up uninitialized variables
2014-06-02 7:48 ` Christian König
@ 2014-06-02 16:47 ` Rickard Strandqvist
0 siblings, 0 replies; 3+ messages in thread
From: Rickard Strandqvist @ 2014-06-02 16:47 UTC (permalink / raw)
To: Christian König
Cc: Alex Deucher, Christian König, linux-kernel, dri-devel
Hi
Thanks for your response!
No, it does not sound like it's worth changing anything.
Although in the worst case with this patch you probably have a more
consistent error :)
Best regards
Rickard Strandqvist
2014-06-02 9:48 GMT+02:00 Christian König <deathsimple@vodafone.de>:
> Am 01.06.2014 01:10, schrieb Rickard Strandqvist:
>
>> There is a risk that the variable will be used without being initialized.
>>
>> This was largely found by using a static code analysis program called
>> cppcheck.
>>
>> Signed-off-by: Rickard Strandqvist
>> <rickard_strandqvist@spectrumdigital.se>
>
>
> On the one hand it looks like a valid fix to me, but on the other hand the
> r600_cp.c code is deprecated for something like five years now.
>
> I would like to avoid touching it in any way and just let it rest peacefully
> until we can remove it entirely.
>
> Christian.
>
>
>> ---
>> drivers/gpu/drm/radeon/r600_cp.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/r600_cp.c
>> b/drivers/gpu/drm/radeon/r600_cp.c
>> index 8c9b7e2..0770ad6 100644
>> --- a/drivers/gpu/drm/radeon/r600_cp.c
>> +++ b/drivers/gpu/drm/radeon/r600_cp.c
>> @@ -2615,7 +2615,7 @@ int r600_cs_legacy_ioctl(struct drm_device *dev,
>> void *data, struct drm_file *fp
>> struct drm_radeon_cs *cs = data;
>> struct drm_buf *buf;
>> unsigned family;
>> - int l, r = 0;
>> + int l = 0, r = 0;
>> u32 *ib, cs_id = 0;
>> if (dev_priv == NULL) {
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-02 16:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-31 23:10 [PATCH] gpu: drm: radeon: r600_cp.c: Cleaning up uninitialized variables Rickard Strandqvist
2014-06-02 7:48 ` Christian König
2014-06-02 16:47 ` Rickard Strandqvist
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).