mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nigel Cunningham <ncunningham@linuxmail.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Add missing refrigerator support.
Date: Thu, 29 Jul 2004 08:14:45 +1000	[thread overview]
Message-ID: <1091052885.8867.5.camel@laptop.cunninghams> (raw)
In-Reply-To: <20040728142534.3ed84b99.akpm@osdl.org>

Hi.

On Thu, 2004-07-29 at 07:25, Andrew Morton wrote:
> Nigel Cunningham <ncunningham@linuxmail.org> wrote:
> >
> > +				if (current->flags & PF_FREEZE) {
> > +					refrigerator(PF_FREEZE);
> > +					continue;
> > +				}
> 
> This seems excessively verbose.  Why not do:
> 
> 	if (try_to_freeze())
> 		continue;
> 
> 
> /*
>  * Comment goes here
>  */
> static inline int try_to_freeze(void)
> {
> 	/* I think the compiler propagates likeliness to the inline's caller */
> 	if (unlikely(current->flags & PF_FREEZE)) {
> 		refrigerator(PF_FREEZE);
> 		return 1;
> 	}
> 	return 0;
> }

Probably because I haven't seen that macro before. Looks good. I'll make
use of it and add it to suspend2 too, so that whenever we get the merge
done, it doesn't disappear.

Regards.

Nigel


      reply	other threads:[~2004-07-28 22:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-28  7:23 Nigel Cunningham
2004-07-28 21:25 ` Andrew Morton
2004-07-28 22:14   ` Nigel Cunningham [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=1091052885.8867.5.camel@laptop.cunninghams \
    --to=ncunningham@linuxmail.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®