RE: [PATCH] ACPI/ACPCICA: Remove references to non existing acpi_os_free()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Rafael J. Wysocki [mailto:rjw@xxxxxxx]
> Sent: Sunday, September 08, 2013 5:48 AM
> 
> On Saturday, September 07, 2013 05:06:55 PM Bojan Prtvar wrote:
> > In commit 02438d8771ae6a4b215938959827692026380bf9 acpi_os_free()
> > was deleted and we switched to using kfree() directly instead.
> >
> > Signed-off-by: Bojan Prtvar <prtvar.b@xxxxxxxxx>
> 
> It looks like we have some leftovers. :-)
> 
> Bob, Lv, any objections agains this patch?

The file is used by non OSPM codes, so kfree should not be in it.
As you may know, we need drivers/acpi/acpica files to be compiled as a part of AcpiDump utility which is a user space utility.
I don't think kfree can be linked by a user space program.

The cleaner way might be done by porting missing ACPICA allocate/free implementation codes to the kernel.

Thanks and best regards
-Lv

> 
> Rafael
> 
> 
> > ---
> > This is janitorial work, please review carefully.
> >
> >  drivers/acpi/acpica/acmacros.h |    2 +-
> >  drivers/acpi/acpica/utcache.c  |    2 +-
> >  drivers/acpi/acpica/uttrack.c  |    6 +++---
> >  include/acpi/acpiosxf.h        |    2 --
> >  4 files changed, 5 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
> > index 530a2f8..3670dd9 100644
> > --- a/drivers/acpi/acpica/acmacros.h
> > +++ b/drivers/acpi/acpica/acmacros.h
> > @@ -425,7 +425,7 @@
> >  #define ACPI_ALLOCATE_ZEROED(a)     acpi_ut_allocate_zeroed((acpi_size) (a), ACPI_MEM_PARAMETERS)
> >  #endif
> >  #ifndef ACPI_FREE
> > -#define ACPI_FREE(a)                acpi_os_free(a)
> > +#define ACPI_FREE(a)                kfree(a)
> >  #endif
> >  #define ACPI_MEM_TRACKING(a)
> >
> > diff --git a/drivers/acpi/acpica/utcache.c b/drivers/acpi/acpica/utcache.c
> > index a877a96..fcc570c 100644
> > --- a/drivers/acpi/acpica/utcache.c
> > +++ b/drivers/acpi/acpica/utcache.c
> > @@ -166,7 +166,7 @@ acpi_status acpi_os_delete_cache(struct acpi_memory_list * cache)
> >
> >  	/* Now we can delete the cache object */
> >
> > -	acpi_os_free(cache);
> > +	kfree(cache);
> >  	return (AE_OK);
> >  }
> >
> > diff --git a/drivers/acpi/acpica/uttrack.c b/drivers/acpi/acpica/uttrack.c
> > index 160f13f..ac815e5 100644
> > --- a/drivers/acpi/acpica/uttrack.c
> > +++ b/drivers/acpi/acpica/uttrack.c
> > @@ -141,7 +141,7 @@ void *acpi_ut_allocate_and_track(acpi_size size,
> >  					  ACPI_MEM_MALLOC, component, module,
> >  					  line);
> >  	if (ACPI_FAILURE(status)) {
> > -		acpi_os_free(allocation);
> > +		kfree(allocation);
> >  		return (NULL);
> >  	}
> >
> > @@ -195,7 +195,7 @@ void *acpi_ut_allocate_zeroed_and_track(acpi_size size,
> >  					  ACPI_MEM_CALLOC, component, module,
> >  					  line);
> >  	if (ACPI_FAILURE(status)) {
> > -		acpi_os_free(allocation);
> > +		kfree(allocation);
> >  		return (NULL);
> >  	}
> >
> > @@ -254,7 +254,7 @@ acpi_ut_free_and_track(void *allocation,
> >  		ACPI_EXCEPTION((AE_INFO, status, "Could not free memory"));
> >  	}
> >
> > -	acpi_os_free(debug_block);
> > +	kfree(debug_block);
> >  	ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, "%p freed\n", allocation));
> >  	return_VOID;
> >  }
> > diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
> > index 64b8c76..0f730ca 100644
> > --- a/include/acpi/acpiosxf.h
> > +++ b/include/acpi/acpiosxf.h
> > @@ -146,8 +146,6 @@ void acpi_os_release_mutex(acpi_mutex handle);
> >   */
> >  void *acpi_os_allocate(acpi_size size);
> >
> > -void acpi_os_free(void *memory);
> > -
> >  void __iomem *acpi_os_map_memory(acpi_physical_address where,
> >  				acpi_size length);
> >
> >
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.
��.n��������+%������w��{.n����z�ޗ�����n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux