Project

General

Profile

Actions

Bug #10728

closed

hermon: NULL pointer errors

Added by Toomas Soome over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
2019-04-11
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

NULL pointer errors:

    In file included from ../../common/io/ib/adapters/hermon/hermon.c:44:0:
    ../../common/io/ib/adapters/hermon/hermon.c: In function 'get_msix_ctrl':
    ../../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/ib/adapters/hermon/hermon.c:4597:47: note: in expansion of macro 'NULL'
       if ((msix_ctrl = PCI_CAP_GET16(pci_cfg_hdl, NULL, caps_ctrl,
                                                   ^~~~
    ../../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/ib/adapters/hermon/hermon.c: In function 'hermon_set_msix_info':
    ../../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/ib/adapters/hermon/hermon.c:4656:47: note: in expansion of macro 'NULL'
       if ((msix_ctrl = PCI_CAP_GET16(pci_cfg_hdl, NULL, caps_ctrl,
                                                   ^~~~
    ../../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:83:35: note: in definition of macro 'PCI_CAP_GET32'
      pci_cap_get(h, PCI_CAP_CFGSZ_32, i, b, o))
                                       ^
    ../../common/io/ib/adapters/hermon/hermon.c:4662:57: note: in expansion of macro 'NULL'
      state->hs_msix_tbl_offset = PCI_CAP_GET32(pci_cfg_hdl, NULL, caps_ctrl,
                                                             ^~~~
    ../../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:83:35: note: in definition of macro 'PCI_CAP_GET32'
      pci_cap_get(h, PCI_CAP_CFGSZ_32, i, b, o))
                                       ^
    ../../common/io/ib/adapters/hermon/hermon.c:4712:57: note: in expansion of macro 'NULL'
      state->hs_msix_pba_offset = PCI_CAP_GET32(pci_cfg_hdl, NULL, caps_ctrl,
                                                             ^~~~
    ../../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/ib/adapters/hermon/hermon.c: In function 'hermon_intr_disable':
    ../../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/ib/adapters/hermon/hermon.c:4785:48: note: in expansion of macro 'NULL'
        if ((msix_ctrl = PCI_CAP_GET16(pci_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/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/ib/adapters/hermon/hermon.c:4806:30: note: in expansion of macro 'NULL'
       PCI_CAP_PUT16(pci_cfg_hdl, NULL, caps_ctrl, PCI_MSIX_CTRL,
                                  ^~~~
    ../../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,
                ^~~~~~~~~~~

    In file included from ../../common/sys/param.h:48:0,
                     from ../../common/sys/t_lock.h:38,
                     from ../../common/sys/conf.h:37,
                     from ../../common/io/ib/adapters/hermon/hermon_stats.c:37:
    ../../common/io/ib/adapters/hermon/hermon_stats.c: In function 'hermon_kstat_picN_create':
    ../../common/sys/null.h:32:14: error: passing argument 7 of 'kstat_create' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    ../../common/io/ib/adapters/hermon/hermon_stats.c:248:33: note: in expansion of macro 'NULL'
          KSTAT_TYPE_NAMED, num_evt, NULL);
                                     ^~~~
    In file included from ../../common/sys/buf.h:46:0,
                     from ../../common/sys/copyops.h:32,
                     from ../../common/sys/watchpoint.h:32,
                     from ../../common/sys/proc.h:37,
                     from ../../common/sys/systm.h:40,
                     from ../../common/sys/conf.h:56,
                     from ../../common/io/ib/adapters/hermon/hermon_stats.c:37:
    ../../common/sys/kstat.h:793:17: note: expected 'uchar_t {aka unsigned char}' but argument is of type 'void *'
     extern kstat_t *kstat_create(const char *, int, const char *, const char *,
                     ^~~~~~~~~~~~

    ../../common/io/ib/adapters/hermon/hermon_qp.c: In function 'hermon_special_qp_alloc':
    ../../common/io/ib/adapters/hermon/hermon_qp.c:1010:13: error: comparison between pointer and integer [-Werror]
      if (status != NULL) {
                 ^~
    cc1: all warnings being treated as errors

Actions #1

Updated by Electric Monk over 4 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 0b63ccaf46184148daa5151621b2db6c62d1c305

commit  0b63ccaf46184148daa5151621b2db6c62d1c305
Author: Toomas Soome <tsoome@me.com>
Date:   2019-04-19T22:00:15.000Z

    10728 hermon: NULL pointer errors
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF