Messages in this thread Patch in this message | | | Date | Fri, 21 Mar 2014 11:13:42 -0500 | From | Dimitri Sivanich <> | Subject | Re: [PATCH] x86/UV: Fix conditional in gru_exit |
| |
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()); +} /* * gru_vma_close @@ -518,7 +522,7 @@ static int __init gru_init(void) { int ret; - if (!is_uv_system() || (is_uvx_hub() && !is_uv2_hub())) + if (gru_unsupported()) return 0; #if defined CONFIG_IA64 @@ -573,7 +577,7 @@ exit0: static void __exit gru_exit(void) { - if (!is_uv_system()) + if (gru_unsupported()) return; gru_teardown_tlb_irqs();
| |