aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorJack Steiner <steiner@sgi.com>2009-12-15 19:48:14 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-16 10:20:16 -0500
commit9c13cb331f7054d537d4caa094d3ebbba544833a (patch)
tree7703c6eaa59065656eb7bede772b0dfd84cebd0d /drivers/misc
parent1848a710287b33a92c3c5b2f4c3ae201a879eb7e (diff)
gru: add symbolic names for GRU error code
Use symbol names instead of numbers for error return values for the vtop functions. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/sgi-gru/grufault.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c
index a1b3a1d66af5..3e644042c805 100644
--- a/drivers/misc/sgi-gru/grufault.c
+++ b/drivers/misc/sgi-gru/grufault.c
@@ -40,6 +40,12 @@
40#include "gru_instructions.h" 40#include "gru_instructions.h"
41#include <asm/uv/uv_hub.h> 41#include <asm/uv/uv_hub.h>
42 42
43/* Return codes for vtop functions */
44#define VTOP_SUCCESS 0
45#define VTOP_INVALID -1
46#define VTOP_RETRY -2
47
48
43/* 49/*
44 * Test if a physical address is a valid GRU GSEG address 50 * Test if a physical address is a valid GRU GSEG address
45 */ 51 */
@@ -280,12 +286,12 @@ static int gru_vtop(struct gru_thread_state *gts, unsigned long vaddr,
280 paddr = paddr & ~((1UL << ps) - 1); 286 paddr = paddr & ~((1UL << ps) - 1);
281 *gpa = uv_soc_phys_ram_to_gpa(paddr); 287 *gpa = uv_soc_phys_ram_to_gpa(paddr);
282 *pageshift = ps; 288 *pageshift = ps;
283 return 0; 289 return VTOP_SUCCESS;
284 290
285inval: 291inval:
286 return -1; 292 return VTOP_INVALID;
287upm: 293upm:
288 return -2; 294 return VTOP_RETRY;
289} 295}
290 296
291 297
@@ -412,9 +418,9 @@ static int gru_try_dropin(struct gru_thread_state *gts,
412 goto failactive; 418 goto failactive;
413 419
414 ret = gru_vtop(gts, vaddr, write, atomic, &gpa, &pageshift); 420 ret = gru_vtop(gts, vaddr, write, atomic, &gpa, &pageshift);
415 if (ret == -1) 421 if (ret == VTOP_INVALID)
416 goto failinval; 422 goto failinval;
417 if (ret == -2) 423 if (ret == VTOP_RETRY)
418 goto failupm; 424 goto failupm;
419 425
420 if (!(gts->ts_sizeavail & GRU_SIZEAVAIL(pageshift))) { 426 if (!(gts->ts_sizeavail & GRU_SIZEAVAIL(pageshift))) {