[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140331072505.GA2004@gmail.com>
Date: Mon, 31 Mar 2014 09:25:05 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Dimitri Sivanich <sivanich@....com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH] x86/UV: Fix conditional in gru_exit
* Dimitri Sivanich <sivanich@....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@....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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists