mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] memtest: fix list iteration in region setup
Date: Wed, 20 Sep 2017 08:23:22 +0200	[thread overview]
Message-ID: <20170920062322.d2wsbg5saesspn72@pengutronix.de> (raw)
In-Reply-To: <20170918122628.11477-1-s.trumtrar@pengutronix.de>

On Mon, Sep 18, 2017 at 02:26:28PM +0200, Steffen Trumtrar wrote:
> When memory regions start at 0, the current mem_test_request_regions function
> wrongly assumes that struct resource *r points at the correct region. It points
> to the first region however (which starts at 0).
> 
> The comment states, that the code starts from the second entry.
> In include/linux/list.h the macro documentation however says:
> 
>  list_for_each_entry_from - iterate over list of given type from the current point
> 
> The correct list iteration macro to use here is list_for_each_entry_continue,
> where the documentation says:
> 
>  Continue to iterate over list of given type, continuing after
>  the current position.
> 
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>

Applied, thanks

Sascha

> ---
>  common/memtest.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/memtest.c b/common/memtest.c
> index 8af998e883e1..0fc20467580e 100644
> --- a/common/memtest.c
> +++ b/common/memtest.c
> @@ -90,7 +90,7 @@ int mem_test_request_regions(struct list_head *list)
>  		 *
>  		 * Between used regions. Start from second entry.
>  		 */
> -		list_for_each_entry_from(r, &bank->res->children, sibling) {
> +		list_for_each_entry_continue(r, &bank->res->children, sibling) {
>  			start = PAGE_ALIGN(r_prev->end + 1);
>  			end = r->start - 1;
>  			r_prev = r;
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2017-09-20  6:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 12:26 Steffen Trumtrar
2017-09-20  6:23 ` Sascha Hauer [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=20170920062322.d2wsbg5saesspn72@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.trumtrar@pengutronix.de \
    /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