Skip to content

Commit edd81e7

Browse files
committed
xen/usb: switch xen-hcd 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> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Juergen Gross <jgross@suse.com>
1 parent 70920be commit edd81e7

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

drivers/usb/host/xen-hcd.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ struct xenhcd_info {
8787
bool error;
8888
};
8989

90-
#define GRANT_INVALID_REF 0
91-
9290
#define XENHCD_RING_JIFFIES (HZ/200)
9391
#define XENHCD_SCAN_JIFFIES 1
9492

@@ -1100,17 +1098,17 @@ static void xenhcd_destroy_rings(struct xenhcd_info *info)
11001098
unbind_from_irqhandler(info->irq, info);
11011099
info->irq = 0;
11021100

1103-
if (info->urb_ring_ref != GRANT_INVALID_REF) {
1101+
if (info->urb_ring_ref != INVALID_GRANT_REF) {
11041102
gnttab_end_foreign_access(info->urb_ring_ref,
11051103
(unsigned long)info->urb_ring.sring);
1106-
info->urb_ring_ref = GRANT_INVALID_REF;
1104+
info->urb_ring_ref = INVALID_GRANT_REF;
11071105
}
11081106
info->urb_ring.sring = NULL;
11091107

1110-
if (info->conn_ring_ref != GRANT_INVALID_REF) {
1108+
if (info->conn_ring_ref != INVALID_GRANT_REF) {
11111109
gnttab_end_foreign_access(info->conn_ring_ref,
11121110
(unsigned long)info->conn_ring.sring);
1113-
info->conn_ring_ref = GRANT_INVALID_REF;
1111+
info->conn_ring_ref = INVALID_GRANT_REF;
11141112
}
11151113
info->conn_ring.sring = NULL;
11161114
}
@@ -1123,8 +1121,8 @@ static int xenhcd_setup_rings(struct xenbus_device *dev,
11231121
grant_ref_t gref;
11241122
int err;
11251123

1126-
info->urb_ring_ref = GRANT_INVALID_REF;
1127-
info->conn_ring_ref = GRANT_INVALID_REF;
1124+
info->urb_ring_ref = INVALID_GRANT_REF;
1125+
info->conn_ring_ref = INVALID_GRANT_REF;
11281126

11291127
urb_sring = (struct xenusb_urb_sring *)get_zeroed_page(
11301128
GFP_NOIO | __GFP_HIGH);

0 commit comments

Comments
 (0)