mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: Nishka Dasgupta <nishkadg.linux@gmail.com>, <tony@atomide.com>,
	<linux-kernel@vger.kernel.org>, "Kristo, Tero" <t-kristo@ti.com>
Subject: Re: [PATCH] bus: ti-sysc: Remove if-block in sysc_check_children()
Date: Thu, 8 Aug 2019 16:55:12 +0300	[thread overview]
Message-ID: <2038cdcd-1506-84c6-520d-6dda50d4f317@ti.com> (raw)
In-Reply-To: <20190808074042.15403-1-nishkadg.linux@gmail.com>

Nishka,

On 08/08/2019 10:40, Nishka Dasgupta wrote:
> In function sysc_check_children, there is an if-statement checking
> whether the value returned by function sysc_check_one_child is non-zero.
> However, sysc_check_one_child always returns 0, and hence this check is
> not needed. Hence remove this if-block.
> 
> Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
> ---
>  drivers/bus/ti-sysc.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
> index e6deabd8305d..bc8082ae7cb5 100644
> --- a/drivers/bus/ti-sysc.c
> +++ b/drivers/bus/ti-sysc.c
> @@ -637,8 +637,6 @@ static int sysc_check_children(struct sysc *ddata)
>  
>  	for_each_child_of_node(ddata->dev->of_node, child) {
>  		error = sysc_check_one_child(ddata, child);
> -		if (error)
> -			return error;

We cannot assume that sysc_check_one_child() will never return error in the future.
If it can never return an error then why does it have an int return type?

>  	}
>  
>  	return 0;
> 

cheers,
-roger
-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

  reply	other threads:[~2019-08-08 13:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08  7:40 Nishka Dasgupta
2019-08-08 13:55 ` Roger Quadros [this message]
2019-08-13  4:35   ` Nishka Dasgupta
2019-08-13  6:25     ` Roger Quadros
2019-08-13  6:28       ` Tony Lindgren
2019-08-13  7:12       ` Nishka Dasgupta

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=2038cdcd-1506-84c6-520d-6dda50d4f317@ti.com \
    --to=rogerq@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nishkadg.linux@gmail.com \
    --cc=t-kristo@ti.com \
    --cc=tony@atomide.com \
    /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

all inboxes | Powered by JetHome®