All of lore.kernel.org
 help / color / mirror / Atom feed
From: tthayer@opensource.altera.com (Thor Thayer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 05/10] EDAC, altera: Add Arria10 NAND EDAC support
Date: Wed, 27 Jul 2016 13:43:04 -0500	[thread overview]
Message-ID: <579900B8.3020502@opensource.altera.com> (raw)
In-Reply-To: <20160727171035.GA23851@nazgul.tnic>



On 07/27/2016 12:10 PM, Borislav Petkov wrote:
> On Thu, Jul 14, 2016 at 11:06:43AM -0500, tthayer at opensource.altera.com wrote:
>> From: Thor Thayer <tthayer@opensource.altera.com>
>>
>> Add Altera Arria10 NAND FIFO memory EDAC support.
>>
>> Signed-off-by: Thor Thayer <tthayer@opensource.altera.com>
>> ---
>>   drivers/edac/Kconfig       |    7 +++++++
>>   drivers/edac/altera_edac.c |   34 +++++++++++++++++++++++++++++++++-
>>   2 files changed, 40 insertions(+), 1 deletion(-)
>
> ...
>
>> @@ -1589,7 +1619,9 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
>>   		else if ((of_device_is_compatible(child,
>>   					"altr,socfpga-a10-ocram-ecc")) ||
>>   			 (of_device_is_compatible(child,
>> -					"altr,socfpga-eth-mac-ecc")))
>> +					"altr,socfpga-eth-mac-ecc")) ||
>> +			 (of_device_is_compatible(child,
>> +						  "altr,socfpga-nand-ecc")))
>>   			altr_edac_a10_device_add(edac, child);
>>   		else if (of_device_is_compatible(child,
>>   						 "altr,sdram-edac-a10"))
>
> Can we simplify this loop like this?
>
> 	for_each_child_of_node(pdev->dev.of_node, child) {
> 		if (!of_device_is_available(child))
> 			continue;
>
> 		if (of_device_is_compatible(child, "altr,socfpga-a10-l2-ecc") ||
> 		    of_device_is_compatible(child, "altr,socfpga-a10-ocram-ecc") ||
> 		    of_device_is_compatible(child, "altr,socfpga-eth-mac-ecc") ||
> 		    of_device_is_compatible(child, "altr,socfpga-nand-ecc"))
>
> 			altr_edac_a10_device_add(edac, child);
>
> 		else if (of_device_is_compatible(child, "altr,sdram-edac-a10"))
> 			of_platform_populate(pdev->dev.of_node,
> 					     altr_sdram_ctrl_of_match,
> 					     NULL, &pdev->dev);
> 	}
>
> I've merged the first "if" and subsequent "else if" because they all
> do altr_edac_a10_device_add(edac, child) and added spacing for better
> readability.
>
> Look ok?
>
> Or have I fatfingered it?
>

Yes, that's better. I was trying to stay within the 80 character limit 
but missed the if/else if improvement. Thanks, Boris!

Should I re-submit?

Thanks,

Thor

WARNING: multiple messages have this Message-ID (diff)
From: Thor Thayer <tthayer@opensource.altera.com>
To: Borislav Petkov <bp@alien8.de>
Cc: dougthompson@xmission.com, m.chehab@samsung.com,
	robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	linux@arm.linux.org.uk, dinguyen@opensource.altera.com,
	grant.likely@linaro.org, devicetree@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-edac@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, tthayer.linux@gmail.com
Subject: Re: [PATCH 05/10] EDAC, altera: Add Arria10 NAND EDAC support
Date: Wed, 27 Jul 2016 13:43:04 -0500	[thread overview]
Message-ID: <579900B8.3020502@opensource.altera.com> (raw)
In-Reply-To: <20160727171035.GA23851@nazgul.tnic>



On 07/27/2016 12:10 PM, Borislav Petkov wrote:
> On Thu, Jul 14, 2016 at 11:06:43AM -0500, tthayer@opensource.altera.com wrote:
>> From: Thor Thayer <tthayer@opensource.altera.com>
>>
>> Add Altera Arria10 NAND FIFO memory EDAC support.
>>
>> Signed-off-by: Thor Thayer <tthayer@opensource.altera.com>
>> ---
>>   drivers/edac/Kconfig       |    7 +++++++
>>   drivers/edac/altera_edac.c |   34 +++++++++++++++++++++++++++++++++-
>>   2 files changed, 40 insertions(+), 1 deletion(-)
>
> ...
>
>> @@ -1589,7 +1619,9 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
>>   		else if ((of_device_is_compatible(child,
>>   					"altr,socfpga-a10-ocram-ecc")) ||
>>   			 (of_device_is_compatible(child,
>> -					"altr,socfpga-eth-mac-ecc")))
>> +					"altr,socfpga-eth-mac-ecc")) ||
>> +			 (of_device_is_compatible(child,
>> +						  "altr,socfpga-nand-ecc")))
>>   			altr_edac_a10_device_add(edac, child);
>>   		else if (of_device_is_compatible(child,
>>   						 "altr,sdram-edac-a10"))
>
> Can we simplify this loop like this?
>
> 	for_each_child_of_node(pdev->dev.of_node, child) {
> 		if (!of_device_is_available(child))
> 			continue;
>
> 		if (of_device_is_compatible(child, "altr,socfpga-a10-l2-ecc") ||
> 		    of_device_is_compatible(child, "altr,socfpga-a10-ocram-ecc") ||
> 		    of_device_is_compatible(child, "altr,socfpga-eth-mac-ecc") ||
> 		    of_device_is_compatible(child, "altr,socfpga-nand-ecc"))
>
> 			altr_edac_a10_device_add(edac, child);
>
> 		else if (of_device_is_compatible(child, "altr,sdram-edac-a10"))
> 			of_platform_populate(pdev->dev.of_node,
> 					     altr_sdram_ctrl_of_match,
> 					     NULL, &pdev->dev);
> 	}
>
> I've merged the first "if" and subsequent "else if" because they all
> do altr_edac_a10_device_add(edac, child) and added spacing for better
> readability.
>
> Look ok?
>
> Or have I fatfingered it?
>

Yes, that's better. I was trying to stay within the 80 character limit 
but missed the if/else if improvement. Thanks, Boris!

Should I re-submit?

Thanks,

Thor

WARNING: multiple messages have this Message-ID (diff)
From: Thor Thayer <tthayer@opensource.altera.com>
To: Borislav Petkov <bp@alien8.de>
Cc: <dougthompson@xmission.com>, <m.chehab@samsung.com>,
	<robh+dt@kernel.org>, <pawel.moll@arm.com>,
	<mark.rutland@arm.com>, <ijc+devicetree@hellion.org.uk>,
	<galak@codeaurora.org>, <linux@arm.linux.org.uk>,
	<dinguyen@opensource.altera.com>, <grant.likely@linaro.org>,
	<devicetree@vger.kernel.org>, <linux-doc@vger.kernel.org>,
	<linux-edac@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <tthayer.linux@gmail.com>
Subject: Re: [PATCH 05/10] EDAC, altera: Add Arria10 NAND EDAC support
Date: Wed, 27 Jul 2016 13:43:04 -0500	[thread overview]
Message-ID: <579900B8.3020502@opensource.altera.com> (raw)
In-Reply-To: <20160727171035.GA23851@nazgul.tnic>



On 07/27/2016 12:10 PM, Borislav Petkov wrote:
> On Thu, Jul 14, 2016 at 11:06:43AM -0500, tthayer@opensource.altera.com wrote:
>> From: Thor Thayer <tthayer@opensource.altera.com>
>>
>> Add Altera Arria10 NAND FIFO memory EDAC support.
>>
>> Signed-off-by: Thor Thayer <tthayer@opensource.altera.com>
>> ---
>>   drivers/edac/Kconfig       |    7 +++++++
>>   drivers/edac/altera_edac.c |   34 +++++++++++++++++++++++++++++++++-
>>   2 files changed, 40 insertions(+), 1 deletion(-)
>
> ...
>
>> @@ -1589,7 +1619,9 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
>>   		else if ((of_device_is_compatible(child,
>>   					"altr,socfpga-a10-ocram-ecc")) ||
>>   			 (of_device_is_compatible(child,
>> -					"altr,socfpga-eth-mac-ecc")))
>> +					"altr,socfpga-eth-mac-ecc")) ||
>> +			 (of_device_is_compatible(child,
>> +						  "altr,socfpga-nand-ecc")))
>>   			altr_edac_a10_device_add(edac, child);
>>   		else if (of_device_is_compatible(child,
>>   						 "altr,sdram-edac-a10"))
>
> Can we simplify this loop like this?
>
> 	for_each_child_of_node(pdev->dev.of_node, child) {
> 		if (!of_device_is_available(child))
> 			continue;
>
> 		if (of_device_is_compatible(child, "altr,socfpga-a10-l2-ecc") ||
> 		    of_device_is_compatible(child, "altr,socfpga-a10-ocram-ecc") ||
> 		    of_device_is_compatible(child, "altr,socfpga-eth-mac-ecc") ||
> 		    of_device_is_compatible(child, "altr,socfpga-nand-ecc"))
>
> 			altr_edac_a10_device_add(edac, child);
>
> 		else if (of_device_is_compatible(child, "altr,sdram-edac-a10"))
> 			of_platform_populate(pdev->dev.of_node,
> 					     altr_sdram_ctrl_of_match,
> 					     NULL, &pdev->dev);
> 	}
>
> I've merged the first "if" and subsequent "else if" because they all
> do altr_edac_a10_device_add(edac, child) and added spacing for better
> readability.
>
> Look ok?
>
> Or have I fatfingered it?
>

Yes, that's better. I was trying to stay within the 80 character limit 
but missed the if/else if improvement. Thanks, Boris!

Should I re-submit?

Thanks,

Thor

  reply	other threads:[~2016-07-27 18:43 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14 16:06 [PATCH 00/10] Add NAND, DMA, USB, and QSPI EDAC tthayer at opensource.altera.com
2016-07-14 16:06 ` tthayer
2016-07-14 16:06 ` tthayer
2016-07-14 16:06 ` [PATCH 01/10] Documentation: dt: socfpga: Add Arria10 NAND EDAC binding tthayer at opensource.altera.com
2016-07-14 16:06   ` tthayer
2016-07-14 16:06   ` tthayer
2016-07-16 23:05   ` Rob Herring
2016-07-16 23:05     ` Rob Herring
2016-07-14 16:06 ` [PATCH 02/10] Documentation: dt: socfpga: Add Arria10 DMA " tthayer at opensource.altera.com
2016-07-14 16:06   ` tthayer
2016-07-14 16:06   ` tthayer
2016-07-16 23:06   ` Rob Herring
2016-07-16 23:06     ` Rob Herring
2016-07-14 16:06 ` [PATCH 03/10] Documentation: dt: socfpga: Add Arria10 USB " tthayer at opensource.altera.com
2016-07-14 16:06   ` tthayer
2016-07-14 16:06   ` tthayer
2016-07-16 23:07   ` Rob Herring
2016-07-16 23:07     ` Rob Herring
2016-07-14 16:06 ` [PATCH 04/10] Documentation: dt: socfpga: Add Arria10 QSPI " tthayer at opensource.altera.com
2016-07-14 16:06   ` tthayer
2016-07-14 16:06   ` tthayer
2016-07-16 23:07   ` Rob Herring
2016-07-16 23:07     ` Rob Herring
2016-07-14 16:06 ` [PATCH 05/10] EDAC, altera: Add Arria10 NAND EDAC support tthayer at opensource.altera.com
2016-07-14 16:06   ` tthayer
2016-07-14 16:06   ` tthayer
2016-07-27 17:10   ` Borislav Petkov
2016-07-27 17:10     ` Borislav Petkov
2016-07-27 18:43     ` Thor Thayer [this message]
2016-07-27 18:43       ` Thor Thayer
2016-07-27 18:43       ` Thor Thayer
2016-07-27 20:17       ` Borislav Petkov
2016-07-27 20:17         ` Borislav Petkov
2016-07-14 16:06 ` [PATCH 06/10] EDAC, altera: Add Arria10 DMA " tthayer at opensource.altera.com
2016-07-14 16:06   ` tthayer
2016-07-14 16:06   ` tthayer
2016-07-14 16:06 ` [PATCH 07/10] EDAC, altera: Add Arria10 USB " tthayer at opensource.altera.com
2016-07-14 16:06   ` tthayer
2016-07-14 16:06   ` tthayer
2016-07-14 16:06 ` [PATCH 08/10] EDAC, altera: Add Arria10 QSPI " tthayer at opensource.altera.com
2016-07-14 16:06   ` tthayer
2016-07-14 16:06   ` tthayer
2016-07-14 16:06 ` [PATCH 09/10] ARM: dts: Add Arria10 DMA EDAC devicetree entry tthayer at opensource.altera.com
2016-07-14 16:06   ` tthayer
2016-07-14 16:06   ` tthayer
2016-07-20 16:05   ` Dinh Nguyen
2016-07-20 16:05     ` Dinh Nguyen
2016-07-20 16:05     ` Dinh Nguyen
2016-07-14 16:06 ` [PATCH 10/10] ARM: dts: Add Arria10 USB " tthayer at opensource.altera.com
2016-07-14 16:06   ` tthayer
2016-07-14 16:06   ` tthayer
2016-07-20 16:05   ` Dinh Nguyen
2016-07-20 16:05     ` Dinh Nguyen
2016-07-20 16:05     ` Dinh Nguyen
2016-07-28 11:47 ` [PATCH 00/10] Add NAND, DMA, USB, and QSPI EDAC Borislav Petkov
2016-07-28 11:47   ` Borislav Petkov

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=579900B8.3020502@opensource.altera.com \
    --to=tthayer@opensource.altera.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.