lkml.org 
[lkml]   [2006]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: + acpi_os_acquire_object-gfp_kernel-called-with-irqs.patch added to -mm tree
Date
Hi,

On Tuesday 14 February 2006 02:24, Davi Arnaut wrote:
> You are right, this one instead should work better.
>
> Signed-off-by: Davi Arnaut <davi.arnaut@gmail.com>
> --
>
> diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
> index ac5bbae..8d44b0d 100644
> --- a/drivers/acpi/osl.c
> +++ b/drivers/acpi/osl.c
> @@ -1175,7 +1175,12 @@ acpi_status acpi_os_release_object(acpi_
>
> void *acpi_os_acquire_object(acpi_cache_t * cache)
> {
> - void *object = kmem_cache_alloc(cache, GFP_KERNEL);
> + void *object;
> +
> + if (acpi_in_resume)
> + object = kmem_cache_alloc(cache, GFP_ATOMIC);
> + else
> + object = kmem_cache_alloc(cache, GFP_KERNEL);
> WARN_ON(!object);
> return object;
> }

Why not even fold all the memsets from the caller into this function?
This reduces code of the call sites further and makes it clearer.
Also in every call site, we do some check
(or not as fixed by your patch :-)) and memset it afterwards.

Since kzalloc() this is the new fashion anyway :-)


Regards

Ingo Oeser

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-15 20:19    [W:0.052 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site