From: Al Stone <ahs3@redhat.com>
To: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: ahs3@redhat.com, "Rafael J . Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>
Subject: [PATCH v2 3/3] ACPI: do not report the number of entries ignored by acpi_parse_entries()
Date: Fri, 19 Aug 2016 18:48:13 -0600 [thread overview]
Message-ID: <1471654093-6962-4-git-send-email-ahs3@redhat.com> (raw)
In-Reply-To: <1471654093-6962-1-git-send-email-ahs3@redhat.com>
The function acpi_parse_entries_array() has a limiting parameter,
max_entries, which tells the function to stop looking at subtables
once that limit has been reached. If the limit is reached, it is
reported. However, the logic is incorrect in that the loop to
examine all subtables will always report that zero subtables have
been ignored since it does not continue once the max_entries have
been reached.
One approach to fixing this would be to correct the logic so that
all subtables are examined, even if we have hit the max_entries, but
without executing all the callback functions. This could be risky
since we cannot guarantee that no callback will ever have side effects
that another callback depends on to work correctly.
So, the simplest approach is to just remove the part of the error
message that will always be incorrect.
Signed-off-by: Al Stone <ahs3@redhat.com>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>
---
drivers/acpi/tables.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 0d5d17f..984260d 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -304,8 +304,8 @@ acpi_parse_entries_array(char *id, unsigned long table_size,
}
if (max_entries && count > max_entries) {
- pr_warn("[%4.4s:0x%02x] ignored %i entries of %i found\n",
- id, proc->id, count - max_entries, count);
+ pr_warn("[%4.4s:0x%02x] found the maximum %i entries\n",
+ id, proc->id, count);
}
return (errs_found) ? -EINVAL : count;
--
2.7.4
next prev parent reply other threads:[~2016-08-20 0:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-20 0:48 [PATCH v2 0/3] Correct errors in acpi_parse_entries_array() Al Stone
2016-08-20 0:48 ` [PATCH v2 1/3] ACPI: fix incorrect counts returned by acpi_parse_entries_array() Al Stone
2016-08-20 0:48 ` [PATCH v2 2/3] ACPI: fix acpi_parse_entries_array() so it traverses all subtables Al Stone
2016-08-20 0:48 ` Al Stone [this message]
2016-09-12 22:10 ` [PATCH v2 0/3] Correct errors in acpi_parse_entries_array() Rafael J. Wysocki
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=1471654093-6962-4-git-send-email-ahs3@redhat.com \
--to=ahs3@redhat.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/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).