diff mbox

[2/5] acpi/numa: check if parsing acpi numa info disabled earlier

Message ID 1359967426-32629-3-git-send-email-lig.fnst@cn.fujitsu.com (mailing list archive)
State Changes Requested, archived
Headers show

Commit Message

li guang Feb. 4, 2013, 8:43 a.m. UTC
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
---
 arch/x86/mm/srat.c  |    6 ------
 drivers/acpi/numa.c |    2 ++
 2 files changed, 2 insertions(+), 6 deletions(-)

Comments

David Rientjes Feb. 4, 2013, 7:41 p.m. UTC | #1
On Mon, 4 Feb 2013, liguang wrote:

> Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>

Because there's no changelog, I have to read the patch to figure out what 
it's doing since the title isn't that helpful either.  Please provide a 
description of what problem you're trying to fix or what improvement 
you're trying to make so it's clear.

> ---
>  arch/x86/mm/srat.c  |    6 ------
>  drivers/acpi/numa.c |    2 ++
>  2 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c
> index a837c95..78c67bd 100644
> --- a/arch/x86/mm/srat.c
> +++ b/arch/x86/mm/srat.c
> @@ -60,8 +60,6 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
>  	int pxm, node;
>  	int apic_id;
>  
> -	if (srat_disabled())
> -		return;
>  	if (pa->header.length < sizeof(struct acpi_srat_x2apic_cpu_affinity)) {
>  		bad_srat();
>  		return;
> @@ -100,8 +98,6 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
>  	int pxm, node;
>  	int apic_id;
>  
> -	if (srat_disabled())
> -		return;
>  	if (pa->header.length != sizeof(struct acpi_srat_cpu_affinity)) {
>  		bad_srat();
>  		return;
> @@ -148,8 +144,6 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
>  	u64 start, end;
>  	int node, pxm;
>  
> -	if (srat_disabled())
> -		return -1;
>  	if (ma->header.length != sizeof(struct acpi_srat_mem_affinity)) {
>  		bad_srat();
>  		return -1;
> diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
> index cb31298..1f51222 100644
> --- a/drivers/acpi/numa.c
> +++ b/drivers/acpi/numa.c
> @@ -262,6 +262,8 @@ static int __init acpi_parse_srat(struct acpi_table_header *table)
>  	struct acpi_table_srat *srat;
>  	if (!table)
>  		return -EINVAL;
> +	if (srat_disabled())
> +		return -EACCES;
>  
>  	srat = (struct acpi_table_srat *)table;
>  	acpi_srat_revision = srat->header.revision;

Nack, this isn't helpful since SRAT is only for x86 and other 
architectures use this code.  It would break the build on ia64 since it's 
obviously not going to have a function called srat_disabled().

And -EACCES would not be the appropriate return value, this has nothing to 
do with permissions.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
li guang Feb. 5, 2013, 1:12 a.m. UTC | #2
? 2013-02-04?? 11:41 -0800?David Rientjes???
> On Mon, 4 Feb 2013, liguang wrote:
> 
> > Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> 
> Because there's no changelog, I have to read the patch to figure out what 
> it's doing since the title isn't that helpful either.  Please provide a 
> description of what problem you're trying to fix or what improvement 
> you're trying to make so it's clear.
> 
> > ---
> >  arch/x86/mm/srat.c  |    6 ------
> >  drivers/acpi/numa.c |    2 ++
> >  2 files changed, 2 insertions(+), 6 deletions(-)
> > 
> > diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c
> > index a837c95..78c67bd 100644
> > --- a/arch/x86/mm/srat.c
> > +++ b/arch/x86/mm/srat.c
> > @@ -60,8 +60,6 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
> >  	int pxm, node;
> >  	int apic_id;
> >  
> > -	if (srat_disabled())
> > -		return;
> >  	if (pa->header.length < sizeof(struct acpi_srat_x2apic_cpu_affinity)) {
> >  		bad_srat();
> >  		return;
> > @@ -100,8 +98,6 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
> >  	int pxm, node;
> >  	int apic_id;
> >  
> > -	if (srat_disabled())
> > -		return;
> >  	if (pa->header.length != sizeof(struct acpi_srat_cpu_affinity)) {
> >  		bad_srat();
> >  		return;
> > @@ -148,8 +144,6 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
> >  	u64 start, end;
> >  	int node, pxm;
> >  
> > -	if (srat_disabled())
> > -		return -1;
> >  	if (ma->header.length != sizeof(struct acpi_srat_mem_affinity)) {
> >  		bad_srat();
> >  		return -1;
> > diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
> > index cb31298..1f51222 100644
> > --- a/drivers/acpi/numa.c
> > +++ b/drivers/acpi/numa.c
> > @@ -262,6 +262,8 @@ static int __init acpi_parse_srat(struct acpi_table_header *table)
> >  	struct acpi_table_srat *srat;
> >  	if (!table)
> >  		return -EINVAL;
> > +	if (srat_disabled())
> > +		return -EACCES;
> >  
> >  	srat = (struct acpi_table_srat *)table;
> >  	acpi_srat_revision = srat->header.revision;
> 
> Nack, this isn't helpful since SRAT is only for x86 and other 
> architectures use this code.  It would break the build on ia64 since it's 
> obviously not going to have a function called srat_disabled().
> 
> And -EACCES would not be the appropriate return value, this has nothing to 
> do with permissions.

Yes, you're right, will drop this change.



--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c
index a837c95..78c67bd 100644
--- a/arch/x86/mm/srat.c
+++ b/arch/x86/mm/srat.c
@@ -60,8 +60,6 @@  acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
 	int pxm, node;
 	int apic_id;
 
-	if (srat_disabled())
-		return;
 	if (pa->header.length < sizeof(struct acpi_srat_x2apic_cpu_affinity)) {
 		bad_srat();
 		return;
@@ -100,8 +98,6 @@  acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
 	int pxm, node;
 	int apic_id;
 
-	if (srat_disabled())
-		return;
 	if (pa->header.length != sizeof(struct acpi_srat_cpu_affinity)) {
 		bad_srat();
 		return;
@@ -148,8 +144,6 @@  acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
 	u64 start, end;
 	int node, pxm;
 
-	if (srat_disabled())
-		return -1;
 	if (ma->header.length != sizeof(struct acpi_srat_mem_affinity)) {
 		bad_srat();
 		return -1;
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index cb31298..1f51222 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -262,6 +262,8 @@  static int __init acpi_parse_srat(struct acpi_table_header *table)
 	struct acpi_table_srat *srat;
 	if (!table)
 		return -EINVAL;
+	if (srat_disabled())
+		return -EACCES;
 
 	srat = (struct acpi_table_srat *)table;
 	acpi_srat_revision = srat->header.revision;