* [PATCH] gpu/drm: delete same check in if condition
@ 2020-11-02 3:07 Bernard Zhao
2020-11-02 8:20 ` Thomas Zimmermann
0 siblings, 1 reply; 2+ messages in thread
From: Bernard Zhao @ 2020-11-02 3:07 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Daniel Vetter, dri-devel, linux-kernel
Cc: opensource.kernel, Bernard Zhao
In function drm_bridge_connector_get_modes_edid, drm_edid_is_valid
will check weather (!edid), no need to check again in the if
branch.
Signed-off-by: Bernard Zhao <bernard@vivo.com>
---
drivers/gpu/drm/drm_bridge_connector.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
index a58cbde59c34..791379816837 100644
--- a/drivers/gpu/drm/drm_bridge_connector.c
+++ b/drivers/gpu/drm/drm_bridge_connector.c
@@ -241,7 +241,7 @@ static int drm_bridge_connector_get_modes_edid(struct drm_connector *connector,
goto no_edid;
edid = bridge->funcs->get_edid(bridge, connector);
- if (!edid || !drm_edid_is_valid(edid)) {
+ if (!drm_edid_is_valid(edid)) {
kfree(edid);
goto no_edid;
}
--
2.29.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gpu/drm: delete same check in if condition
2020-11-02 3:07 [PATCH] gpu/drm: delete same check in if condition Bernard Zhao
@ 2020-11-02 8:20 ` Thomas Zimmermann
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Zimmermann @ 2020-11-02 8:20 UTC (permalink / raw)
To: Bernard Zhao, Maarten Lankhorst, Maxime Ripard, David Airlie,
Daniel Vetter, dri-devel, linux-kernel
Cc: opensource.kernel
[-- Attachment #1.1.1: Type: text/plain, Size: 1240 bytes --]
Hi
Am 02.11.20 um 04:07 schrieb Bernard Zhao:
> In function drm_bridge_connector_get_modes_edid, drm_edid_is_valid
> will check weather (!edid), no need to check again in the if
> branch.
>
> Signed-off-by: Bernard Zhao <bernard@vivo.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Thanks! I'll add the patch to drm-misc-next.
Best regards
Thomas
> ---
> drivers/gpu/drm/drm_bridge_connector.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
> index a58cbde59c34..791379816837 100644
> --- a/drivers/gpu/drm/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/drm_bridge_connector.c
> @@ -241,7 +241,7 @@ static int drm_bridge_connector_get_modes_edid(struct drm_connector *connector,
> goto no_edid;
>
> edid = bridge->funcs->get_edid(bridge, connector);
> - if (!edid || !drm_edid_is_valid(edid)) {
> + if (!drm_edid_is_valid(edid)) {
> kfree(edid);
> goto no_edid;
> }
>
--
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.1.2: OpenPGP_0x680DC11D530B7A23.asc --]
[-- Type: application/pgp-keys, Size: 4259 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-02 8:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 3:07 [PATCH] gpu/drm: delete same check in if condition Bernard Zhao
2020-11-02 8:20 ` Thomas Zimmermann
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).