2022-06-07 14:07:45

by Saud Farooqui

[permalink] [raw]
Subject: [PATCH] drm/sun4i: Add return statement in sun4i_layer_format_mod_supported Add a missing return after the IS_ERR_OR_NULL() check in sun4i_layer_format_mod_supported()

Signed-off-by: Saud Farooqui <[email protected]>
---
drivers/gpu/drm/sun4i/sun4i_layer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
index 6d43080791a0..85fb9e800ddf 100644
--- a/drivers/gpu/drm/sun4i/sun4i_layer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
@@ -117,7 +117,7 @@ static bool sun4i_layer_format_mod_supported(struct drm_plane *plane,
struct sun4i_layer *layer = plane_to_sun4i_layer(plane);

if (IS_ERR_OR_NULL(layer->backend->frontend))
- sun4i_backend_format_is_supported(format, modifier);
+ return sun4i_backend_format_is_supported(format, modifier);

return sun4i_backend_format_is_supported(format, modifier) ||
sun4i_frontend_format_is_supported(format, modifier);
--
2.25.1


2022-06-09 14:25:58

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH] drm/sun4i: Add return statement in sun4i_layer_format_mod_supported Add a missing return after the IS_ERR_OR_NULL() check in sun4i_layer_format_mod_supported()

Hi,

On Tue, Jun 07, 2022 at 02:51:50PM +0500, Saud Farooqui wrote:
> Signed-off-by: Saud Farooqui <[email protected]>

Your patch doesn't seem to be formatted properly.

The commit title should be much shorter, and the commit log should
explain what the issue is, and what is done in that patch to address it.

Maxime


Attachments:
(No filename) (338.00 B)
signature.asc (235.00 B)
Download all attachments

2022-06-21 16:51:34

by Saud Farooqui

[permalink] [raw]
Subject: [PATCH v1] drm/sun4i: Return from the function in error condition

Added return statement in sun4i_layer_format_mod_supported()
in case of error.

Signed-off-by: Saud Farooqui <[email protected]>
---
drivers/gpu/drm/sun4i/sun4i_layer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
index 6d43080791a0..85fb9e800ddf 100644
--- a/drivers/gpu/drm/sun4i/sun4i_layer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
@@ -117,7 +117,7 @@ static bool sun4i_layer_format_mod_supported(struct drm_plane *plane,
struct sun4i_layer *layer = plane_to_sun4i_layer(plane);

if (IS_ERR_OR_NULL(layer->backend->frontend))
- sun4i_backend_format_is_supported(format, modifier);
+ return sun4i_backend_format_is_supported(format, modifier);

return sun4i_backend_format_is_supported(format, modifier) ||
sun4i_frontend_format_is_supported(format, modifier);
--
2.25.1

2022-06-22 08:14:12

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v1] drm/sun4i: Return from the function in error condition

Hi,

On Tue, Jun 21, 2022 at 09:44:27PM +0500, Saud Farooqui wrote:
> Added return statement in sun4i_layer_format_mod_supported()
> in case of error.
>
> Signed-off-by: Saud Farooqui <[email protected]>
> ---
> drivers/gpu/drm/sun4i/sun4i_layer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
> index 6d43080791a0..85fb9e800ddf 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_layer.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
> @@ -117,7 +117,7 @@ static bool sun4i_layer_format_mod_supported(struct drm_plane *plane,
> struct sun4i_layer *layer = plane_to_sun4i_layer(plane);
>
> if (IS_ERR_OR_NULL(layer->backend->frontend))
> - sun4i_backend_format_is_supported(format, modifier);
> + return sun4i_backend_format_is_supported(format, modifier);

While there's a bug, it definitely isn't what your commit message
describe.

Frontends only available on some SoCs and are thus optional in the
driver.

If the frontend pointer isn't set, it means that it isn't there and thus
we try to figure out the format through the backend that is always
there.

Maxime


Attachments:
(No filename) (1.18 kB)
signature.asc (235.00 B)
Download all attachments

2022-06-22 09:36:23

by Saud Farooqui

[permalink] [raw]
Subject: [PATCH v2] drm/sun4i: Return if frontend is not present

Added return statement in sun4i_layer_format_mod_supported()
in case frontend is not present.

Signed-off-by: Saud Farooqui <[email protected]>
---
drivers/gpu/drm/sun4i/sun4i_layer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
index 6d43080791a0..85fb9e800ddf 100644
--- a/drivers/gpu/drm/sun4i/sun4i_layer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
@@ -117,7 +117,7 @@ static bool sun4i_layer_format_mod_supported(struct drm_plane *plane,
struct sun4i_layer *layer = plane_to_sun4i_layer(plane);

if (IS_ERR_OR_NULL(layer->backend->frontend))
- sun4i_backend_format_is_supported(format, modifier);
+ return sun4i_backend_format_is_supported(format, modifier);

return sun4i_backend_format_is_supported(format, modifier) ||
sun4i_frontend_format_is_supported(format, modifier);
--
2.25.1

2022-06-22 15:40:18

by Maxime Ripard

[permalink] [raw]
Subject: Re: (subset) [PATCH v2] drm/sun4i: Return if frontend is not present

On Wed, 22 Jun 2022 13:59:17 +0500, Saud Farooqui wrote:
> Added return statement in sun4i_layer_format_mod_supported()
> in case frontend is not present.
>
>

Applied to drm/drm-misc (drm-misc-fixes).

Thanks!
Maxime

2022-06-27 14:16:27

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v2] drm/sun4i: Return if frontend is not present

On Wed, 22 Jun 2022 13:59:17 +0500, Saud Farooqui wrote:
> Added return statement in sun4i_layer_format_mod_supported()
> in case frontend is not present.
>
>

Applied to drm/drm-misc (drm-misc-fixes).

Thanks!
Maxime