From: Ingo Molnar <mingo@kernel.org>
To: Dimitri Sivanich <sivanich@sgi.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH] x86/UV: Fix conditional in gru_exit
Date: Mon, 31 Mar 2014 09:25:05 +0200 [thread overview]
Message-ID: <20140331072505.GA2004@gmail.com> (raw)
In-Reply-To: <20140321161342.GA17081@sgi.com>
* Dimitri Sivanich <sivanich@sgi.com> wrote:
> On Fri, Mar 21, 2014 at 08:55:49AM +0100, Ingo Molnar wrote:
> > > - if (!is_uv_system())
> > > + if (!is_uv_system() || (is_uvx_hub() && !is_uv2_hub()))
> > > return;
> >
> > Such an amalgation of three system specific conditionals is
> > disgusting, please at minimum factor out a helper routine so that such
> > mismatches cannot happen.
> >
> Agreed. Here's a new patch.
>
>
> Fix supported system conditional in gru_exit.
>
> Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
> ---
> drivers/misc/sgi-gru/grufile.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> Index: linux/drivers/misc/sgi-gru/grufile.c
> ===================================================================
> --- linux.orig/drivers/misc/sgi-gru/grufile.c
> +++ linux/drivers/misc/sgi-gru/grufile.c
> @@ -58,6 +58,10 @@ static int max_user_cbrs, max_user_dsr_b
>
> static struct miscdevice gru_miscdev;
>
> +static int gru_unsupported(void)
> +{
> + return !is_uv_system() || (is_uvx_hub() && !is_uv2_hub());
> +}
So the usual pattern is to introduce simple patterns, without logic
operations in their name. I.e. "gru_supported()" would be more natural
than "gru_not_supported()" or gru_unsupported()".
Thanks,
Ingo
next prev parent reply other threads:[~2014-03-31 7:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-20 20:36 [PATCH] x86/UV: Fix conditional in gru_exit Dimitri Sivanich
2014-03-21 7:55 ` Ingo Molnar
2014-03-21 16:13 ` Dimitri Sivanich
2014-03-31 7:25 ` Ingo Molnar [this message]
2014-03-31 15:23 ` Dimitri Sivanich
2014-04-01 11:07 ` [tip:x86/uv] x86/UV: Fix conditional in gru_exit() tip-bot for Dimitri Sivanich
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=20140331072505.GA2004@gmail.com \
--to=mingo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=sivanich@sgi.com \
--cc=x86@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.