Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

xen/shbuf: switch xen-front-pgdir-shbuf to use INVALID_GRANT_REF

Instead of using a private macro for an invalid grant reference use
the common one.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Tested-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> # Arm64 only
Signed-off-by: Juergen Gross <jgross@suse.com>

+5 -13
+5 -13
drivers/xen/xen-front-pgdir-shbuf.c
··· 21 21 22 22 #include <xen/xen-front-pgdir-shbuf.h> 23 23 24 - #ifndef GRANT_INVALID_REF 25 - /* 26 - * FIXME: usage of grant reference 0 as invalid grant reference: 27 - * grant reference 0 is valid, but never exposed to a PV driver, 28 - * because of the fact it is already in use/reserved by the PV console. 29 - */ 30 - #define GRANT_INVALID_REF 0 31 - #endif 32 - 33 24 /** 34 25 * This structure represents the structure of a shared page 35 26 * that contains grant references to the pages of the shared ··· 29 38 */ 30 39 struct xen_page_directory { 31 40 grant_ref_t gref_dir_next_page; 41 + #define XEN_GREF_LIST_END 0 32 42 grant_ref_t gref[1]; /* Variable length */ 33 43 }; 34 44 ··· 75 83 xen_front_pgdir_shbuf_get_dir_start(struct xen_front_pgdir_shbuf *buf) 76 84 { 77 85 if (!buf->grefs) 78 - return GRANT_INVALID_REF; 86 + return INVALID_GRANT_REF; 79 87 80 88 return buf->grefs[0]; 81 89 } ··· 134 142 int i; 135 143 136 144 for (i = 0; i < buf->num_grefs; i++) 137 - if (buf->grefs[i] != GRANT_INVALID_REF) 145 + if (buf->grefs[i] != INVALID_GRANT_REF) 138 146 gnttab_end_foreign_access(buf->grefs[i], 0UL); 139 147 } 140 148 kfree(buf->grefs); ··· 347 355 } 348 356 /* Last page must say there is no more pages. */ 349 357 page_dir = (struct xen_page_directory *)ptr; 350 - page_dir->gref_dir_next_page = GRANT_INVALID_REF; 358 + page_dir->gref_dir_next_page = XEN_GREF_LIST_END; 351 359 } 352 360 353 361 /** ··· 376 384 377 385 if (grefs_left <= XEN_NUM_GREFS_PER_PAGE) { 378 386 to_copy = grefs_left; 379 - page_dir->gref_dir_next_page = GRANT_INVALID_REF; 387 + page_dir->gref_dir_next_page = XEN_GREF_LIST_END; 380 388 } else { 381 389 to_copy = XEN_NUM_GREFS_PER_PAGE; 382 390 page_dir->gref_dir_next_page = buf->grefs[i + 1];