From 32277f1d41242ad5c1c6aa4fd538caac93b6c0c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joan=20Lled=C3=B3?= Date: Sun, 31 May 2020 09:20:33 +0200 Subject: [PATCH] HURD: Use MACH_PORT_NULL to initialize the port --- lib/hurd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/hurd.c b/lib/hurd.c index 389ca33..13d88ac 100644 --- a/lib/hurd.c +++ b/lib/hurd.c @@ -73,7 +73,7 @@ static void hurd_init_dev(struct pci_dev *d) { d->aux = pci_malloc(d->access, sizeof(mach_port_t)); - *((mach_port_t *) d->aux) = 0; + *((mach_port_t *) d->aux) = MACH_PORT_NULL; } /* Deallocate the port and free its space */ @@ -232,7 +232,7 @@ hurd_read(struct pci_dev *d, int pos, byte * buf, int len) mach_port_t device_port; nread = len; - if (*((mach_port_t *) d->aux) == 0) + if (*((mach_port_t *) d->aux) == MACH_PORT_NULL) { /* We still don't have the port for this device */ device_port_lookup(d); @@ -281,7 +281,7 @@ hurd_write(struct pci_dev *d, int pos, byte * buf, int len) mach_port_t device_port; nwrote = len; - if (*((mach_port_t *) d->aux) == 0) + if (*((mach_port_t *) d->aux) == MACH_PORT_NULL) { /* We still don't have the port for this device */ device_port_lookup(d); -- 2.39.5