* [PATCH] drm/vc4: Remove unused variables
@ 2020-09-09 7:33 Tian Tao
2020-09-11 7:47 ` Thomas Zimmermann
0 siblings, 1 reply; 3+ messages in thread
From: Tian Tao @ 2020-09-09 7:33 UTC (permalink / raw
To: eric, airlied, daniel, dri-devel; +Cc: linuxarm
Fixes the following W=1 kernel build warning(s):
vc4_plane.c: In function ‘vc4_plane_init’:
vc4_plane.c:1340:6: warning: variable ‘ret’ set but not
used [-Wunused-but-set-variable]
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
drivers/gpu/drm/vc4/vc4_plane.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index 24d7e6d..5be0f5dda 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -1337,7 +1337,6 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
struct drm_plane *plane = NULL;
struct vc4_plane *vc4_plane;
u32 formats[ARRAY_SIZE(hvs_formats)];
- int ret = 0;
unsigned i;
static const uint64_t modifiers[] = {
DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED,
@@ -1357,7 +1356,7 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
formats[i] = hvs_formats[i].drm;
plane = &vc4_plane->base;
- ret = drm_universal_plane_init(dev, plane, 0,
+ drm_universal_plane_init(dev, plane, 0,
&vc4_plane_funcs,
formats, ARRAY_SIZE(formats),
modifiers, type, NULL);
--
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/vc4: Remove unused variables
2020-09-09 7:33 [PATCH] drm/vc4: Remove unused variables Tian Tao
@ 2020-09-11 7:47 ` Thomas Zimmermann
2020-09-11 8:13 ` tiantao (H)
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Zimmermann @ 2020-09-11 7:47 UTC (permalink / raw
To: Tian Tao, eric, airlied, daniel, dri-devel; +Cc: linuxarm
[-- Attachment #1.1.1: Type: text/plain, Size: 1624 bytes --]
Hi
Am 09.09.20 um 09:33 schrieb Tian Tao:
> Fixes the following W=1 kernel build warning(s):
> vc4_plane.c: In function ‘vc4_plane_init’:
> vc4_plane.c:1340:6: warning: variable ‘ret’ set but not
> used [-Wunused-but-set-variable]
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
> drivers/gpu/drm/vc4/vc4_plane.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
> index 24d7e6d..5be0f5dda 100644
> --- a/drivers/gpu/drm/vc4/vc4_plane.c
> +++ b/drivers/gpu/drm/vc4/vc4_plane.c
> @@ -1337,7 +1337,6 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
> struct drm_plane *plane = NULL;
> struct vc4_plane *vc4_plane;
> u32 formats[ARRAY_SIZE(hvs_formats)];
> - int ret = 0;
> unsigned i;
> static const uint64_t modifiers[] = {
> DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED,
> @@ -1357,7 +1356,7 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
> formats[i] = hvs_formats[i].drm;
>
> plane = &vc4_plane->base;
> - ret = drm_universal_plane_init(dev, plane, 0,
> + drm_universal_plane_init(dev, plane, 0,
> &vc4_plane_funcs,
> formats, ARRAY_SIZE(formats),
> modifiers, type, NULL);
IMHO vc4_plane_init() should rather handle ret correctly and return an
error if it's non-zero.
Best regards
Thomas
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 516 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
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
* Re: [PATCH] drm/vc4: Remove unused variables
2020-09-11 7:47 ` Thomas Zimmermann
@ 2020-09-11 8:13 ` tiantao (H)
0 siblings, 0 replies; 3+ messages in thread
From: tiantao (H) @ 2020-09-11 8:13 UTC (permalink / raw
To: Thomas Zimmermann, Tian Tao, eric, airlied, daniel, dri-devel; +Cc: linuxarm
Hi Thomas:
在 2020/9/11 15:47, Thomas Zimmermann 写道:
> Hi
>
> Am 09.09.20 um 09:33 schrieb Tian Tao:
>> Fixes the following W=1 kernel build warning(s):
>> vc4_plane.c: In function ‘vc4_plane_init’:
>> vc4_plane.c:1340:6: warning: variable ‘ret’ set but not
>> used [-Wunused-but-set-variable]
>>
>> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
>> ---
>> drivers/gpu/drm/vc4/vc4_plane.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
>> index 24d7e6d..5be0f5dda 100644
>> --- a/drivers/gpu/drm/vc4/vc4_plane.c
>> +++ b/drivers/gpu/drm/vc4/vc4_plane.c
>> @@ -1337,7 +1337,6 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
>> struct drm_plane *plane = NULL;
>> struct vc4_plane *vc4_plane;
>> u32 formats[ARRAY_SIZE(hvs_formats)];
>> - int ret = 0;
>> unsigned i;
>> static const uint64_t modifiers[] = {
>> DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED,
>> @@ -1357,7 +1356,7 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
>> formats[i] = hvs_formats[i].drm;
>>
>> plane = &vc4_plane->base;
>> - ret = drm_universal_plane_init(dev, plane, 0,
>> + drm_universal_plane_init(dev, plane, 0,
>> &vc4_plane_funcs,
>> formats, ARRAY_SIZE(formats),
>> modifiers, type, NULL);
>
> IMHO vc4_plane_init() should rather handle ret correctly and return an
> error if it's non-zero.
Thanks for the advice, I'm dropping the patch and re-posting anoher
patch to fix this warning.
>
> Best regards
> Thomas
>
>>
>
_______________________________________________
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:[~2020-09-14 7:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-09 7:33 [PATCH] drm/vc4: Remove unused variables Tian Tao
2020-09-11 7:47 ` Thomas Zimmermann
2020-09-11 8:13 ` tiantao (H)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.