Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: kexec@lists.infradead.org
Cc: David Hildenbrand <david@redhat.com>, Simon Horman <horms@verge.net.au>
Subject: [PATCH v1 2/3] crashdump/x86: iterate only over actual crash memory ranges
Date: Tue, 23 Mar 2021 11:01:09 +0100	[thread overview]
Message-ID: <20210323100111.8365-3-david@redhat.com> (raw)
In-Reply-To: <20210323100111.8365-1-david@redhat.com>

No need to iterate over empty entries.

Cc: Simon Horman <horms@verge.net.au>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 kexec/arch/i386/crashdump-x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index a301ac8..43e830a 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -988,7 +988,7 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
 	cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr);
 
 	/* Inform second kernel about the presence of ACPI tables. */
-	for (i = 0; i < CRASH_MAX_MEMORY_RANGES; i++) {
+	for (i = 0; i < nr_ranges; i++) {
 		unsigned long start, end, size, type;
 		if ( !( mem_range[i].type == RANGE_ACPI
 			|| mem_range[i].type == RANGE_ACPI_NVS
-- 
2.29.2


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

  parent reply	other threads:[~2021-03-23 10:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 10:01 [PATCH v1 0/3] crashdump/x86: dump dax/kmem and virito-mem added System RAM David Hildenbrand
2021-03-23 10:01 ` [PATCH v1 1/3] crashdump/x86: dump any kind of "System RAM" David Hildenbrand
2021-03-31 15:47   ` Dave Hansen
2021-03-23 10:01 ` David Hildenbrand [this message]
2021-03-23 10:01 ` [PATCH v1 3/3] crashdump/x86: increase CRASH_MAX_MEMORY_RANGES to 32k David Hildenbrand
2021-03-30  8:58 ` [PATCH v1 0/3] crashdump/x86: dump dax/kmem and virito-mem added System RAM David Hildenbrand
2021-04-02 10:06   ` Simon Horman
2021-04-02 11:06     ` David Hildenbrand

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=20210323100111.8365-3-david@redhat.com \
    --to=david@redhat.com \
    --cc=horms@verge.net.au \
    --cc=kexec@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox