All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org
Subject: [PATCH 06/18] xen/sound: switch xen_snd_front to use INVALID_GRANT_REF
Date: Wed, 20 Apr 2022 17:09:30 +0200	[thread overview]
Message-ID: <20220420150942.31235-7-jgross@suse.com> (raw)
In-Reply-To: <20220420150942.31235-1-jgross@suse.com>

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

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 sound/xen/xen_snd_front_evtchnl.c | 4 ++--
 sound/xen/xen_snd_front_evtchnl.h | 9 ---------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/sound/xen/xen_snd_front_evtchnl.c b/sound/xen/xen_snd_front_evtchnl.c
index ecbc294fc59a..3e21369c8216 100644
--- a/sound/xen/xen_snd_front_evtchnl.c
+++ b/sound/xen/xen_snd_front_evtchnl.c
@@ -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);
@@ -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;
diff --git a/sound/xen/xen_snd_front_evtchnl.h b/sound/xen/xen_snd_front_evtchnl.h
index cbe51fd1ec15..3675fba70564 100644
--- a/sound/xen/xen_snd_front_evtchnl.h
+++ b/sound/xen/xen_snd_front_evtchnl.h
@@ -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
 
-- 
2.34.1


WARNING: multiple messages have this Message-ID (diff)
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	alsa-devel@alsa-project.org, Takashi Iwai <tiwai@suse.com>,
	Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Subject: [PATCH 06/18] xen/sound: switch xen_snd_front to use INVALID_GRANT_REF
Date: Wed, 20 Apr 2022 17:09:30 +0200	[thread overview]
Message-ID: <20220420150942.31235-7-jgross@suse.com> (raw)
In-Reply-To: <20220420150942.31235-1-jgross@suse.com>

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

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 sound/xen/xen_snd_front_evtchnl.c | 4 ++--
 sound/xen/xen_snd_front_evtchnl.h | 9 ---------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/sound/xen/xen_snd_front_evtchnl.c b/sound/xen/xen_snd_front_evtchnl.c
index ecbc294fc59a..3e21369c8216 100644
--- a/sound/xen/xen_snd_front_evtchnl.c
+++ b/sound/xen/xen_snd_front_evtchnl.c
@@ -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);
@@ -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;
diff --git a/sound/xen/xen_snd_front_evtchnl.h b/sound/xen/xen_snd_front_evtchnl.h
index cbe51fd1ec15..3675fba70564 100644
--- a/sound/xen/xen_snd_front_evtchnl.h
+++ b/sound/xen/xen_snd_front_evtchnl.h
@@ -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
 
-- 
2.34.1


  parent reply	other threads:[~2022-04-20 15:11 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 15:09 [PATCH 00/18] xen: simplify frontend side ring setup Juergen Gross
2022-04-20 15:09 ` Juergen Gross
2022-04-20 15:09 ` Juergen Gross
2022-04-20 15:09 ` [PATCH 01/18] xen/blkfront: switch blkfront to use INVALID_GRANT_REF Juergen Gross
2022-04-20 15:09 ` [PATCH 02/18] xen/netfront: switch netfront " Juergen Gross
2022-04-20 15:09 ` [PATCH 03/18] xen/scsifront: remove unused GRANT_INVALID_REF definition Juergen Gross
2022-04-20 15:09 ` [PATCH 04/18] xen/usb: switch xen-hcd to use INVALID_GRANT_REF Juergen Gross
2022-04-20 15:34   ` Greg Kroah-Hartman
2022-04-20 15:09 ` [PATCH 05/18] xen/drm: switch xen_drm_front " Juergen Gross
2022-04-20 15:09   ` Juergen Gross
2022-04-20 15:09 ` Juergen Gross [this message]
2022-04-20 15:09   ` [PATCH 06/18] xen/sound: switch xen_snd_front " Juergen Gross
2022-04-20 15:09 ` [PATCH 07/18] xen/dmabuf: switch gntdev-dmabuf " Juergen Gross
2022-04-20 15:09 ` [PATCH 08/18] xen/shbuf: switch xen-front-pgdir-shbuf " Juergen Gross
2022-04-20 15:09 ` [PATCH 09/18] xen/xenbus: add xenbus_setup_ring() service function Juergen Gross
2022-04-20 18:44   ` Boris Ostrovsky
2022-04-21  7:57     ` Juergen Gross
2022-04-20 15:09 ` [PATCH 10/18] xen/blkfront: use xenbus_setup_ring() and xenbus_teardown_ring() Juergen Gross
2022-04-20 15:09 ` [PATCH 11/18] xen/netfront: " Juergen Gross
2022-04-20 15:09 ` [PATCH 12/18] xen/tpmfront: " Juergen Gross
2022-04-20 15:09 ` [PATCH 13/18] xen/drmfront: " Juergen Gross
2022-04-20 15:09   ` Juergen Gross
2022-04-20 15:09 ` [PATCH 14/18] xen/pcifront: " Juergen Gross
2022-04-20 15:09 ` [PATCH 15/18] xen/scsifront: " Juergen Gross
2022-04-20 15:09 ` [PATCH 16/18] xen/usbfront: " Juergen Gross
2022-04-20 15:35   ` Greg Kroah-Hartman
2022-04-20 15:09 ` [PATCH 17/18] xen/sndfront: " Juergen Gross
2022-04-20 15:09   ` Juergen Gross
2022-04-20 15:09 ` [PATCH 18/18] xen/xenbus: eliminate xenbus_grant_ring() Juergen Gross
2022-04-20 15:22   ` Andrew Cooper
2022-04-20 15:33     ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220420150942.31235-7-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleksandr_andrushchenko@epam.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.