Actions
Bug #10792
closedpcie: NULL pointer errors
Start date:
2019-04-14
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:
Description
NULL pointer errors:
In file included from ../../common/sys/pcie_impl.h:33:0, from ../../common/io/pciex/pciev.c:34: ../../common/io/pciex/pciev.c: In function 'pcie_cache_domain_info': ../../common/sys/pciev.h:157:49: error: pointer/integer type mismatch in conditional expression [-Werror] ? PCIE_BUS2DOM(bus_p)->domain.id.domain_id : NULL)) ^ ../../common/io/pciex/pciev.c:129:22: note: in expansion of macro 'PCIE_DOMAIN_ID_GET' uint_t domain_id = PCIE_DOMAIN_ID_GET(bus_p); ^~~~~~~~~~~~~~~~~~ ../../common/sys/pciev.h:156:3: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] ((uint_t)(PCIE_IS_ASSIGNED(bus_p) \ ^ ../../common/io/pciex/pciev.c:129:22: note: in expansion of macro 'PCIE_DOMAIN_ID_GET' uint_t domain_id = PCIE_DOMAIN_ID_GET(bus_p); ^~~~~~~~~~~~~~~~~~ ../../common/io/pciex/pciev.c: In function 'pcie_uncache_domain_info': ../../common/sys/pciev.h:157:49: error: pointer/integer type mismatch in conditional expression [-Werror] ? PCIE_BUS2DOM(bus_p)->domain.id.domain_id : NULL)) ^ ../../common/io/pciex/pciev.c:168:22: note: in expansion of macro 'PCIE_DOMAIN_ID_GET' uint_t domain_id = PCIE_DOMAIN_ID_GET(bus_p); ^~~~~~~~~~~~~~~~~~ ../../common/sys/pciev.h:156:3: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] ((uint_t)(PCIE_IS_ASSIGNED(bus_p) \ ^ ../../common/io/pciex/pciev.c:168:22: note: in expansion of macro 'PCIE_DOMAIN_ID_GET' uint_t domain_id = PCIE_DOMAIN_ID_GET(bus_p); ^~~~~~~~~~~~~~~~~~ ../../common/sys/pciev.h:160:46: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] PCIE_BUS2DOM(bus_p)->domain.id.domain_id = (uint_t)(new_id) ^ ../../common/io/pciex/pciev.c:179:3: note: in expansion of macro 'PCIE_DOMAIN_ID_SET' PCIE_DOMAIN_ID_SET(bus_p, NULL); ^~~~~~~~~~~~~~~~~~ ../../common/io/pciex/pciev.c: In function 'pcie_in_domain': ../../common/sys/pciev.h:157:49: error: pointer/integer type mismatch in conditional expression [-Werror] ? PCIE_BUS2DOM(bus_p)->domain.id.domain_id : NULL)) ^ ../../common/io/pciex/pciev.c:493:11: note: in expansion of macro 'PCIE_DOMAIN_ID_GET' return (PCIE_DOMAIN_ID_GET(bus_p) == domain_id); ^~~~~~~~~~~~~~~~~~ ../../common/sys/pciev.h:156:3: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] ((uint_t)(PCIE_IS_ASSIGNED(bus_p) \ ^ ../../common/io/pciex/pciev.c:493:11: note: in expansion of macro 'PCIE_DOMAIN_ID_GET' return (PCIE_DOMAIN_ID_GET(bus_p) == domain_id); ^~~~~~~~~~~~~~~~~~ In file included from ../../common/sys/param.h:48:0, from ../../common/sys/sysmacros.h:37, from ../../common/io/pciex/pcie.c:27: ../../common/io/pciex/pcie.c: In function 'pcie_rc_fini_bus': ../../common/sys/null.h:32:14: error: passing argument 3 of 'ndi_set_bus_private' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie.c:935:36: note: in expansion of macro 'NULL' ndi_set_bus_private(dip, B_FALSE, NULL, NULL); ^~~~ In file included from ../../common/io/pciex/pcie.c:33:0: ../../common/sys/sunndi.h:272:1: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *' ndi_set_bus_private(dev_info_t *dip, boolean_t up, uint32_t port_type, ^~~~~~~~~~~~~~~~~~~ In file included from ../../common/sys/param.h:48:0, from ../../common/sys/sysmacros.h:37, from ../../common/io/pciex/pcie.c:27: ../../common/io/pciex/pcie.c: In function 'pcie_fini_bus': ../../common/sys/null.h:32:14: error: passing argument 3 of 'ndi_set_bus_private' makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie.c:1273:36: note: in expansion of macro 'NULL' ndi_set_bus_private(dip, B_TRUE, NULL, NULL); ^~~~ In file included from ../../common/io/pciex/pcie.c:33:0: ../../common/sys/sunndi.h:272:1: note: expected 'uint32_t {aka unsigned int}' but argument is of type 'void *' ndi_set_bus_private(dev_info_t *dip, boolean_t up, uint32_t port_type, ^~~~~~~~~~~~~~~~~~~ In file included from ../../common/io/pciex/pcie.c:40:0: ../../common/io/pciex/pcie.c: In function 'pcie_init_root_port_mps': ../../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/pcie.c:1801:45: note: in expansion of macro 'NULL' rp_cap = 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/io/pciex/pcie.c: In function 'pcie_get_max_supported': ../../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/pcie.c:1994:47: note: in expansion of macro 'NULL' max_supported = PCI_CAP_GET16(config_handle, 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/io/pciex/pcie.c: In function 'pcie_root_port': ../../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/pcie.c:2042:44: note: in expansion of macro 'NULL' port_type = PCI_CAP_GET16(config_handle, 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/io/pciex/pcie.c: In function 'pcie_ari_get_next_function': ../../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:83:35: note: in definition of macro 'PCI_CAP_GET32' pci_cap_get(h, PCI_CAP_CFGSZ_32, i, b, o)) ^ ../../common/io/pciex/pcie.c:2352:30: note: in expansion of macro 'NULL' val = PCI_CAP_GET32(handle, NULL, cap_ptr, PCIE_ARI_CAP); ^~~~ ../../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: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1188:3: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_pcie_tbl[10].bit') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1188:3: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1188:15: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_pcie_tbl[10].affected_flags') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1188:15: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1188:21: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_pcie_tbl[10].sec_affected_flags') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1188:21: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1229:3: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_rp_tbl[12].bit') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1229:3: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1229:15: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_rp_tbl[12].affected_flags') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1229:15: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1229:21: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_rp_tbl[12].sec_affected_flags') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1229:21: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1270:3: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_sw_tbl[12].bit') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1270:3: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1270:15: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_sw_tbl[12].affected_flags') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1270:15: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1270:21: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_sw_tbl[12].sec_affected_flags') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1270:21: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1313:3: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_pcie_bdg_tbl[13].bit') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1313:3: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1313:15: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_pcie_bdg_tbl[13].affected_flags') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1313:15: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1313:21: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_pcie_bdg_tbl[13].sec_affected_flags') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1313:21: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1335:3: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_pci_bdg_tbl[6].bit') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1335:3: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1335:15: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_pci_bdg_tbl[6].affected_flags') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1335:15: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1335:21: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_pci_bdg_tbl[6].sec_affected_flags') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1335:21: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1357:3: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_pci_tbl[6].bit') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1357:3: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1357:15: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_pci_tbl[6].affected_flags') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1357:15: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: error: initialization makes integer from pointer without a cast [-Werror=int-conversion] #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1357:21: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/sys/null.h:32:14: note: (near initialization for 'pcie_pci_tbl[6].sec_affected_flags') #define NULL ((void *)0) ^ ../../common/io/pciex/pcie_fault.c:1357:21: note: in expansion of macro 'NULL' {NULL, NULL, NULL, NULL} ^~~~ ../../common/io/pciex/pcie_fault.c: In function 'pf_analyse_error_tbl': ../../common/io/pciex/pcie_fault.c:1473:39: error: comparison between pointer and integer [-Werror] for (row = tbl; err_reg && (row->bit != NULL); row++) { ^~ ../../common/io/pciex/pcie_fault.c: In function 'pf_hdl_lookup': ../../common/io/pciex/pcie_fault.c:2302:12: error: comparison between pointer and integer [-Werror] if ((addr == NULL) && !PCIE_CHECK_VALID_BDF(bdf)) ^~ ../../common/io/pciex/pcie_fault.c: In function 'pf_hdl_compare': ../../common/io/pciex/pcie_fault.c:2472:12: error: comparison between pointer and integer [-Werror] if ((addr != NULL) && PCIE_CHECK_VALID_BDF(bdf) && (found == 0)) { ^~ ../../common/io/pciex/pcie_fault.c: In function 'pf_tlp_decode': ../../common/io/pciex/pcie_fault.c:2594:12: error: assignment makes integer from pointer without a cast [-Werror=int-conversion] flt_addr = NULL; ^ ../../common/io/pciex/pcie_fault.c: In function 'pf_find_busp_by_saer': ../../common/io/pciex/pcie_fault.c:3223:11: error: comparison between pointer and integer [-Werror] if (addr != NULL) { ^~ ../../common/io/pciex/hotplug/pcishpc.c: In function 'pcishpc_set_slot_name': ../../common/io/pciex/hotplug/pcishpc.c:1971:15: error: comparison between pointer and integer [-Werror] while (*s != NULL) ^~ cc1: all warnings being treated as errors
Updated by Electric Monk about 4 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
git commit 296f12dc4bd61fe5e3b1200d2cdf217ed82119a1
commit 296f12dc4bd61fe5e3b1200d2cdf217ed82119a1 Author: Toomas Soome <tsoome@me.com> Date: 2019-04-24T07:13:18.000Z 10792 pcie: NULL pointer errors Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Approved by: Dan McDonald <danmcd@joyent.com>
Actions