Print this page
10686 Debug macros causes smatch issues


   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 




  26 #ifndef _SRPT_IMPL_H_
  27 #define _SRPT_IMPL_H_
  28 
  29 /*
  30  * Prototypes and data structures for the SRP Target Port Provider.
  31  */
  32 
  33 #include <sys/types.h>
  34 #include <sys/ddi.h>
  35 #include <sys/ib/ibtl/ibti.h>
  36 #include <sys/modctl.h>
  37 
  38 #include <sys/stmf.h>
  39 #include <sys/stmf_ioctl.h>
  40 #include <sys/portif.h>
  41 
  42 #include <sys/ib/mgt/ibdma/ibdma.h>
  43 
  44 #ifdef __cplusplus
  45 extern "C" {


 501  * The default log level is L1.
 502  */
 503 #define SRPT_LOG_DEFAULT_LEVEL SRPT_LOG_L1
 504 
 505 extern uint_t srpt_errlevel;
 506 
 507 
 508 #define SRPT_DPRINTF_L0(...) cmn_err(CE_WARN, __VA_ARGS__)
 509 #define SRPT_DPRINTF_L1(...) cmn_err(CE_NOTE, __VA_ARGS__)
 510 #define SRPT_DPRINTF_L2(...)    if (srpt_errlevel >= SRPT_LOG_L2) { \
 511                                         cmn_err(CE_NOTE, __VA_ARGS__);\
 512                                 }
 513 #ifdef  DEBUG
 514 #define SRPT_DPRINTF_L3(...)    if (srpt_errlevel >= SRPT_LOG_L3) { \
 515                                         cmn_err(CE_NOTE, __VA_ARGS__);\
 516                                 }
 517 #define SRPT_DPRINTF_L4(...)    if (srpt_errlevel >= SRPT_LOG_L4) { \
 518                                         cmn_err(CE_NOTE, __VA_ARGS__);\
 519                                 }
 520 #else
 521 #define SRPT_DPRINTF_L3         0 &&
 522 #define SRPT_DPRINTF_L4         0 &&
 523 #endif
 524 
 525 #ifdef __cplusplus
 526 }
 527 #endif
 528 
 529 #endif /* _SRPT_IMPL_H_ */


   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 /*
  27  * Copyright 2019, Joyent, Inc.
  28  */
  29 
  30 #ifndef _SRPT_IMPL_H_
  31 #define _SRPT_IMPL_H_
  32 
  33 /*
  34  * Prototypes and data structures for the SRP Target Port Provider.
  35  */
  36 
  37 #include <sys/types.h>
  38 #include <sys/ddi.h>
  39 #include <sys/ib/ibtl/ibti.h>
  40 #include <sys/modctl.h>
  41 
  42 #include <sys/stmf.h>
  43 #include <sys/stmf_ioctl.h>
  44 #include <sys/portif.h>
  45 
  46 #include <sys/ib/mgt/ibdma/ibdma.h>
  47 
  48 #ifdef __cplusplus
  49 extern "C" {


 505  * The default log level is L1.
 506  */
 507 #define SRPT_LOG_DEFAULT_LEVEL SRPT_LOG_L1
 508 
 509 extern uint_t srpt_errlevel;
 510 
 511 
 512 #define SRPT_DPRINTF_L0(...) cmn_err(CE_WARN, __VA_ARGS__)
 513 #define SRPT_DPRINTF_L1(...) cmn_err(CE_NOTE, __VA_ARGS__)
 514 #define SRPT_DPRINTF_L2(...)    if (srpt_errlevel >= SRPT_LOG_L2) { \
 515                                         cmn_err(CE_NOTE, __VA_ARGS__);\
 516                                 }
 517 #ifdef  DEBUG
 518 #define SRPT_DPRINTF_L3(...)    if (srpt_errlevel >= SRPT_LOG_L3) { \
 519                                         cmn_err(CE_NOTE, __VA_ARGS__);\
 520                                 }
 521 #define SRPT_DPRINTF_L4(...)    if (srpt_errlevel >= SRPT_LOG_L4) { \
 522                                         cmn_err(CE_NOTE, __VA_ARGS__);\
 523                                 }
 524 #else
 525 #define SRPT_DPRINTF_L3(...)
 526 #define SRPT_DPRINTF_L4(...)
 527 #endif
 528 
 529 #ifdef __cplusplus
 530 }
 531 #endif
 532 
 533 #endif /* _SRPT_IMPL_H_ */