diff mbox

[1/1] video: exynos_mipi_dsi: Fix an error check condition

Message ID 1357124433-24455-1-git-send-email-sachin.kamat@linaro.org
State Accepted
Headers show

Commit Message

Sachin Kamat Jan. 2, 2013, 11 a.m. UTC
Checking an unsigned variable for negative value returns false.
Hence use the macro to fix it.

Fixes the following smatch warning:
drivers/video/exynos/exynos_mipi_dsi.c:417 exynos_mipi_dsi_probe()
warn: unsigned 'dsim->irq' is never less than zero.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/exynos/exynos_mipi_dsi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Donghwa Lee Jan. 3, 2013, 12:35 a.m. UTC | #1
On 01/02/2013 20:00, Sachin Kamat wrote:
> Checking an unsigned variable for negative value returns false.
> Hence use the macro to fix it.
>
> Fixes the following smatch warning:
> drivers/video/exynos/exynos_mipi_dsi.c:417 exynos_mipi_dsi_probe()
> warn: unsigned 'dsim->irq' is never less than zero.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>   drivers/video/exynos/exynos_mipi_dsi.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c
> index 4a17cdc..f623dfc 100644
> --- a/drivers/video/exynos/exynos_mipi_dsi.c
> +++ b/drivers/video/exynos/exynos_mipi_dsi.c
> @@ -414,7 +414,7 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev)
>   	}
>   
>   	dsim->irq = platform_get_irq(pdev, 0);
> -	if (dsim->irq < 0) {
> +	if (IS_ERR_VALUE(dsim->irq)) {
>   		dev_err(&pdev->dev, "failed to request dsim irq resource\n");
>   		ret = -EINVAL;
>   		goto err_platform_get_irq;
Hi,
It looks good to me.
Acked-by: Donghwa Lee <dh09.lee@samsung.com>

Thank you,
Donghwa Lee
diff mbox

Patch

diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c
index 4a17cdc..f623dfc 100644
--- a/drivers/video/exynos/exynos_mipi_dsi.c
+++ b/drivers/video/exynos/exynos_mipi_dsi.c
@@ -414,7 +414,7 @@  static int exynos_mipi_dsi_probe(struct platform_device *pdev)
 	}
 
 	dsim->irq = platform_get_irq(pdev, 0);
-	if (dsim->irq < 0) {
+	if (IS_ERR_VALUE(dsim->irq)) {
 		dev_err(&pdev->dev, "failed to request dsim irq resource\n");
 		ret = -EINVAL;
 		goto err_platform_get_irq;