public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/exynos/vidi: Remove redundant error handling in vidi_get_modes()
@ 2025-03-06  4:27 ` Wentao Liang
  2025-03-07 14:48   ` Markus Elfring
  2025-03-19  3:30   ` 대인기/Tizen Platform Lab(SR)/삼성전자
  0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2025-03-06  4:27 UTC (permalink / raw)
  To: jani.nikula, inki.dae, sw0312.kim, kyungmin.park, airlied, simona,
	krzk, alim.akhtar
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Wentao Liang

In the vidi_get_modes() function, if either drm_edid_dup() or 
drm_edid_alloc() fails, the function will immediately return 0,
indicating that no display modes can be retrieved. However, in
the event of failure in these two functions, it is still necessary
to call the subsequent drm_edid_connector_update() function with
a NULL drm_edid as an argument. This ensures that operations such
as connector settings are performed in its callee function, 
_drm_edid_connector_property_update. To maintain the integrity of
the operation, redundant error handling needs to be removed.

Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/gpu/drm/exynos/exynos_drm_vidi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index fd388b1dbe68..a956cdb2f33a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -312,9 +312,6 @@ static int vidi_get_modes(struct drm_connector *connector)
 	else
 		drm_edid = drm_edid_alloc(fake_edid_info, sizeof(fake_edid_info));
 
-	if (!drm_edid)
-		return 0;
-
 	drm_edid_connector_update(connector, drm_edid);
 
 	count = drm_edid_connector_add_modes(connector);
-- 
2.42.0.windows.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/exynos/vidi: Remove redundant error handling in vidi_get_modes()
  2025-03-06  4:27 ` [PATCH] drm/exynos/vidi: Remove redundant error handling in vidi_get_modes() Wentao Liang
@ 2025-03-07 14:48   ` Markus Elfring
  2025-03-19  3:30   ` 대인기/Tizen Platform Lab(SR)/삼성전자
  1 sibling, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2025-03-07 14:48 UTC (permalink / raw)
  To: vulab, dri-devel, linux-arm-kernel, linux-samsung-soc
  Cc: LKML, Alim Akhtar, David Airlie, Inki Dae, Jani Nikula,
	Krzysztof Kozlowski, Kyungmin Park, Seung-Woo Kim, Simona Vetter

…
> drm_edid_alloc() fails, the function will immediately return 0,
…

                   failed?


…
> the event of failure in these two functions, it is still necessary
> to call the subsequent drm_edid_connector_update() function with
…

You may occasionally put more than 66 characters into text lines
of such a change description.


>                                    … To maintain the integrity of
> the operation, redundant error handling needs to be removed.

How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.14-rc5#n145

Regards,
Markus

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/exynos/vidi: Remove redundant error handling in vidi_get_modes()
  2025-03-06  4:27 ` [PATCH] drm/exynos/vidi: Remove redundant error handling in vidi_get_modes() Wentao Liang
  2025-03-07 14:48   ` Markus Elfring
@ 2025-03-19  3:30   ` 대인기/Tizen Platform Lab(SR)/삼성전자
  1 sibling, 0 replies; 3+ messages in thread
From: 대인기/Tizen Platform Lab(SR)/삼성전자 @ 2025-03-19  3:30 UTC (permalink / raw)
  To: 'Wentao Liang', jani.nikula, sw0312.kim, kyungmin.park,
	airlied, simona, krzk, alim.akhtar
  Cc: dri-devel, linux-arm-kernel, linux-samsung-soc, linux-kernel

Hi,

> -----Original Message-----
> From: Wentao Liang <vulab@iscas.ac.cn>
> Sent: Thursday, March 6, 2025 1:27 PM
> To: jani.nikula@linux.intel.com; inki.dae@samsung.com;
> sw0312.kim@samsung.com; kyungmin.park@samsung.com; airlied@gmail.com;
> simona@ffwll.ch; krzk@kernel.org; alim.akhtar@samsung.com
> Cc: dri-devel@lists.freedesktop.org; linux-arm-kernel@lists.infradead.org;
> linux-samsung-soc@vger.kernel.org; linux-kernel@vger.kernel.org; Wentao
> Liang <vulab@iscas.ac.cn>
> Subject: [PATCH] drm/exynos/vidi: Remove redundant error handling in
> vidi_get_modes()
> 
> In the vidi_get_modes() function, if either drm_edid_dup() or
> drm_edid_alloc() fails, the function will immediately return 0,
> indicating that no display modes can be retrieved. However, in
> the event of failure in these two functions, it is still necessary
> to call the subsequent drm_edid_connector_update() function with
> a NULL drm_edid as an argument. This ensures that operations such
> as connector settings are performed in its callee function,
> _drm_edid_connector_property_update. To maintain the integrity of
> the operation, redundant error handling needs to be removed.

You are right. Merged.

Thanks,
Inki Dae

> 
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_vidi.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> index fd388b1dbe68..a956cdb2f33a 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> @@ -312,9 +312,6 @@ static int vidi_get_modes(struct drm_connector
> *connector)
>  	else
>  		drm_edid = drm_edid_alloc(fake_edid_info,
> sizeof(fake_edid_info));
> 
> -	if (!drm_edid)
> -		return 0;
> -
>  	drm_edid_connector_update(connector, drm_edid);
> 
>  	count = drm_edid_connector_add_modes(connector);
> --
> 2.42.0.windows.2



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-19  3:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20250306042753epcas1p3983510872a862109f7f72aff5d074ea3@epcas1p3.samsung.com>
2025-03-06  4:27 ` [PATCH] drm/exynos/vidi: Remove redundant error handling in vidi_get_modes() Wentao Liang
2025-03-07 14:48   ` Markus Elfring
2025-03-19  3:30   ` 대인기/Tizen Platform Lab(SR)/삼성전자

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox