Skip to content

Commit

Permalink
xen/sound: switch xen_snd_front to use INVALID_GRANT_REF
Browse files Browse the repository at this point in the history
Instead of using a private macro for an invalid grant reference use
the common one.

Signed-off-by: Juergen Gross <[email protected]>
Reviewed-by: Oleksandr Tyshchenko <[email protected]>
Tested-by: Oleksandr Tyshchenko <[email protected]> # Arm64 only
Signed-off-by: Juergen Gross <[email protected]>
  • Loading branch information
jgross1 committed May 19, 2022
1 parent cb52163 commit 297ce02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
4 changes: 2 additions & 2 deletions sound/xen/xen_snd_front_evtchnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static void evtchnl_free(struct xen_snd_front_info *front_info,
xenbus_free_evtchn(front_info->xb_dev, channel->port);

/* End access and free the page. */
if (channel->gref != GRANT_INVALID_REF)
if (channel->gref != INVALID_GRANT_REF)
gnttab_end_foreign_access(channel->gref, page);
else
free_page(page);
Expand Down Expand Up @@ -207,7 +207,7 @@ static int evtchnl_alloc(struct xen_snd_front_info *front_info, int index,
channel->index = index;
channel->front_info = front_info;
channel->state = EVTCHNL_STATE_DISCONNECTED;
channel->gref = GRANT_INVALID_REF;
channel->gref = INVALID_GRANT_REF;
page = get_zeroed_page(GFP_KERNEL);
if (!page) {
ret = -ENOMEM;
Expand Down
9 changes: 0 additions & 9 deletions sound/xen/xen_snd_front_evtchnl.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@

struct xen_snd_front_info;

#ifndef GRANT_INVALID_REF
/*
* FIXME: usage of grant reference 0 as invalid grant reference:
* grant reference 0 is valid, but never exposed to a PV driver,
* because of the fact it is already in use/reserved by the PV console.
*/
#define GRANT_INVALID_REF 0
#endif

/* Timeout in ms to wait for backend to respond. */
#define VSND_WAIT_BACK_MS 3000

Expand Down

0 comments on commit 297ce02

Please sign in to comment.