Actions
Bug #10624
closedpcieb: NULL pointer errors
Start date:
2019-04-01
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
Description
Build errors with NULL pointer:
In file included from ../../common/io/pciex/pcieb.c:44:0: ../../common/io/pciex/pcieb.c: In function 'pcieb_41210_mps_wkrnd': ../../common/sys/null.h:32:14: error: passing argument 3 of 'pci_cap_get' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/sys/pci_cap.h:81:35: note: in definition of macro 'PCI_CAP_GET16' pci_cap_get(h, PCI_CAP_CFGSZ_16, i, b, o)) ^ ../../common/sys/pcie_impl.h:118:40: note: in expansion of macro 'NULL' PCI_CAP_GET ## sz(bus_p->bus_cfg_hdl, NULL, bus_p->bus_pcie_off, off) ^~~~ ../../common/io/pciex/pcieb.c:300:19: note: in expansion of macro 'PCIE_CAP_GET' cdip_dev_ctrl = PCIE_CAP_GET(16, cdip_bus_p, PCIE_DEVCTL); ^~~~~~~~~~~~ ../../common/sys/pci_cap.h:110:17: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *' extern uint32_t pci_cap_get(ddi_acc_handle_t h, pci_cap_config_size_t size, ^~~~~~~~~~~ ../../common/sys/null.h:32:14: error: passing argument 3 of 'pci_cap_get' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/sys/pci_cap.h:81:35: note: in definition of macro 'PCI_CAP_GET16' pci_cap_get(h, PCI_CAP_CFGSZ_16, i, b, o)) ^ ../../common/io/pciex/pcieb.c:328:42: note: in expansion of macro 'NULL' sdip_dev_ctrl = PCI_CAP_GET16(cfg_hdl, NULL, cap_ptr, ^~~~ ../../common/sys/pci_cap.h:110:17: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *' extern uint32_t pci_cap_get(ddi_acc_handle_t h, pci_cap_config_size_t size, ^~~~~~~~~~~ ../../common/sys/null.h:32:14: error: passing argument 3 of 'pci_cap_put' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/sys/pci_cap.h:88:35: note: in definition of macro 'PCI_CAP_PUT16' pci_cap_put(h, PCI_CAP_CFGSZ_16, i, b, o, d)) ^ ../../common/io/pciex/pcieb.c:347:27: note: in expansion of macro 'NULL' PCI_CAP_PUT16(cfg_hdl, NULL, cap_ptr, PCIE_DEVCTL, ^~~~ ../../common/sys/pci_cap.h:113:12: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *' extern int pci_cap_put(ddi_acc_handle_t h, pci_cap_config_size_t size, ^~~~~~~~~~~ ../../common/io/pciex/pcieb.c: In function 'pcieb_attach': ../../common/sys/null.h:32:14: error: passing argument 3 of 'pci_cap_get' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/sys/pci_cap.h:81:35: note: in definition of macro 'PCI_CAP_GET16' pci_cap_get(h, PCI_CAP_CFGSZ_16, i, b, o)) ^ ../../common/sys/pcie_impl.h:118:40: note: in expansion of macro 'NULL' PCI_CAP_GET ## sz(bus_p->bus_cfg_hdl, NULL, bus_p->bus_pcie_off, off) ^~~~ ../../common/io/pciex/pcieb.c:394:6: note: in expansion of macro 'PCIE_CAP_GET' if (PCIE_CAP_GET(16, bus_p, PCIE_LINKCTL) & PCIE_LINKCTL_LINK_DISABLE) ^~~~~~~~~~~~ ../../common/sys/pci_cap.h:110:17: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *' extern uint32_t pci_cap_get(ddi_acc_handle_t h, pci_cap_config_size_t size, ^~~~~~~~~~~ ../../common/io/pciex/pcieb.c: In function 'pcieb_intr_init': ../../common/sys/null.h:32:14: error: passing argument 3 of 'pci_cap_get' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/sys/pci_cap.h:81:35: note: in definition of macro 'PCI_CAP_GET16' pci_cap_get(h, PCI_CAP_CFGSZ_16, i, b, o)) ^ ../../common/io/pciex/pcieb.c:1169:50: note: in expansion of macro 'NULL' hp_msi_off = PCI_CAP_GET16(bus_p->bus_cfg_hdl, NULL, ^~~~ ../../common/sys/pci_cap.h:110:17: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *' extern uint32_t pci_cap_get(ddi_acc_handle_t h, pci_cap_config_size_t size, ^~~~~~~~~~~ ../../common/sys/pci_cap.h:49:41: error: invalid operands to binary | (have 'void *' and 'unsigned int') #define PCI_CAP_XCFG_SPC(i) ((i) ? (i) | PCI_CAP_XCFG_FLAG : 0) ^ ../../common/sys/pci_cap.h:97:35: note: in expansion of macro 'PCI_CAP_XCFG_SPC' pci_cap_get(h, PCI_CAP_CFGSZ_32, PCI_CAP_XCFG_SPC(i), b, o)) ^~~~~~~~~~~~~~~~ ../../common/io/pciex/pcieb.c:1199:19: note: in expansion of macro 'PCI_XCAP_GET32' aer_msi_off = (PCI_XCAP_GET32(bus_p->bus_cfg_hdl, NULL, ^~~~~~~~~~~~~~ ../../common/io/pciex/pcieb.c: In function 'pcieb_pwr_setup': ../../common/sys/null.h:32:14: error: passing argument 3 of 'pci_cap_get' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/sys/pci_cap.h:81:35: note: in definition of macro 'PCI_CAP_GET16' pci_cap_get(h, PCI_CAP_CFGSZ_16, i, b, o)) ^ ../../common/io/pciex/pcieb.c:1576:34: note: in expansion of macro 'NULL' pmcap = PCI_CAP_GET16(conf_hdl, NULL, cap_ptr, PCI_PMCAP); ^~~~ ../../common/sys/pci_cap.h:110:17: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *' extern uint32_t pci_cap_get(ddi_acc_handle_t h, pci_cap_config_size_t size, ^~~~~~~~~~~ ../../common/io/pciex/pcieb.c: In function 'pcieb_id_props': ../../common/sys/null.h:32:14: error: passing argument 3 of 'pci_cap_get' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/sys/pci_cap.h:79:34: note: in definition of macro 'PCI_CAP_GET8' pci_cap_get(h, PCI_CAP_CFGSZ_8, i, b, o)) ^ ../../common/io/pciex/pcieb.c:1755:45: note: in expansion of macro 'NULL' uint8_t esr = PCI_CAP_GET8(config_handle, NULL, ^~~~ ../../common/sys/pci_cap.h:110:17: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *' extern uint32_t pci_cap_get(ddi_acc_handle_t h, pci_cap_config_size_t size, ^~~~~~~~~~~ ../../common/sys/pci_cap.h:49:41: error: invalid operands to binary | (have 'void *' and 'unsigned int') #define PCI_CAP_XCFG_SPC(i) ((i) ? (i) | PCI_CAP_XCFG_FLAG : 0) ^ ../../common/sys/pci_cap.h:97:35: note: in expansion of macro 'PCI_CAP_XCFG_SPC' pci_cap_get(h, PCI_CAP_CFGSZ_32, PCI_CAP_XCFG_SPC(i), b, o)) ^~~~~~~~~~~~~~~~ ../../common/io/pciex/pcieb.c:1764:14: note: in expansion of macro 'PCI_XCAP_GET32' serialid = PCI_XCAP_GET32(config_handle, NULL, ^~~~~~~~~~~~~~ ../../common/sys/pci_cap.h:49:41: error: invalid operands to binary | (have 'void *' and 'unsigned int') #define PCI_CAP_XCFG_SPC(i) ((i) ? (i) | PCI_CAP_XCFG_FLAG : 0) ^ ../../common/sys/pci_cap.h:97:35: note: in expansion of macro 'PCI_CAP_XCFG_SPC' pci_cap_get(h, PCI_CAP_CFGSZ_32, PCI_CAP_XCFG_SPC(i), b, o)) ^~~~~~~~~~~~~~~~ ../../common/io/pciex/pcieb.c:1767:15: note: in expansion of macro 'PCI_XCAP_GET32' serialid |= PCI_XCAP_GET32(config_handle, NULL, ^~~~~~~~~~~~~~ cc1: all warnings being treated as errors
Updated by Electric Monk about 3 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
git commit 21922c7548dfdabb89cea426ea8f693c37391815
commit 21922c7548dfdabb89cea426ea8f693c37391815 Author: Toomas Soome <tsoome@me.com> Date: 2019-04-05T04:58:14.000Z 10624 pcieb: NULL pointer errors Reviewed by: Andy Stormont <astormont@racktopsystems.com> Reviewed by: Andy Fiddaman <andy@omniosce.org> Approved by: Dan McDonald <danmcd@joyent.com>
Actions