mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Oeser <ioe-lkml@rameria.de>
To: linux-kernel@vger.kernel.org
Cc: Davi Arnaut <davi.arnaut@gmail.com>,
	Dave Jones <davej@redhat.com>,
	len.brown@intel.com, pavel@ucw.cz, akpm@osdl.org
Subject: Re: + acpi_os_acquire_object-gfp_kernel-called-with-irqs.patch added to -mm tree
Date: Wed, 15 Feb 2006 20:15:59 +0100	[thread overview]
Message-ID: <200602152016.05461.ioe-lkml@rameria.de> (raw)
In-Reply-To: <20060213222406.518edeb8.davi.arnaut@gmail.com>

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


      reply	other threads:[~2006-02-15 19:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200602132314.k1DNElaA011901@shell0.pdx.osdl.net>
2006-02-13 23:52 ` Dave Jones
2006-02-14  1:24   ` Davi Arnaut
2006-02-15 19:15     ` Ingo Oeser [this message]

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=200602152016.05461.ioe-lkml@rameria.de \
    --to=ioe-lkml@rameria.de \
    --cc=akpm@osdl.org \
    --cc=davej@redhat.com \
    --cc=davi.arnaut@gmail.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome