10711 ehci: NULL pointer errors

Review Request #1677 - Created April 10, 2019 and submitted

Information
Toomas Soome
illumos-gate
10711
63ec3b7...
Reviewers
general
In file included from ../../common/sys/param.h:48:0,
                 from ../../common/sys/t_lock.h:38,
                 from ../../common/sys/buf.h:45,
                 from ../../common/sys/devops.h:35,
                 from ../../common/sys/sunddi.h:39,
                 from ../../common/sys/usb/hcd/ehci/ehci.h:47,
                 from ../../common/sys/usb/hcd/ehci/ehcid.h:45,
                 from ../../common/io/usb/hcd/ehci/ehci.c:50:
../../common/io/usb/hcd/ehci/ehci.c: In function 'ehci_hcdi_pipe_open':
../../common/sys/null.h:32:14: error: passing argument 3 of 'ehci_alloc_qh' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
../../common/io/usb/hcd/ehci/ehci.c:949:39: note: in expansion of macro 'NULL'
  pp->pp_qh = ehci_alloc_qh(ehcip, ph, NULL);
                                       ^~~~
In file included from ../../common/io/usb/hcd/ehci/ehci.c:51:0:
../../common/sys/usb/hcd/ehci/ehci_xfer.h:46:19: note: expected 'uint_t {aka unsigned int}' but argument is of type 'void *'
 extern ehci_qh_t *ehci_alloc_qh(
                   ^~~~~~~~~~~~~
In file included from ../../common/io/usb/hcd/ehci/ehci_intr.c:38:0:
../../common/io/usb/hcd/ehci/ehci_intr.c: In function 'ehci_create_done_qtd_list':
../../common/sys/usb/hcd/ehci/ehcid.h:882:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_intr.c:399:4: note: in expansion of macro 'Set_QTD'
    Set_QTD(curr_qtd->qtd_active_qtd_next, NULL);
    ^~~~~~~

In file included from ../../common/io/usb/hcd/ehci/ehci_isoch.c:37:0:
../../common/io/usb/hcd/ehci/ehci_isoch.c: In function 'ehci_insert_itd_req':
../../common/sys/usb/hcd/ehci/ehcid.h:889:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_isoch.c:579:3: note: in expansion of macro 'Set_ITD'
   Set_ITD(new_itd->itd_link_ptr, NULL);
   ^~~~~~~
../../common/io/usb/hcd/ehci/ehci_isoch.c: In function 'ehci_insert_sitd_req':
../../common/sys/usb/hcd/ehci/ehcid.h:889:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_isoch.c:807:3: note: in expansion of macro 'Set_ITD'
   Set_ITD(new_sitd->itd_link_ptr, NULL);
   ^~~~~~~

../../common/io/usb/hcd/ehci/ehci_isoch_util.c: In function 'ehci_deallocate_itd':
../../common/io/usb/hcd/ehci/ehci_isoch_util.c:700:29: error: comparison between pointer and integer [-Werror]
   if (itd->itd_itw_next_itd == NULL) {
                             ^~
In file included from ../../common/io/usb/hcd/ehci/ehci_isoch_util.c:37:0:
../../common/io/usb/hcd/ehci/ehci_isoch_util.c: In function 'ehci_insert_itd_on_itw':
../../common/sys/usb/hcd/ehci/ehcid.h:889:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_isoch_util.c:846:2: note: in expansion of macro 'Set_ITD'
  Set_ITD(itd->itd_itw_next_itd, NULL);
  ^~~~~~~
../../common/io/usb/hcd/ehci/ehci_isoch_util.c: In function 'ehci_remove_itd_from_active_list':
../../common/io/usb/hcd/ehci/ehci_isoch_util.c:914:28: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
   itd->itd_next_active_itd = NULL;
                            ^
In file included from ../../common/io/usb/hcd/ehci/ehci_isoch_util.c:37:0:
../../common/sys/usb/hcd/ehci/ehcid.h:889:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_isoch_util.c:933:3: note: in expansion of macro 'Set_ITD'
   Set_ITD(itd->itd_next_active_itd, NULL);
   ^~~~~~~
../../common/io/usb/hcd/ehci/ehci_isoch_util.c: In function 'ehci_itd_cpu_to_iommu':
../../common/io/usb/hcd/ehci/ehci_isoch_util.c:1385:10: error: return makes integer from pointer without a cast [-Werror=int-conversion]
   return (NULL);
          ^
../../common/io/usb/hcd/ehci/ehci_isoch_util.c: In function 'ehci_itd_iommu_to_cpu':
../../common/io/usb/hcd/ehci/ehci_isoch_util.c:1420:11: error: comparison between pointer and integer [-Werror]
  if (addr == NULL) {
           ^~

In file included from ../../common/io/usb/hcd/ehci/ehci_xfer.c:37:0:
../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_alloc_qh':
../../common/sys/usb/hcd/ehci/ehcid.h:875:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_xfer.c:374:4: note: in expansion of macro 'Set_QH'
    Set_QH(qh->qh_curr_qtd, NULL);
    ^~~~~~
../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_remove_async_qh':
../../common/sys/usb/hcd/ehci/ehcid.h:875:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_xfer.c:1205:2: note: in expansion of macro 'Set_QH'
  Set_QH(qh->qh_prev, NULL);
  ^~~~~~
../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_remove_intr_qh':
../../common/sys/usb/hcd/ehci/ehcid.h:875:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_xfer.c:1256:2: note: in expansion of macro 'Set_QH'
  Set_QH(qh->qh_prev, NULL);
  ^~~~~~
../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_qh_iommu_to_cpu':
../../common/io/usb/hcd/ehci/ehci_xfer.c:1395:11: error: comparison between pointer and integer [-Werror]
  if (addr == NULL) {
           ^~
In file included from ../../common/io/usb/hcd/ehci/ehci_xfer.c:37:0:
../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_insert_qtd':
../../common/sys/usb/hcd/ehci/ehcid.h:882:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_xfer.c:2272:2: note: in expansion of macro 'Set_QTD'
  Set_QTD(new_dummy_qtd->qtd_tw_next_qtd, NULL);
  ^~~~~~~
../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_insert_qtd_on_tw':
../../common/sys/usb/hcd/ehci/ehcid.h:882:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_xfer.c:2535:2: note: in expansion of macro 'Set_QTD'
  Set_QTD(qtd->qtd_tw_next_qtd, NULL);
  ^~~~~~~
../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_insert_qtd_into_active_qtd_list':
../../common/sys/usb/hcd/ehci/ehcid.h:882:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_xfer.c:2593:3: note: in expansion of macro 'Set_QTD'
   Set_QTD(qtd->qtd_active_qtd_next, NULL);
   ^~~~~~~
../../common/sys/usb/hcd/ehci/ehcid.h:882:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_xfer.c:2594:3: note: in expansion of macro 'Set_QTD'
   Set_QTD(qtd->qtd_active_qtd_prev, NULL);
   ^~~~~~~
../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_deallocate_qtd':
../../common/io/usb/hcd/ehci/ehci_xfer.c:2753:29: error: comparison between pointer and integer [-Werror]
    if (qtd->qtd_tw_next_qtd == NULL) {
                             ^~
../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_qtd_iommu_to_cpu':
../../common/io/usb/hcd/ehci/ehci_xfer.c:2823:11: error: comparison between pointer and integer [-Werror]
  if (addr == NULL) {
           ^~

In file included from ../../common/io/usb/hcd/ehci/ehci_polled.c:39:0:
../../common/io/usb/hcd/ehci/ehci_polled.c: In function 'ehci_polled_save_state':
../../common/sys/usb/hcd/ehci/ehcid.h:875:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_polled.c:1120:3: note: in expansion of macro 'Set_QH'
   Set_QH(qh->qh_buf[i], NULL);
   ^~~~~~
../../common/sys/usb/hcd/ehci/ehcid.h:875:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_polled.c:1121:3: note: in expansion of macro 'Set_QH'
   Set_QH(qh->qh_buf_high[i], NULL);
   ^~~~~~
../../common/io/usb/hcd/ehci/ehci_polled.c: In function 'ehci_polled_stop_processing':
../../common/sys/usb/hcd/ehci/ehcid.h:875:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_polled.c:1299:2: note: in expansion of macro 'Set_QH'
  Set_QH(qh->qh_curr_qtd, NULL);
  ^~~~~~
../../common/io/usb/hcd/ehci/ehci_polled.c: In function 'ehci_polled_process_active_intr_qtd_list':
../../common/sys/usb/hcd/ehci/ehcid.h:882:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_polled.c:1433:5: note: in expansion of macro 'Set_QTD'
     Set_QTD(qtd->qtd_tw_next_qtd, NULL);
     ^~~~~~~
../../common/io/usb/hcd/ehci/ehci_polled.c: In function 'ehci_polled_insert_bulk_qtd':
../../common/sys/usb/hcd/ehci/ehcid.h:882:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_polled.c:1604:2: note: in expansion of macro 'Set_QTD'
  Set_QTD(new_dummy_qtd->qtd_tw_next_qtd, NULL);
  ^~~~~~~
../../common/io/usb/hcd/ehci/ehci_polled.c: In function 'ehci_polled_insert_qtd_on_tw':
../../common/sys/usb/hcd/ehci/ehcid.h:882:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_polled.c:1768:2: note: in expansion of macro 'Set_QTD'
  Set_QTD(qtd->qtd_tw_next_qtd, NULL);
  ^~~~~~~
../../common/io/usb/hcd/ehci/ehci_polled.c: In function 'ehci_polled_create_done_qtd_list':
../../common/sys/usb/hcd/ehci/ehcid.h:882:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_polled.c:1824:4: note: in expansion of macro 'Set_QTD'
    Set_QTD(curr_qtd->qtd_active_qtd_next, NULL);
    ^~~~~~~
../../common/io/usb/hcd/ehci/ehci_polled.c: In function 'ehci_polled_insert_qtd_into_active_intr_qtd_list':
../../common/sys/usb/hcd/ehci/ehcid.h:882:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_polled.c:1877:3: note: in expansion of macro 'Set_QTD'
   Set_QTD(qtd->qtd_active_qtd_next, NULL);
   ^~~~~~~
../../common/sys/usb/hcd/ehci/ehcid.h:882:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_polled.c:1878:3: note: in expansion of macro 'Set_QTD'
   Set_QTD(qtd->qtd_active_qtd_prev, NULL);
   ^~~~~~~
../../common/io/usb/hcd/ehci/ehci_polled.c: In function 'ehci_polled_remove_async_qh':
../../common/sys/usb/hcd/ehci/ehcid.h:875:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      ((int32_t)(val)))
       ^
../../common/io/usb/hcd/ehci/ehci_polled.c:2263:2: note: in expansion of macro 'Set_QH'
  Set_QH(qh->qh_prev, NULL);
  ^~~~~~

In file included from ../../common/sys/param.h:48:0,
                 from ../../common/sys/t_lock.h:38,
                 from ../../common/sys/buf.h:45,
                 from ../../common/sys/devops.h:35,
                 from ../../common/sys/sunddi.h:39,
                 from ../../common/sys/usb/hcd/ehci/ehci.h:47,
                 from ../../common/sys/usb/hcd/ehci/ehcid.h:45,
                 from ../../common/io/usb/hcd/ehci/ehci_util.c:38:
../../common/io/usb/hcd/ehci/ehci_util.c: In function 'ehci_init_hardware':
../../common/sys/null.h:32:14: error: passing argument 3 of 'ehci_alloc_qh' makes integer from pointer without a cast [-Werror=int-conversion]
 #define NULL ((void *)0)
              ^
../../common/io/usb/hcd/ehci/ehci_util.c:1079:35: note: in expansion of macro 'NULL'
        ehci_alloc_qh(ehcip, NULL, NULL);
                                   ^~~~
In file included from ../../common/io/usb/hcd/ehci/ehci_util.c:40:0:
../../common/sys/usb/hcd/ehci/ehci_xfer.h:46:19: note: expected 'uint_t {aka unsigned int}' but argument is of type 'void *'
 extern ehci_qh_t *ehci_alloc_qh(
                   ^~~~~~~~~~~~~
cc1: all warnings being treated as errors

  

Issues

  • 0
  • 6
  • 0
  • 6
Description From Last Updated
Gergő Mihály Doma
Gergő Mihály Doma
Gergő Mihály Doma
Toomas Soome
Review request changed

Status: Closed (submitted)

Loading...