All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] kernel: a few readability changes for nice values
Date: Mon, 20 Oct 2008 16:57:18 +0000	[thread overview]
Message-ID: <20081020165717.GH26184@parisc-linux.org> (raw)
In-Reply-To: <a91986340810162050n6cdfe617nf9aa90620cc79084@mail.gmail.com>

On Thu, Oct 16, 2008 at 08:50:51PM -0700, Mike Steiner wrote:
> -	if (increment < -40)
> -		increment = -40;
> -	if (increment > 40)
> -		increment = 40;
> +	increment = CONSTRAIN_TO_RANGE(-40, increment, 40);

I'm sorry, I just don't see this as a 'readability improvement'.  I can
tell exactly what the original does; the second one looks complex.

Even writing it as:

	increment = max(min(increment, 40), -40)

doesn't really improve it.

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

      parent reply	other threads:[~2008-10-20 16:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-17  3:50 [PATCH] kernel: a few readability changes for nice values Mike Steiner
2008-10-19  1:00 ` Johannes Weiner
2008-10-20 16:42 ` Randy Dunlap
2008-10-20 16:57 ` Matthew Wilcox [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=20081020165717.GH26184@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.