Linux-ACPI Archive on lore.kernel.org
 help / color / Atom feed
From: Hanjun Guo <guohanjun@huawei.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: <linux-acpi@vger.kernel.org>, <linuxarm@huawei.com>,
	Hanjun Guo <guohanjun@huawei.com>
Subject: [PATCH 2/3] ACPI: NUMA: Remove the useless sub table pointer check
Date: Tue, 21 Jul 2020 17:59:05 +0800
Message-ID: <1595325546-63774-3-git-send-email-guohanjun@huawei.com> (raw)
In-Reply-To: <1595325546-63774-1-git-send-email-guohanjun@huawei.com>

In acpi_parse_entries_array(), the subtable entries (entry.hdr)
will never be NULL, so for ACPI subtable handler in struct
acpi_subtable_proc, will never handle NULL subtable entries,
remove those useless subtable pointer checks in those callback
handlers.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
 drivers/acpi/numa/srat.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
index 5be5a97..3d430b0 100644
--- a/drivers/acpi/numa/srat.c
+++ b/drivers/acpi/numa/srat.c
@@ -291,8 +291,6 @@ static int __init acpi_parse_slit(struct acpi_table_header *table)
 	struct acpi_srat_x2apic_cpu_affinity *processor_affinity;
 
 	processor_affinity = (struct acpi_srat_x2apic_cpu_affinity *)header;
-	if (!processor_affinity)
-		return -EINVAL;
 
 	acpi_table_print_srat_entry(&header->common);
 
@@ -309,8 +307,6 @@ static int __init acpi_parse_slit(struct acpi_table_header *table)
 	struct acpi_srat_cpu_affinity *processor_affinity;
 
 	processor_affinity = (struct acpi_srat_cpu_affinity *)header;
-	if (!processor_affinity)
-		return -EINVAL;
 
 	acpi_table_print_srat_entry(&header->common);
 
@@ -327,8 +323,6 @@ static int __init acpi_parse_slit(struct acpi_table_header *table)
 	struct acpi_srat_gicc_affinity *processor_affinity;
 
 	processor_affinity = (struct acpi_srat_gicc_affinity *)header;
-	if (!processor_affinity)
-		return -EINVAL;
 
 	acpi_table_print_srat_entry(&header->common);
 
@@ -347,8 +341,6 @@ static int __init acpi_parse_slit(struct acpi_table_header *table)
 	struct acpi_srat_mem_affinity *memory_affinity;
 
 	memory_affinity = (struct acpi_srat_mem_affinity *)header;
-	if (!memory_affinity)
-		return -EINVAL;
 
 	acpi_table_print_srat_entry(&header->common);
 
-- 
1.7.12.4


  parent reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21  9:59 [PATCH 0/3] Minor cleanups Hanjun Guo
2020-07-21  9:59 ` [PATCH 1/3] ACPI: tables: Remove the duplicated checks for acpi_parse_entries_array() Hanjun Guo
2020-07-21  9:59 ` Hanjun Guo [this message]
2020-07-21  9:59 ` [PATCH 3/3] ACPI: NUMA: Remove the useless 'node >= MAX_NUMNODES' check Hanjun Guo
2020-07-27 13:20 ` [PATCH 0/3] Minor cleanups 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=1595325546-63774-3-git-send-email-guohanjun@huawei.com \
    --to=guohanjun@huawei.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --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

Linux-ACPI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-acpi/0 linux-acpi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-acpi linux-acpi/ https://lore.kernel.org/linux-acpi \
		linux-acpi@vger.kernel.org
	public-inbox-index linux-acpi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-acpi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git