2020-11-10 08:06:00

by 赵军奎

[permalink] [raw]
Subject: [PATCH] amd/display/amdgpu_dm: delete same check in if condition

In function amdgpu_dm_connector_get_modes, drm_edid_is_valid
will check weather (!edid), no need to check again in the if
branch.

Signed-off-by: Bernard Zhao <[email protected]>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index e93e18c06c0e..0a283d07fe10 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -6352,7 +6352,7 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector)

encoder = amdgpu_dm_connector_to_encoder(connector);

- if (!edid || !drm_edid_is_valid(edid)) {
+ if (!drm_edid_is_valid(edid)) {
amdgpu_dm_connector->num_modes =
drm_add_modes_noedid(connector, 640, 480);
} else {
--
2.29.0


2020-11-10 14:16:36

by Harry Wentland

[permalink] [raw]
Subject: Re: [PATCH] amd/display/amdgpu_dm: delete same check in if condition

On 2020-11-10 3:03 a.m., Bernard Zhao wrote:
> In function amdgpu_dm_connector_get_modes, drm_edid_is_valid
> will check weather (!edid), no need to check again in the if
> branch.
>
> Signed-off-by: Bernard Zhao <[email protected]>

Reviewed-by: Harry Wentland <[email protected]>

Harry

> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index e93e18c06c0e..0a283d07fe10 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -6352,7 +6352,7 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector)
>
> encoder = amdgpu_dm_connector_to_encoder(connector);
>
> - if (!edid || !drm_edid_is_valid(edid)) {
> + if (!drm_edid_is_valid(edid)) {
> amdgpu_dm_connector->num_modes =
> drm_add_modes_noedid(connector, 640, 480);
> } else {
>

2020-11-10 18:37:48

by Alex Deucher

[permalink] [raw]
Subject: Re: [PATCH] amd/display/amdgpu_dm: delete same check in if condition

Applied. Thanks!

Alex

On Tue, Nov 10, 2020 at 9:13 AM Harry Wentland <[email protected]> wrote:
>
> On 2020-11-10 3:03 a.m., Bernard Zhao wrote:
> > In function amdgpu_dm_connector_get_modes, drm_edid_is_valid
> > will check weather (!edid), no need to check again in the if
> > branch.
> >
> > Signed-off-by: Bernard Zhao <[email protected]>
>
> Reviewed-by: Harry Wentland <[email protected]>
>
> Harry
>
> > ---
> > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > index e93e18c06c0e..0a283d07fe10 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> > @@ -6352,7 +6352,7 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector)
> >
> > encoder = amdgpu_dm_connector_to_encoder(connector);
> >
> > - if (!edid || !drm_edid_is_valid(edid)) {
> > + if (!drm_edid_is_valid(edid)) {
> > amdgpu_dm_connector->num_modes =
> > drm_add_modes_noedid(connector, 640, 480);
> > } else {
> >
> _______________________________________________
> amd-gfx mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx