devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Pavel Fedin <p.fedin@samsung.com>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: k.kozlowski.k@gmail.com, 'Rob Herring' <robh+dt@kernel.org>,
	'Pawel Moll' <pawel.moll@arm.com>,
	'Mark Rutland' <mark.rutland@arm.com>,
	'Ian Campbell' <ijc+devicetree@hellion.org.uk>,
	'Kumar Gala' <galak@codeaurora.org>,
	'Kukjin Kim' <kgene@kernel.org>
Subject: Re: [PATCH v5 3/4] drivers: exynos-srom: Add support for bank configuration
Date: Thu, 5 Nov 2015 20:09:29 +0900	[thread overview]
Message-ID: <563B38E9.7070600@samsung.com> (raw)
In-Reply-To: <004001d117b6$62baa1a0$282fe4e0$@samsung.com>

W dniu 05.11.2015 o 19:40, Pavel Fedin pisze:
>  Hello!
> 
>>> +static int decode_sromc(struct exynos_srom *srom, struct device_node *np)
>>
>> I missed that one previously: add prefix and more descriptive name, like:
>> exynos_srom_parse_child()
> 
>  exynos_srom_configure_bank(), is this name OK?

Yes, its OK.

> 
>>>  static int exynos_srom_probe(struct platform_device *pdev)
>>>  {
>>> -	struct device_node *np;
>>> +	struct device_node *np, *child;
>>>  	struct exynos_srom *srom;
>>>  	struct device *dev = &pdev->dev;
>>> +	bool error = false;
>>
>> The 'error' name is misleading - like error for entire probe which is
>> not true.
>>
>> Instead split it to separate function like:
>>
>> +static int exynos_srom_parse_children(....) {
>> +       int ret = 0;
>> +
>> +	for_each_child_of_node(np, child) {
>> +               ret = exynos_srom_parse_child(srom, child);
>> +		if (ret) {
>> +			dev_err(dev,
>> +				"Could not decode bank configuration for %s: %d\n",
>> +				child->name, ret);
>> +			break;
>> +		}
>> +	}
>> +
>> +       return ret;
>> +}
> 
>  Factoring out this loop is unnecessary, because i could just 'return 0' in the loop
> instead of 'error = true'. Byt my idea is to go through all banks anyway, just in
> case, to diagnose all of them. So that the user will be able to spot and fix all
> broken banks at once, instead of doing one-by-one.
>  I have renamed the variable to 'bool bad_bank_config', will this be OK?

Yes, that's also OK.

Best regards,
Krzysztof

  reply	other threads:[~2015-11-05 11:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03  9:16 [PATCH v5 0/4] Exynos SROMc configuration and Ethernet support for SMDK5410 Pavel Fedin
2015-11-03  9:16 ` [PATCH v5 1/4] Documentation: dt-bindings: Describe SROMc configuration Pavel Fedin
2015-11-04  8:09   ` Krzysztof Kozlowski
2015-11-03  9:16 ` [PATCH v5 2/4] ARM: dts: Add SROMc to Exynos 5410 Pavel Fedin
2015-11-04  8:12   ` Krzysztof Kozlowski
2015-11-03  9:16 ` [PATCH v5 3/4] drivers: exynos-srom: Add support for bank configuration Pavel Fedin
2015-11-04  8:20   ` Krzysztof Kozlowski
2015-11-05 10:40     ` Pavel Fedin
2015-11-05 11:09       ` Krzysztof Kozlowski [this message]
2015-11-03  9:16 ` [PATCH v5 4/4] ARM: dts: Add Ethernet chip to SMDK5410 Pavel Fedin
2015-11-04  8:28   ` Krzysztof Kozlowski
     [not found]     ` <5639C1A5.1040708-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-11-05 11:14       ` Pavel Fedin
2015-11-05 11:27         ` Krzysztof Kozlowski
2015-11-05 11:36           ` Pavel Fedin
2015-11-04  7:36 ` [PATCH v5 0/4] Exynos SROMc configuration and Ethernet support for SMDK5410 Krzysztof Kozlowski
2015-11-05  7:59   ` Pavel Fedin
2015-11-05  8:07     ` Krzysztof Kozlowski
2015-11-05  8:44       ` Pavel Fedin
2015-11-05  8:51         ` Krzysztof Kozlowski
2015-11-05  9:00           ` Pavel Fedin

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=563B38E9.7070600@samsung.com \
    --to=k.kozlowski@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=k.kozlowski.k@gmail.com \
    --cc=kgene@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=p.fedin@samsung.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).