Skip to content

Commit 9c13cb3

Browse files
Jack Steinertorvalds
authored andcommitted
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>
1 parent 1848a71 commit 9c13cb3

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

‎drivers/misc/sgi-gru/grufault.c‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@
4040
#include "gru_instructions.h"
4141
#include <asm/uv/uv_hub.h>
4242

43+
/* Return codes for vtop functions */
44+
#define VTOP_SUCCESS 0
45+
#define VTOP_INVALID -1
46+
#define VTOP_RETRY -2
47+
48+
4349
/*
4450
* Test if a physical address is a valid GRU GSEG address
4551
*/
@@ -280,12 +286,12 @@ static int gru_vtop(struct gru_thread_state *gts, unsigned long vaddr,
280286
paddr = paddr & ~((1UL << ps) - 1);
281287
*gpa = uv_soc_phys_ram_to_gpa(paddr);
282288
*pageshift = ps;
283-
return 0;
289+
return VTOP_SUCCESS;
284290

285291
inval:
286-
return -1;
292+
return VTOP_INVALID;
287293
upm:
288-
return -2;
294+
return VTOP_RETRY;
289295
}
290296

291297

@@ -412,9 +418,9 @@ static int gru_try_dropin(struct gru_thread_state *gts,
412418
goto failactive;
413419

414420
ret = gru_vtop(gts, vaddr, write, atomic, &gpa, &pageshift);
415-
if (ret == -1)
421+
if (ret == VTOP_INVALID)
416422
goto failinval;
417-
if (ret == -2)
423+
if (ret == VTOP_RETRY)
418424
goto failupm;
419425

420426
if (!(gts->ts_sizeavail & GRU_SIZEAVAIL(pageshift))) {

0 commit comments

Comments
 (0)