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 <[email protected]>
> --
>
> 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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]