public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Donghwa Lee <dh09.lee@samsung.com>
To: Andrei Epure <epure.andrei@gmail.com>
Cc: inki.dae@samsung.com, kyungmin.park@samsung.com,
	FlorianSchandinat@gmx.de, linux-fbdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] video: exynos: remove useless safety check in list traversal
Date: Thu, 28 Mar 2013 09:04:00 +0900	[thread overview]
Message-ID: <515388F0.3060604@samsung.com> (raw)
In-Reply-To: <1364419145-30375-1-git-send-email-epure.andrei@gmail.com>


Hi,

It looks good to me.

Acked-by: Donghwa Lee <dh09.lee@samsung.com>

Best regard,
Donghwa Lee

On Thu, Mar 28, 2013 at 06:19, Andrei Epure wrote:
> list_for_each_entry_safe() does not require safety check.
> Patch found using coccinelle.
>
> Signed-off-by: Andrei Epure<epure.andrei@gmail.com>
> ---
>   drivers/video/exynos/exynos_mipi_dsi.c |   16 ++++++----------
>   1 file changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c
> index dd5e5e9..fe84f08 100644
> --- a/drivers/video/exynos/exynos_mipi_dsi.c
> +++ b/drivers/video/exynos/exynos_mipi_dsi.c
> @@ -214,8 +214,6 @@ static struct mipi_dsim_ddi *exynos_mipi_dsi_find_lcd_device(
>   	mutex_lock(&mipi_dsim_lock);
>   
>   	list_for_each_entry_safe(dsim_ddi, next, &dsim_ddi_list, list) {
> -		if (!dsim_ddi)
> -			goto out;
>   
>   		lcd_dev = dsim_ddi->dsim_lcd_dev;
>   		if (!lcd_dev)
> @@ -473,17 +471,15 @@ static int exynos_mipi_dsi_remove(struct platform_device *pdev)
>   	clk_disable(dsim->clock);
>   
>   	list_for_each_entry_safe(dsim_ddi, next, &dsim_ddi_list, list) {
> -		if (dsim_ddi) {
> -			if (dsim->id != dsim_ddi->bus_id)
> -				continue;
> +		if (dsim->id != dsim_ddi->bus_id)
> +			continue;
>   
> -			dsim_lcd_drv = dsim_ddi->dsim_lcd_drv;
> +		dsim_lcd_drv = dsim_ddi->dsim_lcd_drv;
>   
> -			if (dsim_lcd_drv->remove)
> -				dsim_lcd_drv->remove(dsim_ddi->dsim_lcd_dev);
> +		if (dsim_lcd_drv->remove)
> +			dsim_lcd_drv->remove(dsim_ddi->dsim_lcd_dev);
>   
> -			kfree(dsim_ddi);
> -		}
> +		kfree(dsim_ddi);
>   	}
>   
>   	return 0;


      reply	other threads:[~2013-03-28  0:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-27 21:19 [PATCH] video: exynos: remove useless safety check in list traversal Andrei Epure
2013-03-28  0:04 ` Donghwa Lee [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=515388F0.3060604@samsung.com \
    --to=dh09.lee@samsung.com \
    --cc=FlorianSchandinat@gmx.de \
    --cc=epure.andrei@gmail.com \
    --cc=inki.dae@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox