Project

General

Profile

Bug #10867

ehci: comparison between pointer and integer

Added by Toomas Soome 6 months ago. Updated 5 months ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Debug build errors with NULL pointer:

    In file included from ../../common/sys/model.h:35:0,
                     from ../../common/sys/resource.h:221,
                     from ../../common/sys/vnode.h:51,
                     from ../../common/vm/seg.h:43,
                     from ../../common/vm/as.h:47,
                     from ../../common/sys/devops.h:37,
                     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_isoch_util.c:37:
    ../../common/io/usb/hcd/ehci/ehci_isoch_util.c: In function 'ehci_allocate_i
tw':
    ../../common/io/usb/hcd/ehci/ehci_isoch_util.c:490:21: error: comparison bet
ween pointer and integer [-Werror]
      ASSERT(itw->itw_id != NULL);
                         ^
    ../../common/sys/debug.h:59:29: note: in definition of macro 'ASSERT'
     #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
                                 ^~
    ../../common/io/usb/hcd/ehci/ehci_isoch_util.c: In function 'ehci_free_itw_d
ma':
    ../../common/io/usb/hcd/ehci/ehci_isoch_util.c:593:21: error: comparison bet
ween pointer and integer [-Werror]
      ASSERT(itw->itw_id != NULL);
                         ^
    ../../common/sys/debug.h:59:29: note: in definition of macro 'ASSERT'
     #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
                                 ^~

    In file included from ../../common/sys/model.h:35:0,
                     from ../../common/sys/resource.h:221,
                     from ../../common/sys/vnode.h:51,
                     from ../../common/vm/seg.h:43,
                     from ../../common/vm/as.h:47,
                     from ../../common/sys/devops.h:37,
                     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_xfer.c:37:
    ../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_insert_async_qh'
:
    ../../common/io/usb/hcd/ehci/ehci_xfer.c:584:50: error: comparison between p
ointer and integer [-Werror]
      ASSERT((Get_QH(qh->qh_prev) & EHCI_QH_LINK_PTR) == NULL);
                                                      ^
    ../../common/sys/debug.h:59:29: note: in definition of macro 'ASSERT'
     #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
                                 ^~
    ../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_insert_intr_qh':
    ../../common/io/usb/hcd/ehci/ehci_xfer.c:682:50: error: comparison between p
ointer and integer [-Werror]
      ASSERT((Get_QH(qh->qh_prev) & EHCI_QH_LINK_PTR) == NULL);
                                                      ^
    ../../common/sys/debug.h:59:29: note: in definition of macro 'ASSERT'
     #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
                                 ^~
    ../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_insert_qh_on_reclaim_list':
    ../../common/io/usb/hcd/ehci/ehci_xfer.c:1307:37: error: comparison between pointer and integer [-Werror]
      ASSERT(Get_QH(qh->qh_reclaim_next) == NULL);
                                         ^
    ../../common/sys/debug.h:59:29: note: in definition of macro 'ASSERT'
     #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
                                 ^~
    ../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_fill_in_qtd':
    ../../common/io/usb/hcd/ehci/ehci_xfer.c:2509:19: error: comparison between pointer and integer [-Werror]
      ASSERT(tw->tw_id != NULL);
                       ^
    ../../common/sys/debug.h:59:29: note: in definition of macro 'ASSERT'
     #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
                                 ^~
    ../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_insert_qtd_on_tw':
    ../../common/io/usb/hcd/ehci/ehci_xfer.c:2552:40: error: comparison between pointer and integer [-Werror]
       ASSERT(Get_QTD(qtd->qtd_tw_next_qtd) == NULL);
                                            ^
    ../../common/sys/debug.h:59:29: note: in definition of macro 'ASSERT'
     #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
                                 ^~
    ../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_create_transfer_wrapper':
    ../../common/io/usb/hcd/ehci/ehci_xfer.c:3103:19: error: comparison between pointer and integer [-Werror]
      ASSERT(tw->tw_id != NULL);
                       ^
    ../../common/sys/debug.h:59:29: note: in definition of macro 'ASSERT'
     #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
                                 ^~
    ../../common/io/usb/hcd/ehci/ehci_xfer.c: In function 'ehci_free_tw':
    ../../common/io/usb/hcd/ehci/ehci_xfer.c:3530:19: error: comparison between pointer and integer [-Werror]
      ASSERT(tw->tw_id != NULL);
                       ^
    ../../common/sys/debug.h:59:29: note: in definition of macro 'ASSERT'
     #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
                                 ^~

    In file included from ../../common/sys/model.h:35:0,
                     from ../../common/sys/resource.h:221,
                     from ../../common/sys/vnode.h:51,
                     from ../../common/vm/seg.h:43,
                     from ../../common/vm/as.h:47,
                     from ../../common/sys/devops.h:37,
                     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_polled.c:39:
    ../../common/io/usb/hcd/ehci/ehci_polled.c: In function 'ehci_polled_insert_qtd_on_tw':
    ../../common/io/usb/hcd/ehci/ehci_polled.c:1787:40: error: comparison between pointer and integer [-Werror]
       ASSERT(Get_QTD(qtd->qtd_tw_next_qtd) == NULL);
                                            ^
    ../../common/sys/debug.h:59:29: note: in definition of macro 'ASSERT'
     #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
                                 ^~
    ../../common/io/usb/hcd/ehci/ehci_polled.c: In function 'ehci_polled_insert_async_qh':
    ../../common/io/usb/hcd/ehci/ehci_polled.c:2138:50: error: comparison between pointer and integer [-Werror]
      ASSERT((Get_QH(qh->qh_prev) & EHCI_QH_LINK_PTR) == NULL);
                                                      ^
    ../../common/sys/debug.h:59:29: note: in definition of macro 'ASSERT'
     #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
                                 ^~

    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 5 months ago

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

git commit 0a1044f1d1346ec799488913a15abfae3e3c848a

commit  0a1044f1d1346ec799488913a15abfae3e3c848a
Author: Toomas Soome <tsoome@me.com>
Date:   2019-05-16T18:28:10.000Z

    10867 ehci: comparison between pointer and integer
    Reviewed by: Alexander Pyhalov <apyhalov@gmail.com>
    Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF