Skip to content

Commit bd506c7

Browse files
committed
xen/dmabuf: switch gntdev-dmabuf 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 <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent 297ce02 commit bd506c7

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

drivers/xen/gntdev-dmabuf.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@
2424

2525
MODULE_IMPORT_NS(DMA_BUF);
2626

27-
#ifndef GRANT_INVALID_REF
28-
/*
29-
* Note on usage of grant reference 0 as invalid grant reference:
30-
* grant reference 0 is valid, but never exposed to a driver,
31-
* because of the fact it is already in use/reserved by the PV console.
32-
*/
33-
#define GRANT_INVALID_REF 0
34-
#endif
35-
3627
struct gntdev_dmabuf {
3728
struct gntdev_dmabuf_priv *priv;
3829
struct dma_buf *dmabuf;
@@ -532,7 +523,7 @@ static void dmabuf_imp_end_foreign_access(u32 *refs, int count)
532523
int i;
533524

534525
for (i = 0; i < count; i++)
535-
if (refs[i] != GRANT_INVALID_REF)
526+
if (refs[i] != INVALID_GRANT_REF)
536527
gnttab_end_foreign_access(refs[i], 0UL);
537528
}
538529

@@ -567,7 +558,7 @@ static struct gntdev_dmabuf *dmabuf_imp_alloc_storage(int count)
567558
gntdev_dmabuf->nr_pages = count;
568559

569560
for (i = 0; i < count; i++)
570-
gntdev_dmabuf->u.imp.refs[i] = GRANT_INVALID_REF;
561+
gntdev_dmabuf->u.imp.refs[i] = INVALID_GRANT_REF;
571562

572563
return gntdev_dmabuf;
573564

0 commit comments

Comments
 (0)