From patchwork Sat Aug 20 00:48:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 9291487 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 994F2607FF for ; Sat, 20 Aug 2016 00:48:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 847EF2960A for ; Sat, 20 Aug 2016 00:48:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 794E12960E; Sat, 20 Aug 2016 00:48:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22F852960B for ; Sat, 20 Aug 2016 00:48:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754617AbcHTAsa (ORCPT ); Fri, 19 Aug 2016 20:48:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40826 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755888AbcHTAsV (ORCPT ); Fri, 19 Aug 2016 20:48:21 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E60A81240; Sat, 20 Aug 2016 00:48:21 +0000 (UTC) Received: from fidelio.ahs3.com (ovpn-116-175.phx2.redhat.com [10.3.116.175]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7K0mGwH014247; Fri, 19 Aug 2016 20:48:20 -0400 From: Al Stone To: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ahs3@redhat.com, "Rafael J . Wysocki" , Len Brown 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 Message-Id: <1471654093-6962-4-git-send-email-ahs3@redhat.com> In-Reply-To: <1471654093-6962-1-git-send-email-ahs3@redhat.com> References: <1471654093-6962-1-git-send-email-ahs3@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sat, 20 Aug 2016 00:48:21 +0000 (UTC) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Rafael J. Wysocki Cc: Len Brown --- 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;