Print this page
10686 Debug macros causes smatch issues

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/pciex/pcieb.h
          +++ new/usr/src/uts/common/io/pciex/pcieb.h
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   */
  24   24  
       25 +/*
       26 + * Copyright 2019, Joyent, Inc.
       27 + */
       28 +
  25   29  #ifndef _SYS_PCIEB_H
  26   30  #define _SYS_PCIEB_H
  27   31  
  28   32  #ifdef  __cplusplus
  29   33  extern "C" {
  30   34  #endif
  31   35  
  32   36  #if defined(DEBUG)
  33   37  #define PCIEB_DEBUG pcieb_dbg
  34   38  extern void pcieb_dbg(uint_t bit, dev_info_t *dip, char *fmt, ...);
  35   39  #else /* DEBUG */
  36      -#define PCIEB_DEBUG 0 &&
       40 +#define PCIEB_DEBUG(...)
  37   41  #endif /* DEBUG */
  38   42  
  39   43  typedef enum {  /* same sequence as pcieb_debug_sym[] */
  40   44          /*  0 */ DBG_ATTACH,
  41   45          /*  1 */ DBG_PWR,
  42   46          /*  2 */ DBG_INTR
  43   47  } pcieb_debug_bit_t;
  44   48  
  45   49  /*
  46   50   * Intel specific register offsets with bit definitions.
↓ open down ↓ 106 lines elided ↑ open up ↑
 153  157  /*
 154  158   * The following values are used to initialize the cache line size
 155  159   * and latency timer registers for PCI, PCI-X and PCIe2PCI devices.
 156  160   */
 157  161  #define PCIEB_CACHE_LINE_SIZE   0x10    /* 64 bytes in # of DWORDs */
 158  162  #define PCIEB_LATENCY_TIMER     0x40    /* 64 PCI cycles */
 159  163  
 160  164  extern void     pcieb_set_pci_perf_parameters(dev_info_t *dip,
 161  165                      ddi_acc_handle_t config_handle);
 162  166  extern void     pcieb_plat_attach_workaround(dev_info_t *dip);
 163      -extern void     pcieb_plat_intr_attach(pcieb_devstate_t *pcieb);
 164      -extern void     pcieb_plat_initchild(dev_info_t *child);
 165      -extern void     pcieb_plat_uninitchild(dev_info_t *child);
      167 +extern void     pcieb_plat_intr_attach(pcieb_devstate_t *pcieb);
      168 +extern void     pcieb_plat_initchild(dev_info_t *child);
      169 +extern void     pcieb_plat_uninitchild(dev_info_t *child);
 166  170  extern int      pcieb_plat_ctlops(dev_info_t *rdip, ddi_ctl_enum_t ctlop,
 167  171      void *arg);
 168      -extern int      pcieb_plat_pcishpc_probe(dev_info_t *dip,
      172 +extern int      pcieb_plat_pcishpc_probe(dev_info_t *dip,
 169  173      ddi_acc_handle_t config_handle);
 170  174  extern int      pcieb_plat_peekpoke(dev_info_t *dip, dev_info_t *rdip,
 171  175      ddi_ctl_enum_t ctlop, void *arg, void *result);
 172  176  extern void     pcieb_set_prot_scan(dev_info_t *dip, ddi_acc_impl_t *hdlp);
 173  177  extern int      pcieb_plat_intr_ops(dev_info_t *dip, dev_info_t *rdip,
 174  178      ddi_intr_op_t intr_op, ddi_intr_handle_impl_t *hdlp, void *result);
 175  179  extern boolean_t        pcieb_plat_msi_supported(dev_info_t *dip);
 176  180  extern boolean_t        pcieb_plat_pwr_disable(dev_info_t *dip);
 177  181  
 178  182  #if defined(__i386) || defined(__amd64)
↓ open down ↓ 23 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX