diff mbox

[1/1] drm/exynos: drm_connector: Fix error check condition

Message ID 1363855799-18176-1-git-send-email-sachin.kamat@linaro.org
State Superseded
Headers show

Commit Message

Sachin Kamat March 21, 2013, 8:49 a.m. UTC
drm_add_edid_modes() returns 0 upon failure to find any modes.
Hence check for 0 and not less than 0.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Rahul Sharma <rahul.sharma@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_connector.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

대인기/Tizen Platform Lab(SR)/삼성전자 March 27, 2013, 10:36 a.m. UTC | #1
2013/3/21 Sachin Kamat <sachin.kamat@linaro.org>:
> drm_add_edid_modes() returns 0 upon failure to find any modes.
> Hence check for 0 and not less than 0.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Rahul Sharma <rahul.sharma@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_connector.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c
> index 4c5b685..56ac35f 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
> @@ -124,7 +124,7 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector)
>                 }
>
>                 count = drm_add_edid_modes(connector, edid);
> -               if (count < 0) {
> +               if (count == 0) {

Please just use 'if (!count)'

>                         DRM_ERROR("Add edid modes failed %d\n", count);
>                         goto out;
>                 }
> --
> 1.7.4.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Sachin Kamat March 27, 2013, 11:11 a.m. UTC | #2
On 27 March 2013 16:06, Inki Dae <inki.dae@samsung.com> wrote:
> 2013/3/21 Sachin Kamat <sachin.kamat@linaro.org>:
>> drm_add_edid_modes() returns 0 upon failure to find any modes.
>> Hence check for 0 and not less than 0.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>> Cc: Rahul Sharma <rahul.sharma@samsung.com>
>> ---
>>  drivers/gpu/drm/exynos/exynos_drm_connector.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c
>> index 4c5b685..56ac35f 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
>> @@ -124,7 +124,7 @@ static int exynos_drm_connector_get_modes(struct drm_connector *connector)
>>                 }
>>
>>                 count = drm_add_edid_modes(connector, edid);
>> -               if (count < 0) {
>> +               if (count == 0) {
>
> Please just use 'if (!count)'

Resent the patch with the suggested change.
diff mbox

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_connector.c b/drivers/gpu/drm/exynos/exynos_drm_connector.c
index 4c5b685..56ac35f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_connector.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_connector.c
@@ -124,7 +124,7 @@  static int exynos_drm_connector_get_modes(struct drm_connector *connector)
 		}
 
 		count = drm_add_edid_modes(connector, edid);
-		if (count < 0) {
+		if (count == 0) {
 			DRM_ERROR("Add edid modes failed %d\n", count);
 			goto out;
 		}