[ofa-general] [PATCH] opensm/complib: indentation changes in header files
Sasha Khapyorsky
sashak at voltaire.com
Sun Aug 12 14:56:08 PDT 2007
This is as produced by opensm/osm_indent script:
indent -npro -kr -i8 -ts8 -sob -l80 -ss -ncs
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
Any comments, propositions?
Sasha
opensm/include/complib/cl_atomic.h | 25 +--
opensm/include/complib/cl_atomic_osd.h | 43 +--
opensm/include/complib/cl_byteswap.h | 75 ++----
opensm/include/complib/cl_byteswap_osd.h | 20 +-
opensm/include/complib/cl_comppool.h | 127 ++++-----
opensm/include/complib/cl_debug.h | 42 +--
opensm/include/complib/cl_debug_osd.h | 26 +--
opensm/include/complib/cl_dispatcher.h | 115 +++-----
opensm/include/complib/cl_event.h | 35 +--
opensm/include/complib/cl_event_osd.h | 24 +-
opensm/include/complib/cl_event_wheel.h | 96 +++----
opensm/include/complib/cl_fleximap.h | 199 ++++++--------
opensm/include/complib/cl_list.h | 338 ++++++++++-------------
opensm/include/complib/cl_log.h | 23 +-
opensm/include/complib/cl_map.h | 156 ++++-------
opensm/include/complib/cl_math.h | 13 +-
opensm/include/complib/cl_passivelock.h | 101 +++----
opensm/include/complib/cl_pool.h | 123 ++++-----
opensm/include/complib/cl_ptr_vector.h | 159 +++++------
opensm/include/complib/cl_qcomppool.h | 162 +++++------
opensm/include/complib/cl_qlist.h | 449 ++++++++++++++----------------
opensm/include/complib/cl_qlockpool.h | 111 ++++----
opensm/include/complib/cl_qmap.h | 215 ++++++---------
opensm/include/complib/cl_qpool.h | 117 ++++-----
opensm/include/complib/cl_spinlock.h | 37 +--
opensm/include/complib/cl_spinlock_osd.h | 18 +-
opensm/include/complib/cl_thread.h | 59 ++---
opensm/include/complib/cl_thread_osd.h | 19 +-
opensm/include/complib/cl_threadpool.h | 32 +--
opensm/include/complib/cl_timer.h | 47 +---
opensm/include/complib/cl_timer_osd.h | 36 +--
opensm/include/complib/cl_types.h | 59 ++---
opensm/include/complib/cl_types_osd.h | 29 +--
opensm/include/complib/cl_vector.h | 181 +++++-------
34 files changed, 1369 insertions(+), 1942 deletions(-)
diff --git a/opensm/include/complib/cl_atomic.h b/opensm/include/complib/cl_atomic.h
index 1a2a834..ceacd8e 100644
--- a/opensm/include/complib/cl_atomic.h
+++ b/opensm/include/complib/cl_atomic.h
@@ -51,13 +51,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Atomic Operations
* NAME
* Atomic Operations
@@ -66,7 +65,6 @@ BEGIN_C_DECLS
* The Atomic Operations functions allow callers to operate on
* 32-bit signed integers in an atomic fashion.
*********/
-
/****f* Component Library: Atomic Operations/cl_atomic_inc
* NAME
* cl_atomic_inc
@@ -77,9 +75,7 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-int32_t
-cl_atomic_inc(
- IN atomic32_t* const p_value );
+int32_t cl_atomic_inc(IN atomic32_t * const p_value);
/*
* PARAMETERS
* p_value
@@ -110,9 +106,7 @@ cl_atomic_inc(
*
* SYNOPSIS
*/
-int32_t
-cl_atomic_dec(
- IN atomic32_t* const p_value );
+int32_t cl_atomic_dec(IN atomic32_t * const p_value);
/*
* PARAMETERS
* p_value
@@ -144,9 +138,7 @@ cl_atomic_dec(
* SYNOPSIS
*/
int32_t
-cl_atomic_add(
- IN atomic32_t* const p_value,
- IN const int32_t increment );
+cl_atomic_add(IN atomic32_t * const p_value, IN const int32_t increment);
/*
* PARAMETERS
* p_value
@@ -181,9 +173,7 @@ cl_atomic_add(
* SYNOPSIS
*/
int32_t
-cl_atomic_sub(
- IN atomic32_t* const p_value,
- IN const int32_t decrement );
+cl_atomic_sub(IN atomic32_t * const p_value, IN const int32_t decrement);
/*
* PARAMETERS
* p_value
@@ -208,5 +198,4 @@ cl_atomic_sub(
*********/
END_C_DECLS
-
-#endif /* _CL_ATOMIC_H_ */
+#endif /* _CL_ATOMIC_H_ */
diff --git a/opensm/include/complib/cl_atomic_osd.h b/opensm/include/complib/cl_atomic_osd.h
index f094fb5..114c01a 100644
--- a/opensm/include/complib/cl_atomic_osd.h
+++ b/opensm/include/complib/cl_atomic_osd.h
@@ -52,69 +52,58 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
-BEGIN_C_DECLS
+BEGIN_C_DECLS extern cl_spinlock_t cl_atomic_spinlock;
-extern cl_spinlock_t cl_atomic_spinlock;
-
-static inline int32_t
-cl_atomic_inc(
- IN atomic32_t* const p_value )
+static inline int32_t cl_atomic_inc(IN atomic32_t * const p_value)
{
- int32_t new_val;
+ int32_t new_val;
cl_spinlock_acquire(&cl_atomic_spinlock);
new_val = *p_value + 1;
*p_value = new_val;
cl_spinlock_release(&cl_atomic_spinlock);
- return( new_val );
+ return (new_val);
}
-static inline int32_t
-cl_atomic_dec(
- IN atomic32_t* const p_value )
+static inline int32_t cl_atomic_dec(IN atomic32_t * const p_value)
{
- int32_t new_val;
+ int32_t new_val;
cl_spinlock_acquire(&cl_atomic_spinlock);
new_val = *p_value - 1;
*p_value = new_val;
cl_spinlock_release(&cl_atomic_spinlock);
- return( new_val );
+ return (new_val);
}
static inline int32_t
-cl_atomic_add(
- IN atomic32_t* const p_value,
- IN const int32_t increment )
+cl_atomic_add(IN atomic32_t * const p_value, IN const int32_t increment)
{
- int32_t new_val;
+ int32_t new_val;
cl_spinlock_acquire(&cl_atomic_spinlock);
new_val = *p_value + increment;
*p_value = new_val;
cl_spinlock_release(&cl_atomic_spinlock);
- return( new_val );
+ return (new_val);
}
static inline int32_t
-cl_atomic_sub(
- IN atomic32_t* const p_value,
- IN const int32_t decrement )
+cl_atomic_sub(IN atomic32_t * const p_value, IN const int32_t decrement)
{
- int32_t new_val;
+ int32_t new_val;
cl_spinlock_acquire(&cl_atomic_spinlock);
new_val = *p_value + decrement;
*p_value = new_val;
cl_spinlock_release(&cl_atomic_spinlock);
- return( new_val );
+ return (new_val);
}
END_C_DECLS
-
-#endif /* _CL_ATOMIC_OSD_H_ */
+#endif /* _CL_ATOMIC_OSD_H_ */
diff --git a/opensm/include/complib/cl_byteswap.h b/opensm/include/complib/cl_byteswap.h
index 5c66bcb..6a1c9bf 100644
--- a/opensm/include/complib/cl_byteswap.h
+++ b/opensm/include/complib/cl_byteswap.h
@@ -53,13 +53,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Byte Swapping
* NAME
* Byte Swapping
@@ -80,7 +79,6 @@ BEGIN_C_DECLS
* Macros:
* CL_NTOH16, CL_HTON16, CL_NTOH32, CL_HTON32, CL_NTOH64, CL_HTON64
*********/
-
/*
* The byteswap_osd.h provides the following macros.
* __LITTLE_ENDIAN
@@ -93,11 +91,9 @@ BEGIN_C_DECLS
* ntoh32, hton32
* ntoh64, hton64
*/
-
#ifndef __BYTE_ORDER
#error "__BYTE_ORDER macro undefined. Missing in endian.h?"
#endif
-
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define CPU_LE 1
#define CPU_BE 0
@@ -105,7 +101,6 @@ BEGIN_C_DECLS
#define CPU_LE 0
#define CPU_BE 1
#endif
-
/****d* Component Library: Byte Swapping/CL_NTOH16
* NAME
* CL_NTOH16
@@ -133,7 +128,6 @@ BEGIN_C_DECLS
* Byte Swapping, CL_HTON16, CL_NTOH32, CL_NTOH64,
* cl_ntoh16, cl_ntoh32, cl_ntoh64, cl_ntoh
*********/
-
/****d* Component Library: Byte Swapping/CL_HTON16
* NAME
* CL_HTON16
@@ -162,14 +156,13 @@ BEGIN_C_DECLS
* cl_hton16, cl_hton32, cl_hton64, cl_ntoh
*********/
#if CPU_LE
- #define CL_NTOH16( x ) (uint16_t)( \
+#define CL_NTOH16( x ) (uint16_t)( \
(((uint16_t)(x) & 0x00FF) << 8) | \
(((uint16_t)(x) & 0xFF00) >> 8) )
#else
- #define CL_NTOH16( x ) (x)
+#define CL_NTOH16( x ) (x)
#endif
#define CL_HTON16 CL_NTOH16
-
/****f* Component Library: Byte Swapping/cl_ntoh16
* NAME
* cl_ntoh16
@@ -196,7 +189,6 @@ BEGIN_C_DECLS
* SEE ALSO
* Byte Swapping, cl_hton16, cl_ntoh32, cl_ntoh64, cl_ntoh
*********/
-
/****f* Component Library: Byte Swapping/cl_hton16
* NAME
* cl_hton16
@@ -224,10 +216,9 @@ BEGIN_C_DECLS
* Byte Swapping, cl_ntoh16, cl_hton32, cl_hton64, cl_ntoh
*********/
#ifndef cl_ntoh16
- #define cl_ntoh16 CL_NTOH16
- #define cl_hton16 CL_HTON16
+#define cl_ntoh16 CL_NTOH16
+#define cl_hton16 CL_HTON16
#endif
-
/****d* Component Library: Byte Swapping/CL_NTOH32
* NAME
* CL_NTOH32
@@ -255,7 +246,6 @@ BEGIN_C_DECLS
* Byte Swapping, CL_HTON32, CL_NTOH16, CL_NTOH64,
* cl_ntoh16, cl_ntoh32, cl_ntoh64, cl_ntoh
*********/
-
/****d* Component Library: Byte Swapping/CL_HTON32
* NAME
* CL_HTON32
@@ -284,16 +274,15 @@ BEGIN_C_DECLS
* cl_hton16, cl_hton32, cl_hton64, cl_ntoh
*********/
#if CPU_LE
- #define CL_NTOH32( x ) (uint32_t)( \
+#define CL_NTOH32( x ) (uint32_t)( \
(((uint32_t)(x) & 0x000000FF) << 24) | \
(((uint32_t)(x) & 0x0000FF00) << 8) | \
(((uint32_t)(x) & 0x00FF0000) >> 8) | \
(((uint32_t)(x) & 0xFF000000) >> 24) )
#else
- #define CL_NTOH32( x ) (x)
+#define CL_NTOH32( x ) (x)
#endif
#define CL_HTON32 CL_NTOH32
-
/****f* Component Library: Byte Swapping/cl_ntoh32
* NAME
* cl_ntoh32
@@ -320,7 +309,6 @@ BEGIN_C_DECLS
* SEE ALSO
* Byte Swapping, cl_hton32, cl_ntoh16, cl_ntoh64, cl_ntoh
*********/
-
/****f* Component Library: Byte Swapping/cl_hton32
* NAME
* cl_hton32
@@ -348,10 +336,9 @@ BEGIN_C_DECLS
* Byte Swapping, cl_ntoh32, cl_hton16, cl_hton64, cl_ntoh
*********/
#ifndef cl_ntoh32
- #define cl_ntoh32 CL_NTOH32
- #define cl_hton32 CL_HTON32
+#define cl_ntoh32 CL_NTOH32
+#define cl_hton32 CL_HTON32
#endif
-
/****d* Component Library: Byte Swapping/CL_NTOH64
* NAME
* CL_NTOH64
@@ -379,7 +366,6 @@ BEGIN_C_DECLS
* Byte Swapping, CL_HTON64, CL_NTOH16, CL_NTOH32,
* cl_ntoh16, cl_ntoh32, cl_ntoh64, cl_ntoh
*********/
-
/****d* Component Library: Byte Swapping/CL_HTON64
* NAME
* CL_HTON64
@@ -408,7 +394,7 @@ BEGIN_C_DECLS
* cl_hton16, cl_hton32, cl_hton64, cl_ntoh
*********/
#if CPU_LE
- #define CL_NTOH64( x ) (uint64_t)( \
+#define CL_NTOH64( x ) (uint64_t)( \
(((uint64_t)(x) & 0x00000000000000FFULL) << 56) | \
(((uint64_t)(x) & 0x000000000000FF00ULL) << 40) | \
(((uint64_t)(x) & 0x0000000000FF0000ULL) << 24) | \
@@ -418,10 +404,9 @@ BEGIN_C_DECLS
(((uint64_t)(x) & 0x00FF000000000000ULL) >> 40) | \
(((uint64_t)(x) & 0xFF00000000000000ULL) >> 56) )
#else
- #define CL_NTOH64( x ) (x)
+#define CL_NTOH64( x ) (x)
#endif
#define CL_HTON64 CL_NTOH64
-
/****f* Component Library: Byte Swapping/cl_ntoh64
* NAME
* cl_ntoh64
@@ -448,7 +433,6 @@ BEGIN_C_DECLS
* SEE ALSO
* Byte Swapping, cl_hton64, cl_ntoh16, cl_ntoh32, cl_ntoh
*********/
-
/****f* Component Library: Byte Swapping/cl_hton64
* NAME
* cl_hton64
@@ -476,10 +460,9 @@ BEGIN_C_DECLS
* Byte Swapping, cl_ntoh64, cl_hton16, cl_hton32, cl_ntoh
*********/
#ifndef cl_ntoh64
- #define cl_ntoh64 CL_NTOH64
- #define cl_hton64 CL_HTON64
+#define cl_ntoh64 CL_NTOH64
+#define cl_hton64 CL_HTON64
#endif
-
/****f* Component Library: Byte Swapping/cl_ntoh
* NAME
* cl_ntoh
@@ -491,28 +474,22 @@ BEGIN_C_DECLS
* SYNOPSIS
*/
static inline void
-cl_ntoh(
- OUT char* const p_dest,
- IN const char* const p_src,
- IN const uint8_t size )
+cl_ntoh(OUT char *const p_dest,
+ IN const char *const p_src, IN const uint8_t size)
{
#if CPU_LE
- uint8_t i;
- char temp;
+ uint8_t i;
+ char temp;
- if( p_src == p_dest )
- {
+ if (p_src == p_dest) {
/* Swap in place if source and destination are the same. */
- for( i = 0; i < size / 2; i++ )
- {
+ for (i = 0; i < size / 2; i++) {
temp = p_dest[i];
p_dest[i] = p_src[size - 1 - i];
p_dest[size - 1 - i] = temp;
}
- }
- else
- {
- for( i = 0; i < size; i++ )
+ } else {
+ for (i = 0; i < size; i++)
p_dest[i] = p_src[size - 1 - i];
}
#else
@@ -520,10 +497,11 @@ cl_ntoh(
* If the source and destination are not the same, copy the source to
* the destination.
*/
- if( p_src != p_dest )
- memcpy( p_dest, p_src, size );
+ if (p_src != p_dest)
+ memcpy(p_dest, p_src, size);
#endif
}
+
/*
* PARAMETERS
* p_dest
@@ -548,5 +526,4 @@ cl_ntoh(
*********/
END_C_DECLS
-
-#endif /* _CL_BYTESWAP_H_ */
+#endif /* _CL_BYTESWAP_H_ */
diff --git a/opensm/include/complib/cl_byteswap_osd.h b/opensm/include/complib/cl_byteswap_osd.h
index 5ea7122..2ad2b18 100644
--- a/opensm/include/complib/cl_byteswap_osd.h
+++ b/opensm/include/complib/cl_byteswap_osd.h
@@ -55,36 +55,26 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define cl_ntoh16(x) bswap_16(x)
#define cl_hton16(x) bswap_16(x)
-
#define cl_ntoh32(x) bswap_32(x)
#define cl_hton32(x) bswap_32(x)
-
#define cl_ntoh64(x) (uint64_t)bswap_64(x)
#define cl_hton64(x) (uint64_t)bswap_64(x)
-
-#else /* Big Endian */
-
+#else /* Big Endian */
#define cl_ntoh16(x) (x)
#define cl_hton16(x) (x)
-
#define cl_ntoh32(x) (x)
#define cl_hton32(x) (x)
-
#define cl_ntoh64(x) (x)
#define cl_hton64(x) (x)
-
#endif
-
-END_C_DECLS
-
-#endif /* _CL_BYTESWAP_OSD_H_ */
+ END_C_DECLS
+#endif /* _CL_BYTESWAP_OSD_H_ */
diff --git a/opensm/include/complib/cl_comppool.h b/opensm/include/complib/cl_comppool.h
index adf11d7..c891cc1 100644
--- a/opensm/include/complib/cl_comppool.h
+++ b/opensm/include/complib/cl_comppool.h
@@ -54,13 +54,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Composite Pool
* NAME
* Composite Pool
@@ -103,7 +102,6 @@ BEGIN_C_DECLS
* Attributes:
* cl_is_cpool_inited, cl_cpool_count
*********/
-
/****d* Component Library: Composite Pool/cl_pfn_cpool_init_t
* NAME
* cl_pfn_cpool_init_t
@@ -116,10 +114,8 @@ BEGIN_C_DECLS
* SYNOPSIS
*/
typedef cl_status_t
-(*cl_pfn_cpool_init_t)(
- IN void** const p_comp_array,
- IN const uint32_t num_components,
- IN void* context );
+ (*cl_pfn_cpool_init_t) (IN void **const p_comp_array,
+ IN const uint32_t num_components, IN void *context);
/*
* PARAMETERS
* p_object
@@ -168,9 +164,7 @@ typedef cl_status_t
* SYNOPSIS
*/
typedef void
-(*cl_pfn_cpool_dtor_t)(
- IN void* const p_object,
- IN void* context );
+ (*cl_pfn_cpool_dtor_t) (IN void *const p_object, IN void *context);
/*
* PARAMETERS
* p_object
@@ -208,12 +202,11 @@ typedef void
*
* SYNOPSIS
*/
-typedef struct _cl_cpool
-{
- cl_qcpool_t qcpool;
- cl_pfn_cpool_init_t pfn_init;
- cl_pfn_cpool_dtor_t pfn_dtor;
- const void *context;
+typedef struct _cl_cpool {
+ cl_qcpool_t qcpool;
+ cl_pfn_cpool_init_t pfn_init;
+ cl_pfn_cpool_dtor_t pfn_dtor;
+ const void *context;
} cl_cpool_t;
/*
@@ -248,9 +241,7 @@ typedef struct _cl_cpool
*
* SYNOPSIS
*/
-void
-cl_cpool_construct(
- IN cl_cpool_t* const p_pool );
+void cl_cpool_construct(IN cl_cpool_t * const p_pool);
/*
* PARAMETERS
* p_pool
@@ -279,14 +270,13 @@ cl_cpool_construct(
*
* SYNOPSIS
*/
-static inline boolean_t
-cl_is_cpool_inited(
- IN const cl_cpool_t* const p_pool )
+static inline boolean_t cl_is_cpool_inited(IN const cl_cpool_t * const p_pool)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_pool );
- return( cl_is_qcpool_inited( &p_pool->qcpool ) );
+ CL_ASSERT(p_pool);
+ return (cl_is_qcpool_inited(&p_pool->qcpool));
}
+
/*
* PARAMETERS
* p_pool
@@ -316,16 +306,15 @@ cl_is_cpool_inited(
* SYNOPSIS
*/
cl_status_t
-cl_cpool_init(
- IN cl_cpool_t* const p_pool,
- IN const size_t min_size,
- IN const size_t max_size,
- IN const size_t grow_size,
- IN size_t* const component_sizes,
- IN const uint32_t num_components,
- IN cl_pfn_cpool_init_t pfn_initializer OPTIONAL,
- IN cl_pfn_cpool_dtor_t pfn_destructor OPTIONAL,
- IN const void* const context );
+cl_cpool_init(IN cl_cpool_t * const p_pool,
+ IN const size_t min_size,
+ IN const size_t max_size,
+ IN const size_t grow_size,
+ IN size_t * const component_sizes,
+ IN const uint32_t num_components,
+ IN cl_pfn_cpool_init_t pfn_initializer OPTIONAL,
+ IN cl_pfn_cpool_dtor_t pfn_destructor OPTIONAL,
+ IN const void *const context);
/*
* PARAMETERS
* p_pool
@@ -401,14 +390,13 @@ cl_cpool_init(
*
* SYNOPSIS
*/
-static inline void
-cl_cpool_destroy(
- IN cl_cpool_t* const p_pool )
+static inline void cl_cpool_destroy(IN cl_cpool_t * const p_pool)
{
- CL_ASSERT( p_pool );
+ CL_ASSERT(p_pool);
- cl_qcpool_destroy( &p_pool->qcpool );
+ cl_qcpool_destroy(&p_pool->qcpool);
}
+
/*
* PARAMETERS
* p_pool
@@ -442,13 +430,12 @@ cl_cpool_destroy(
*
* SYNOPSIS
*/
-static inline size_t
-cl_cpool_count(
- IN cl_cpool_t* const p_pool )
+static inline size_t cl_cpool_count(IN cl_cpool_t * const p_pool)
{
- CL_ASSERT( p_pool );
- return( cl_qcpool_count( &p_pool->qcpool ) );
+ CL_ASSERT(p_pool);
+ return (cl_qcpool_count(&p_pool->qcpool));
}
+
/*
* PARAMETERS
* p_pool
@@ -473,21 +460,20 @@ cl_cpool_count(
*
* SYNOPSIS
*/
-static inline void*
-cl_cpool_get(
- IN cl_cpool_t* const p_pool )
+static inline void *cl_cpool_get(IN cl_cpool_t * const p_pool)
{
- cl_pool_obj_t *p_pool_obj;
+ cl_pool_obj_t *p_pool_obj;
- CL_ASSERT( p_pool );
+ CL_ASSERT(p_pool);
- p_pool_obj = (cl_pool_obj_t*)cl_qcpool_get( &p_pool->qcpool );
- if( !p_pool_obj )
- return( NULL );
+ p_pool_obj = (cl_pool_obj_t *) cl_qcpool_get(&p_pool->qcpool);
+ if (!p_pool_obj)
+ return (NULL);
- CL_ASSERT( p_pool_obj->p_object );
- return( (void*)p_pool_obj->p_object );
+ CL_ASSERT(p_pool_obj->p_object);
+ return ((void *)p_pool_obj->p_object);
}
+
/*
* PARAMETERS
* p_pool
@@ -519,24 +505,23 @@ cl_cpool_get(
* SYNOPSIS
*/
static inline void
-cl_cpool_put(
- IN cl_cpool_t* const p_pool,
- IN void* const p_object )
+cl_cpool_put(IN cl_cpool_t * const p_pool, IN void *const p_object)
{
- cl_pool_obj_t *p_pool_obj;
+ cl_pool_obj_t *p_pool_obj;
- CL_ASSERT( p_pool );
- CL_ASSERT( p_object );
+ CL_ASSERT(p_pool);
+ CL_ASSERT(p_object);
/* Calculate the offset to the list object representing this object. */
- p_pool_obj = (cl_pool_obj_t*)
- (((uint8_t*)p_object) - sizeof(cl_pool_obj_t));
+ p_pool_obj = (cl_pool_obj_t *)
+ (((uint8_t *) p_object) - sizeof(cl_pool_obj_t));
/* good sanity check */
- CL_ASSERT( p_pool_obj->p_object == p_object );
+ CL_ASSERT(p_pool_obj->p_object == p_object);
- cl_qcpool_put( &p_pool->qcpool, &p_pool_obj->pool_item );
+ cl_qcpool_put(&p_pool->qcpool, &p_pool_obj->pool_item);
}
+
/*
* PARAMETERS
* p_pool
@@ -570,13 +555,12 @@ cl_cpool_put(
* SYNOPSIS
*/
static inline cl_status_t
-cl_cpool_grow(
- IN cl_cpool_t* const p_pool,
- IN const uint32_t obj_count )
+cl_cpool_grow(IN cl_cpool_t * const p_pool, IN const uint32_t obj_count)
{
- CL_ASSERT( p_pool );
- return( cl_qcpool_grow( &p_pool->qcpool, obj_count ) );
+ CL_ASSERT(p_pool);
+ return (cl_qcpool_grow(&p_pool->qcpool, obj_count));
}
+
/*
* PARAMETERS
* p_pool
@@ -604,5 +588,4 @@ cl_cpool_grow(
*********/
END_C_DECLS
-
-#endif /* _CL_COMP_POOL_H_ */
+#endif /* _CL_COMP_POOL_H_ */
diff --git a/opensm/include/complib/cl_debug.h b/opensm/include/complib/cl_debug.h
index a394cb1..fbca7bd 100644
--- a/opensm/include/complib/cl_debug.h
+++ b/opensm/include/complib/cl_debug.h
@@ -51,13 +51,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Debug Output
* NAME
* Debug Output
@@ -66,7 +65,6 @@ BEGIN_C_DECLS
* The debug output functions and macros send debug messages to the current
* debug target.
*********/
-
/****f* Component Library: Debug Output/cl_break
* NAME
* cl_break
@@ -84,7 +82,6 @@ BEGIN_C_DECLS
* NOTES
* In a release build, cl_break has no effect.
*********/
-
/****f* Component Library: Debug Output/cl_is_debug
* NAME
* cl_is_debug
@@ -95,8 +92,7 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-boolean_t
-cl_is_debug(void);
+boolean_t cl_is_debug(void);
/*
* PARAMETERS
* None
@@ -120,10 +116,7 @@ cl_is_debug(void);
*
* SYNOPSIS
*/
-void
-cl_dbg_out(
- IN const char* const debug_message,
- IN ... );
+void cl_dbg_out(IN const char *const debug_message, IN ...);
/*
* PARAMETERS
* debug_message
@@ -149,14 +142,11 @@ cl_dbg_out(
*********/
#endif
#else
-static inline void
-cl_dbg_out(
- IN const char* const debug_message,
- IN ... )
+static inline void cl_dbg_out(IN const char *const debug_message, IN ...)
{
- UNUSED_PARAM( debug_message );
+ UNUSED_PARAM(debug_message);
}
-#endif /* defined( _DEBUG_ ) */
+#endif /* defined( _DEBUG_ ) */
#ifndef cl_msg_out
/****f* Component Library: Debug Output/cl_msg_out
@@ -168,10 +158,7 @@ cl_dbg_out(
*
* SYNOPSIS
*/
-void
-cl_msg_out(
- IN const char* const message,
- IN ... );
+void cl_msg_out(IN const char *const message, IN ...);
/*
* PARAMETERS
* message
@@ -559,7 +546,7 @@ CL_PRINT( DBG_LVL, CHK_LVL, STRING ); \
CL_TRACE( DBG_LVL, CHK_LVL, STRING ); \
CL_EXIT( DBG_LVL, CHK_LVL );
-#else /* defined(_DEBUG_) */
+#else /* defined(_DEBUG_) */
/* Define as NULL macros in a free build. */
#define CL_PRINT( DBG_LVL, CHK_LVL, STRING );
@@ -568,7 +555,7 @@ CL_PRINT( DBG_LVL, CHK_LVL, STRING ); \
#define CL_TRACE( DBG_LVL, CHK_LVL, STRING );
#define CL_TRACE_EXIT( DBG_LVL, CHK_LVL, STRING );
-#endif /* defined(_DEBUG_) */
+#endif /* defined(_DEBUG_) */
/****d* Component Library: Debug Output/64-bit Print Format
* NAME
@@ -604,12 +591,9 @@ CL_PRINT( DBG_LVL, CHK_LVL, STRING ); \
* The above keywords are strings and make use of compilers' string
* concatenation ability.
*********/
-void
-complib_init( void );
+void complib_init(void);
-void
-complib_exit( void );
+void complib_exit(void);
END_C_DECLS
-
-#endif /* _CL_DEBUG_H_ */
+#endif /* _CL_DEBUG_H_ */
diff --git a/opensm/include/complib/cl_debug_osd.h b/opensm/include/complib/cl_debug_osd.h
index dd3498f..4d7554b 100644
--- a/opensm/include/complib/cl_debug_osd.h
+++ b/opensm/include/complib/cl_debug_osd.h
@@ -52,20 +52,18 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
#if !defined(__MODULE__)
#define __MODULE__ ""
#define __MOD_DELIMITER__ ""
-#else /* !defined(__MODULE__) */
+#else /* !defined(__MODULE__) */
#define __MOD_DELIMITER__ ":"
-#endif /* !defined(__MODULE__) */
-
+#endif /* !defined(__MODULE__) */
/*
* Define specifiers for print functions based on the platform
*/
@@ -74,36 +72,26 @@ BEGIN_C_DECLS
#else
#define PRIdSIZE_T "d"
#endif
-
#include <inttypes.h>
#include <stdio.h>
-
#define cl_msg_out printf
-
#if defined( _DEBUG_ )
#define cl_dbg_out printf
#else
#define cl_dbg_out foo
-#endif /* _DEBUG_ */
-
+#endif /* _DEBUG_ */
/*
* The following macros are used internally by the CL_ENTER, CL_TRACE,
* CL_TRACE_EXIT, and CL_EXIT macros.
*/
#define _CL_DBG_ENTER \
("%s%s%s() [\n", __MODULE__, __MOD_DELIMITER__, __func__)
-
#define _CL_DBG_EXIT \
("%s%s%s() ]\n", __MODULE__, __MOD_DELIMITER__, __func__)
-
#define _CL_DBG_INFO \
("%s%s%s(): ", __MODULE__, __MOD_DELIMITER__, __func__)
-
#define _CL_DBG_ERROR \
("%s%s%s() !ERROR!: ", __MODULE__, __MOD_DELIMITER__, __func__)
-
#define CL_CHK_STK
-
-END_C_DECLS
-
-#endif /* _CL_DEBUG_OSD_H_ */
+ END_C_DECLS
+#endif /* _CL_DEBUG_OSD_H_ */
diff --git a/opensm/include/complib/cl_dispatcher.h b/opensm/include/complib/cl_dispatcher.h
index ff8e397..70ba4d4 100644
--- a/opensm/include/complib/cl_dispatcher.h
+++ b/opensm/include/complib/cl_dispatcher.h
@@ -56,13 +56,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Dispatcher
* NAME
* Dispatcher
@@ -85,7 +84,6 @@ BEGIN_C_DECLS
* Manipulation:
* cl_disp_post, cl_disp_reset, cl_disp_wait_on
*********/
-
/****s* Component Library: Dispatcher/cl_disp_msgid_t
* NAME
* cl_disp_msgid_t
@@ -141,9 +139,7 @@ typedef uint32_t cl_disp_msgid_t;
* SYNOPSIS
*/
typedef void
-(*cl_pfn_msgrcv_cb_t)(
- IN void* context,
- IN void* p_data );
+ (*cl_pfn_msgrcv_cb_t) (IN void *context, IN void *p_data);
/*
* PARAMETERS
* context
@@ -181,9 +177,7 @@ typedef void
* SYNOPSIS
*/
typedef void
-(*cl_pfn_msgdone_cb_t)(
- IN void* context,
- IN void* p_data );
+ (*cl_pfn_msgdone_cb_t) (IN void *context, IN void *p_data);
/*
* PARAMETERS
* context
@@ -220,15 +214,14 @@ typedef void
*
* SYNOPSIS
*/
-typedef struct _cl_dispatcher
-{
- cl_spinlock_t lock;
- cl_ptr_vector_t reg_vec;
- cl_qlist_t reg_list;
- cl_thread_pool_t worker_threads;
- cl_qlist_t msg_fifo;
- cl_qpool_t msg_pool;
- uint64_t last_msg_queue_time_us;
+typedef struct _cl_dispatcher {
+ cl_spinlock_t lock;
+ cl_ptr_vector_t reg_vec;
+ cl_qlist_t reg_list;
+ cl_thread_pool_t worker_threads;
+ cl_qlist_t msg_fifo;
+ cl_qpool_t msg_pool;
+ uint64_t last_msg_queue_time_us;
} cl_dispatcher_t;
/*
* FIELDS
@@ -274,14 +267,13 @@ typedef struct _cl_dispatcher
*
* SYNOPSIS
*/
-typedef struct _cl_disp_reg_info
-{
- cl_list_item_t list_item;
- cl_pfn_msgrcv_cb_t pfn_rcv_callback;
- const void *context;
- atomic32_t ref_cnt;
- cl_disp_msgid_t msg_id;
- cl_dispatcher_t *p_disp;
+typedef struct _cl_disp_reg_info {
+ cl_list_item_t list_item;
+ cl_pfn_msgrcv_cb_t pfn_rcv_callback;
+ const void *context;
+ atomic32_t ref_cnt;
+ cl_disp_msgid_t msg_id;
+ cl_dispatcher_t *p_disp;
} cl_disp_reg_info_t;
/*
@@ -325,15 +317,14 @@ typedef struct _cl_disp_reg_info
*
* SYNOPSIS
*/
-typedef struct _cl_disp_msg
-{
- cl_pool_item_t item;
- const void *p_data;
- cl_disp_reg_info_t *p_src_reg;
- cl_disp_reg_info_t *p_dest_reg;
- cl_pfn_msgdone_cb_t pfn_xmt_callback;
- uint64_t in_time;
- const void *context;
+typedef struct _cl_disp_msg {
+ cl_pool_item_t item;
+ const void *p_data;
+ cl_disp_reg_info_t *p_src_reg;
+ cl_disp_reg_info_t *p_dest_reg;
+ cl_pfn_msgdone_cb_t pfn_xmt_callback;
+ uint64_t in_time;
+ const void *context;
} cl_disp_msg_t;
/*
* FIELDS
@@ -384,9 +375,7 @@ typedef const struct _cl_disp_reg_info *cl_disp_reg_handle_t;
*
* SYNOPSIS
*/
-void
-cl_disp_construct(
- IN cl_dispatcher_t* const p_disp );
+void cl_disp_construct(IN cl_dispatcher_t * const p_disp);
/*
* PARAMETERS
* p_disp
@@ -412,10 +401,8 @@ cl_disp_construct(
* SYNOPSIS
*/
cl_status_t
-cl_disp_init(
- IN cl_dispatcher_t* const p_disp,
- IN const uint32_t thread_count,
- IN const char* const name );
+cl_disp_init(IN cl_dispatcher_t * const p_disp,
+ IN const uint32_t thread_count, IN const char *const name);
/*
* PARAMETERS
* p_disp
@@ -452,9 +439,7 @@ cl_disp_init(
*
* SYNOPSIS
*/
-void
-cl_disp_shutdown(
- IN cl_dispatcher_t* const p_disp );
+void cl_disp_shutdown(IN cl_dispatcher_t * const p_disp);
/*
* PARAMETERS
* p_disp
@@ -481,9 +466,7 @@ cl_disp_shutdown(
*
* SYNOPSIS
*/
-void
-cl_disp_destroy(
- IN cl_dispatcher_t* const p_disp );
+void cl_disp_destroy(IN cl_dispatcher_t * const p_disp);
/*
* PARAMETERS
* p_disp
@@ -506,11 +489,10 @@ cl_disp_destroy(
* SYNOPSIS
*/
cl_disp_reg_handle_t
-cl_disp_register(
- IN cl_dispatcher_t* const p_disp,
- IN const cl_disp_msgid_t msg_id,
- IN cl_pfn_msgrcv_cb_t pfn_callback OPTIONAL,
- IN const void* const context );
+cl_disp_register(IN cl_dispatcher_t * const p_disp,
+ IN const cl_disp_msgid_t msg_id,
+ IN cl_pfn_msgrcv_cb_t pfn_callback OPTIONAL,
+ IN const void *const context);
/*
* PARAMETERS
* p_disp
@@ -550,9 +532,7 @@ cl_disp_register(
*
* SYNOPSIS
*/
-void
-cl_disp_unregister(
- IN const cl_disp_reg_handle_t handle );
+void cl_disp_unregister(IN const cl_disp_reg_handle_t handle);
/*
* PARAMETERS
* handle
@@ -580,12 +560,11 @@ cl_disp_unregister(
* SYNOPSIS
*/
cl_status_t
-cl_disp_post(
- IN const cl_disp_reg_handle_t handle,
- IN const cl_disp_msgid_t msg_id,
- IN const void* const p_data,
- IN cl_pfn_msgdone_cb_t pfn_callback OPTIONAL,
- IN const void* const context );
+cl_disp_post(IN const cl_disp_reg_handle_t handle,
+ IN const cl_disp_msgid_t msg_id,
+ IN const void *const p_data,
+ IN cl_pfn_msgdone_cb_t pfn_callback OPTIONAL,
+ IN const void *const context);
/*
* PARAMETERS
* handle
@@ -629,10 +608,9 @@ cl_disp_post(
* SYNOPSIS
*/
void
-cl_disp_get_queue_status(
- IN const cl_disp_reg_handle_t handle,
- OUT uint32_t *p_num_queued_msgs,
- OUT uint64_t *p_last_msg_queue_time_ms);
+cl_disp_get_queue_status(IN const cl_disp_reg_handle_t handle,
+ OUT uint32_t * p_num_queued_msgs,
+ OUT uint64_t * p_last_msg_queue_time_ms);
/*
* PARAMETERS
* handle
@@ -656,5 +634,4 @@ cl_disp_get_queue_status(
*********/
END_C_DECLS
-
-#endif /* !defined(_CL_DISPATCHER_H_) */
+#endif /* !defined(_CL_DISPATCHER_H_) */
diff --git a/opensm/include/complib/cl_event.h b/opensm/include/complib/cl_event.h
index e379da2..ae9c123 100644
--- a/opensm/include/complib/cl_event.h
+++ b/opensm/include/complib/cl_event.h
@@ -54,13 +54,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Event
* NAME
* Event
@@ -82,7 +81,6 @@ BEGIN_C_DECLS
* Manipulation:
* cl_event_signal, cl_event_reset, cl_event_wait_on
*********/
-
/****f* Component Library: Event/cl_event_construct
* NAME
* cl_event_construct
@@ -92,9 +90,7 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-void
-cl_event_construct(
- IN cl_event_t* const p_event );
+void cl_event_construct(IN cl_event_t * const p_event);
/*
* PARAMETERS
* p_event
@@ -123,9 +119,7 @@ cl_event_construct(
* SYNOPSIS
*/
cl_status_t
-cl_event_init(
- IN cl_event_t* const p_event,
- IN const boolean_t manual_reset );
+cl_event_init(IN cl_event_t * const p_event, IN const boolean_t manual_reset);
/*
* PARAMETERS
* p_event
@@ -161,9 +155,7 @@ cl_event_init(
*
* SYNOPSIS
*/
-void
-cl_event_destroy(
- IN cl_event_t* const p_event );
+void cl_event_destroy(IN cl_event_t * const p_event);
/*
* PARAMETERS
@@ -191,9 +183,7 @@ cl_event_destroy(
*
* SYNOPSIS
*/
-cl_status_t
-cl_event_signal(
- IN cl_event_t* const p_event );
+cl_status_t cl_event_signal(IN cl_event_t * const p_event);
/*
* PARAMETERS
* p_event
@@ -226,9 +216,7 @@ cl_event_signal(
*
* SYNOPSIS
*/
-cl_status_t
-cl_event_reset(
- IN cl_event_t* const p_event );
+cl_status_t cl_event_reset(IN cl_event_t * const p_event);
/*
* PARAMETERS
* p_event
@@ -254,10 +242,8 @@ cl_event_reset(
* SYNOPSIS
*/
cl_status_t
-cl_event_wait_on(
- IN cl_event_t* const p_event,
- IN const uint32_t wait_us,
- IN const boolean_t interruptible );
+cl_event_wait_on(IN cl_event_t * const p_event,
+ IN const uint32_t wait_us, IN const boolean_t interruptible);
/*
* PARAMETERS
* p_event
@@ -295,5 +281,4 @@ cl_event_wait_on(
*********/
END_C_DECLS
-
-#endif /* _CL_EVENT_H_ */
+#endif /* _CL_EVENT_H_ */
diff --git a/opensm/include/complib/cl_event_osd.h b/opensm/include/complib/cl_event_osd.h
index 5c10be2..1b8d777 100644
--- a/opensm/include/complib/cl_event_osd.h
+++ b/opensm/include/complib/cl_event_osd.h
@@ -52,29 +52,25 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
-#include <pthread.h> /* usr/include */
-
+#include <pthread.h> /* usr/include */
/*
* Linux user mode specific data structure for the event object.
* Users should not access these variables directly.
*/
-typedef struct _cl_event_t
-{
- pthread_cond_t condvar;
- boolean_t signaled;
- boolean_t manual_reset;
- cl_spinlock_t spinlock;
- cl_state_t state;
+ typedef struct _cl_event_t {
+ pthread_cond_t condvar;
+ boolean_t signaled;
+ boolean_t manual_reset;
+ cl_spinlock_t spinlock;
+ cl_state_t state;
} cl_event_t;
END_C_DECLS
-
-#endif /* _CL_EVENT_OSD_H_ */
+#endif /* _CL_EVENT_OSD_H_ */
diff --git a/opensm/include/complib/cl_event_wheel.h b/opensm/include/complib/cl_event_wheel.h
index b8bca05..056ce99 100644
--- a/opensm/include/complib/cl_event_wheel.h
+++ b/opensm/include/complib/cl_event_wheel.h
@@ -56,13 +56,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Event_Wheel
* NAME
* Event_Wheel
@@ -86,7 +85,6 @@ BEGIN_C_DECLS
* cl_event_wheel_reg, cl_event_wheel_unreg
*
*********/
-
/****f* Component Library: Event_Wheel/cl_pfn_event_aged_cb_t
* NAME
* cl_pfn_event_aged_cb_t
@@ -99,10 +97,8 @@ BEGIN_C_DECLS
* SYNOPSIS
*/
typedef uint64_t
-(*cl_pfn_event_aged_cb_t)(
- IN uint64_t key,
- IN uint32_t num_regs,
- IN void* context);
+ (*cl_pfn_event_aged_cb_t) (IN uint64_t key,
+ IN uint32_t num_regs, IN void *context);
/*
* PARAMETERS
* key
@@ -144,16 +140,15 @@ typedef uint64_t
*
* SYNOPSIS
*/
-typedef struct _cl_event_wheel
-{
- cl_spinlock_t lock;
- cl_spinlock_t *p_external_lock;
+typedef struct _cl_event_wheel {
+ cl_spinlock_t lock;
+ cl_spinlock_t *p_external_lock;
- cl_qmap_t events_map;
- boolean_t closing;
- cl_qlist_t events_wheel;
- cl_timer_t timer;
- osm_log_t *p_log;
+ cl_qmap_t events_map;
+ boolean_t closing;
+ cl_qlist_t events_wheel;
+ cl_timer_t timer;
+ osm_log_t *p_log;
} cl_event_wheel_t;
/*
* FIELDS
@@ -196,16 +191,15 @@ typedef struct _cl_event_wheel
*
* SYNOPSIS
*/
-typedef struct _cl_event_wheel_reg_info
-{
- cl_map_item_t map_item;
- cl_list_item_t list_item;
- uint64_t key;
- cl_pfn_event_aged_cb_t pfn_aged_callback;
- uint64_t aging_time;
- uint32_t num_regs;
- void *context;
- cl_event_wheel_t *p_event_wheel;
+typedef struct _cl_event_wheel_reg_info {
+ cl_map_item_t map_item;
+ cl_list_item_t list_item;
+ uint64_t key;
+ cl_pfn_event_aged_cb_t pfn_aged_callback;
+ uint64_t aging_time;
+ uint32_t num_regs;
+ void *context;
+ cl_event_wheel_t *p_event_wheel;
} cl_event_wheel_reg_info_t;
/*
* FIELDS
@@ -245,9 +239,7 @@ typedef struct _cl_event_wheel_reg_info
*
* SYNOPSIS
*/
-void
-cl_event_wheel_construct(
- IN cl_event_wheel_t* const p_event_wheel );
+void cl_event_wheel_construct(IN cl_event_wheel_t * const p_event_wheel);
/*
* PARAMETERS
* p_event_wheel
@@ -273,9 +265,8 @@ cl_event_wheel_construct(
* SYNOPSIS
*/
cl_status_t
-cl_event_wheel_init(
- IN cl_event_wheel_t* const p_event_wheel,
- IN osm_log_t *p_log);
+cl_event_wheel_init(IN cl_event_wheel_t * const p_event_wheel,
+ IN osm_log_t * p_log);
/*
* PARAMETERS
@@ -303,10 +294,9 @@ cl_event_wheel_init(
* SYNOPSIS
*/
cl_status_t
-cl_event_wheel_init_ex(
- IN cl_event_wheel_t* const p_event_wheel,
- IN osm_log_t *p_log,
- IN cl_spinlock_t *p_external_lock);
+cl_event_wheel_init_ex(IN cl_event_wheel_t * const p_event_wheel,
+ IN osm_log_t * p_log,
+ IN cl_spinlock_t * p_external_lock);
/*
* PARAMETERS
@@ -337,9 +327,7 @@ cl_event_wheel_init_ex(
*
* SYNOPSIS
*/
-void
-cl_event_wheel_destroy(
- IN cl_event_wheel_t* const p_event_wheel );
+void cl_event_wheel_destroy(IN cl_event_wheel_t * const p_event_wheel);
/*
* PARAMETERS
* p_event_wheel
@@ -365,9 +353,7 @@ cl_event_wheel_destroy(
*
* SYNOPSIS
*/
-void
-cl_event_wheel_dump(
- IN cl_event_wheel_t* const p_event_wheel );
+void cl_event_wheel_dump(IN cl_event_wheel_t * const p_event_wheel);
/*
* PARAMETERS
* p_event_wheel
@@ -394,12 +380,11 @@ cl_event_wheel_dump(
* SYNOPSIS
*/
cl_status_t
-cl_event_wheel_reg(
- IN cl_event_wheel_t* const p_event_wheel,
- IN const uint64_t key,
- IN const uint64_t aging_time_usec,
- IN cl_pfn_event_aged_cb_t pfn_callback,
- IN void* const context );
+cl_event_wheel_reg(IN cl_event_wheel_t * const p_event_wheel,
+ IN const uint64_t key,
+ IN const uint64_t aging_time_usec,
+ IN cl_pfn_event_aged_cb_t pfn_callback,
+ IN void *const context);
/*
* PARAMETERS
* p_event_wheel
@@ -436,9 +421,8 @@ cl_event_wheel_reg(
* SYNOPSIS
*/
void
-cl_event_wheel_unreg(
- IN cl_event_wheel_t* const p_event_wheel,
- IN uint64_t key );
+cl_event_wheel_unreg(IN cl_event_wheel_t * const p_event_wheel,
+ IN uint64_t key);
/*
* PARAMETERS
* p_event_wheel
@@ -469,9 +453,8 @@ cl_event_wheel_unreg(
* SYNOPSIS
*/
uint32_t
-cl_event_wheel_num_regs(
- IN cl_event_wheel_t* const p_event_wheel,
- IN uint64_t key );
+cl_event_wheel_num_regs(IN cl_event_wheel_t * const p_event_wheel,
+ IN uint64_t key);
/*
* PARAMETERS
* p_event_wheel
@@ -489,5 +472,4 @@ cl_event_wheel_num_regs(
*********/
END_C_DECLS
-
-#endif /* !defined(_CL_EVENT_WHEEL_H_) */
+#endif /* !defined(_CL_EVENT_WHEEL_H_) */
diff --git a/opensm/include/complib/cl_fleximap.h b/opensm/include/complib/cl_fleximap.h
index 72e2de2..d98c7fd 100644
--- a/opensm/include/complib/cl_fleximap.h
+++ b/opensm/include/complib/cl_fleximap.h
@@ -52,13 +52,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Flexi Map
* NAME
* Flexi Map
@@ -109,7 +108,6 @@ BEGIN_C_DECLS
* Attributes:
* cl_fmap_count, cl_is_fmap_empty,
*********/
-
/****s* Component Library: Flexi Map/cl_fmap_item_t
* NAME
* cl_fmap_item_t
@@ -122,17 +120,16 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-typedef struct _cl_fmap_item
-{
+ typedef struct _cl_fmap_item {
/* Must be first to allow casting. */
- cl_pool_item_t pool_item;
- struct _cl_fmap_item *p_left;
- struct _cl_fmap_item *p_right;
- struct _cl_fmap_item *p_up;
- cl_map_color_t color;
- const void *p_key;
+ cl_pool_item_t pool_item;
+ struct _cl_fmap_item *p_left;
+ struct _cl_fmap_item *p_right;
+ struct _cl_fmap_item *p_up;
+ cl_map_color_t color;
+ const void *p_key;
#ifdef _DEBUG_
- struct _cl_fmap *p_map;
+ struct _cl_fmap *p_map;
#endif
} cl_fmap_item_t;
@@ -191,9 +188,8 @@ typedef struct _cl_fmap_item
* SYNOPSIS
*/
typedef intn_t
-(*cl_pfn_fmap_cmp_t)(
- IN const void* const p_key1,
- IN const void* const p_key2 );
+ (*cl_pfn_fmap_cmp_t) (IN const void *const p_key1,
+ IN const void *const p_key2);
/*
* PARAMETERS
* p_key1
@@ -227,13 +223,12 @@ typedef intn_t
*
* SYNOPSIS
*/
-typedef struct _cl_fmap
-{
- cl_fmap_item_t root;
- cl_fmap_item_t nil;
- cl_state_t state;
- size_t count;
- cl_pfn_fmap_cmp_t pfn_compare;
+typedef struct _cl_fmap {
+ cl_fmap_item_t root;
+ cl_fmap_item_t nil;
+ cl_state_t state;
+ size_t count;
+ cl_pfn_fmap_cmp_t pfn_compare;
} cl_fmap_t;
/*
@@ -273,9 +268,8 @@ typedef struct _cl_fmap
* SYNOPSIS
*/
typedef void
-(*cl_pfn_fmap_apply_t)(
- IN cl_fmap_item_t* const p_map_item,
- IN void* context );
+ (*cl_pfn_fmap_apply_t) (IN cl_fmap_item_t * const p_map_item,
+ IN void *context);
/*
* PARAMETERS
* p_map_item
@@ -306,14 +300,13 @@ typedef void
*
* SYNOPSIS
*/
-static inline size_t
-cl_fmap_count(
- IN const cl_fmap_t* const p_map )
+static inline size_t cl_fmap_count(IN const cl_fmap_t * const p_map)
{
- CL_ASSERT( p_map );
- CL_ASSERT( p_map->state == CL_INITIALIZED );
- return( p_map->count );
+ CL_ASSERT(p_map);
+ CL_ASSERT(p_map->state == CL_INITIALIZED);
+ return (p_map->count);
}
+
/*
* PARAMETERS
* p_map
@@ -335,15 +328,14 @@ cl_fmap_count(
*
* SYNOPSIS
*/
-static inline boolean_t
-cl_is_fmap_empty(
- IN const cl_fmap_t* const p_map )
+static inline boolean_t cl_is_fmap_empty(IN const cl_fmap_t * const p_map)
{
- CL_ASSERT( p_map );
- CL_ASSERT( p_map->state == CL_INITIALIZED );
+ CL_ASSERT(p_map);
+ CL_ASSERT(p_map->state == CL_INITIALIZED);
- return( p_map->count == 0 );
+ return (p_map->count == 0);
}
+
/*
* PARAMETERS
* p_map
@@ -367,13 +359,12 @@ cl_is_fmap_empty(
*
* SYNOPSIS
*/
-static inline const void*
-cl_fmap_key(
- IN const cl_fmap_item_t* const p_item )
+static inline const void *cl_fmap_key(IN const cl_fmap_item_t * const p_item)
{
- CL_ASSERT( p_item );
- return( p_item->p_key );
+ CL_ASSERT(p_item);
+ return (p_item->p_key);
}
+
/*
* PARAMETERS
* p_item
@@ -399,10 +390,7 @@ cl_fmap_key(
*
* SYNOPSIS
*/
-void
-cl_fmap_init(
- IN cl_fmap_t* const p_map,
- IN cl_pfn_fmap_cmp_t pfn_compare );
+void cl_fmap_init(IN cl_fmap_t * const p_map, IN cl_pfn_fmap_cmp_t pfn_compare);
/*
* PARAMETERS
* p_map
@@ -432,15 +420,15 @@ cl_fmap_init(
*
* SYNOPSIS
*/
-static inline const cl_fmap_item_t*
-cl_fmap_end(
- IN const cl_fmap_t* const p_map )
+static inline const cl_fmap_item_t *cl_fmap_end(IN const cl_fmap_t *
+ const p_map)
{
- CL_ASSERT( p_map );
- CL_ASSERT( p_map->state == CL_INITIALIZED );
+ CL_ASSERT(p_map);
+ CL_ASSERT(p_map->state == CL_INITIALIZED);
/* Nil is the end of the map. */
- return( &p_map->nil );
+ return (&p_map->nil);
}
+
/*
* PARAMETERS
* p_map
@@ -471,14 +459,13 @@ cl_fmap_end(
*
* SYNOPSIS
*/
-static inline cl_fmap_item_t*
-cl_fmap_head(
- IN const cl_fmap_t* const p_map )
+static inline cl_fmap_item_t *cl_fmap_head(IN const cl_fmap_t * const p_map)
{
- CL_ASSERT( p_map );
- CL_ASSERT( p_map->state == CL_INITIALIZED );
- return( (cl_fmap_item_t*)p_map->nil.pool_item.list_item.p_next );
+ CL_ASSERT(p_map);
+ CL_ASSERT(p_map->state == CL_INITIALIZED);
+ return ((cl_fmap_item_t *) p_map->nil.pool_item.list_item.p_next);
}
+
/*
* PARAMETERS
* p_map
@@ -508,14 +495,13 @@ cl_fmap_head(
*
* SYNOPSIS
*/
-static inline cl_fmap_item_t*
-cl_fmap_tail(
- IN const cl_fmap_t* const p_map )
+static inline cl_fmap_item_t *cl_fmap_tail(IN const cl_fmap_t * const p_map)
{
- CL_ASSERT( p_map );
- CL_ASSERT( p_map->state == CL_INITIALIZED );
- return( (cl_fmap_item_t*)p_map->nil.pool_item.list_item.p_prev );
+ CL_ASSERT(p_map);
+ CL_ASSERT(p_map->state == CL_INITIALIZED);
+ return ((cl_fmap_item_t *) p_map->nil.pool_item.list_item.p_prev);
}
+
/*
* PARAMETERS
* p_map
@@ -545,13 +531,13 @@ cl_fmap_tail(
*
* SYNOPSIS
*/
-static inline cl_fmap_item_t*
-cl_fmap_next(
- IN const cl_fmap_item_t* const p_item )
+static inline cl_fmap_item_t *cl_fmap_next(IN const cl_fmap_item_t *
+ const p_item)
{
- CL_ASSERT( p_item );
- return( (cl_fmap_item_t*)p_item->pool_item.list_item.p_next );
+ CL_ASSERT(p_item);
+ return ((cl_fmap_item_t *) p_item->pool_item.list_item.p_next);
}
+
/*
* PARAMETERS
* p_item
@@ -578,13 +564,13 @@ cl_fmap_next(
*
* SYNOPSIS
*/
-static inline cl_fmap_item_t*
-cl_fmap_prev(
- IN const cl_fmap_item_t* const p_item )
+static inline cl_fmap_item_t *cl_fmap_prev(IN const cl_fmap_item_t *
+ const p_item)
{
- CL_ASSERT( p_item );
- return( (cl_fmap_item_t*)p_item->pool_item.list_item.p_prev );
+ CL_ASSERT(p_item);
+ return ((cl_fmap_item_t *) p_item->pool_item.list_item.p_prev);
}
+
/*
* PARAMETERS
* p_item
@@ -610,11 +596,9 @@ cl_fmap_prev(
*
* SYNOPSIS
*/
-cl_fmap_item_t*
-cl_fmap_insert(
- IN cl_fmap_t* const p_map,
- IN const void* const p_key,
- IN cl_fmap_item_t* const p_item );
+cl_fmap_item_t *cl_fmap_insert(IN cl_fmap_t * const p_map,
+ IN const void *const p_key,
+ IN cl_fmap_item_t * const p_item);
/*
* PARAMETERS
* p_map
@@ -651,10 +635,8 @@ cl_fmap_insert(
*
* SYNOPSIS
*/
-cl_fmap_item_t*
-cl_fmap_get(
- IN const cl_fmap_t* const p_map,
- IN const void* const p_key );
+cl_fmap_item_t *cl_fmap_get(IN const cl_fmap_t * const p_map,
+ IN const void *const p_key);
/*
* PARAMETERS
* p_map
@@ -687,10 +669,8 @@ cl_fmap_get(
*
* SYNOPSIS
*/
-cl_fmap_item_t*
-cl_fmap_get_next(
- IN const cl_fmap_t* const p_map,
- IN const void* const p_key );
+cl_fmap_item_t *cl_fmap_get_next(IN const cl_fmap_t * const p_map,
+ IN const void *const p_key);
/*
* PARAMETERS
* p_map
@@ -724,9 +704,8 @@ cl_fmap_get_next(
* SYNOPSIS
*/
void
-cl_fmap_remove_item(
- IN cl_fmap_t* const p_map,
- IN cl_fmap_item_t* const p_item );
+cl_fmap_remove_item(IN cl_fmap_t * const p_map,
+ IN cl_fmap_item_t * const p_item);
/*
* PARAMETERS
* p_item
@@ -755,10 +734,8 @@ cl_fmap_remove_item(
*
* SYNOPSIS
*/
-cl_fmap_item_t*
-cl_fmap_remove(
- IN cl_fmap_t* const p_map,
- IN const void* const p_key );
+cl_fmap_item_t *cl_fmap_remove(IN cl_fmap_t * const p_map,
+ IN const void *const p_key);
/*
* PARAMETERS
* p_map
@@ -789,18 +766,17 @@ cl_fmap_remove(
*
* SYNOPSIS
*/
-static inline void
-cl_fmap_remove_all(
- IN cl_fmap_t* const p_map )
+static inline void cl_fmap_remove_all(IN cl_fmap_t * const p_map)
{
- CL_ASSERT( p_map );
- CL_ASSERT( p_map->state == CL_INITIALIZED );
+ CL_ASSERT(p_map);
+ CL_ASSERT(p_map->state == CL_INITIALIZED);
p_map->root.p_left = &p_map->nil;
p_map->nil.pool_item.list_item.p_next = &p_map->nil.pool_item.list_item;
p_map->nil.pool_item.list_item.p_prev = &p_map->nil.pool_item.list_item;
p_map->count = 0;
}
+
/*
* PARAMETERS
* p_map
@@ -824,9 +800,8 @@ cl_fmap_remove_all(
* SYNOPSIS
*/
void
-cl_fmap_merge(
- OUT cl_fmap_t* const p_dest_map,
- IN OUT cl_fmap_t* const p_src_map );
+cl_fmap_merge(OUT cl_fmap_t * const p_dest_map,
+ IN OUT cl_fmap_t * const p_src_map);
/*
* PARAMETERS
* p_dest_map
@@ -859,11 +834,9 @@ cl_fmap_merge(
* SYNOPSIS
*/
void
-cl_fmap_delta(
- IN OUT cl_fmap_t* const p_map1,
- IN OUT cl_fmap_t* const p_map2,
- OUT cl_fmap_t* const p_new,
- OUT cl_fmap_t* const p_old );
+cl_fmap_delta(IN OUT cl_fmap_t * const p_map1,
+ IN OUT cl_fmap_t * const p_map2,
+ OUT cl_fmap_t * const p_new, OUT cl_fmap_t * const p_old);
/*
* PARAMETERS
* p_map1
@@ -910,10 +883,9 @@ cl_fmap_delta(
* SYNOPSIS
*/
void
-cl_fmap_apply_func(
- IN const cl_fmap_t* const p_map,
- IN cl_pfn_fmap_apply_t pfn_func,
- IN const void* const context );
+cl_fmap_apply_func(IN const cl_fmap_t * const p_map,
+ IN cl_pfn_fmap_apply_t pfn_func,
+ IN const void *const context);
/*
* PARAMETERS
* p_map
@@ -939,5 +911,4 @@ cl_fmap_apply_func(
*********/
END_C_DECLS
-
-#endif /* _CL_FLEXIMAP_H_ */
+#endif /* _CL_FLEXIMAP_H_ */
diff --git a/opensm/include/complib/cl_list.h b/opensm/include/complib/cl_list.h
index 1020e28..4b8cdfa 100644
--- a/opensm/include/complib/cl_list.h
+++ b/opensm/include/complib/cl_list.h
@@ -52,13 +52,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/List
* NAME
* List
@@ -109,7 +108,6 @@ BEGIN_C_DECLS
* Attributes:
* cl_list_count, cl_is_list_empty, cl_is_list_inited
*********/
-
/****s* Component Library: List/cl_list_t
* NAME
* cl_list_t
@@ -122,10 +120,9 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-typedef struct _cl_list
-{
- cl_qlist_t list;
- cl_qpool_t list_item_pool;
+ typedef struct _cl_list {
+ cl_qlist_t list;
+ cl_qpool_t list_item_pool;
} cl_list_t;
/*
@@ -170,9 +167,7 @@ typedef const cl_list_item_t *cl_list_iterator_t;
* SYNOPSIS
*/
typedef void
-(*cl_pfn_list_apply_t)(
- IN void* const p_object,
- IN void* context );
+ (*cl_pfn_list_apply_t) (IN void *const p_object, IN void *context);
/*
* PARAMETERS
* p_object
@@ -204,9 +199,7 @@ typedef void
* SYNOPSIS
*/
typedef cl_status_t
-(*cl_pfn_list_find_t)(
- IN const void* const p_object,
- IN void* context );
+ (*cl_pfn_list_find_t) (IN const void *const p_object, IN void *context);
/*
* PARAMETERS
* p_object
@@ -238,9 +231,7 @@ typedef cl_status_t
*
* SYNOPSIS
*/
-void
-cl_list_construct(
- IN cl_list_t* const p_list );
+void cl_list_construct(IN cl_list_t * const p_list);
/*
* PARAMETERS
* p_list
@@ -269,18 +260,17 @@ cl_list_construct(
*
* SYNOPSIS
*/
-static inline boolean_t
-cl_is_list_inited(
- IN const cl_list_t* const p_list )
+static inline boolean_t cl_is_list_inited(IN const cl_list_t * const p_list)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/*
* The pool is the last thing initialized. If it is initialized, the
* list is initialized too.
*/
- return( cl_is_qpool_inited( &p_list->list_item_pool ) );
+ return (cl_is_qpool_inited(&p_list->list_item_pool));
}
+
/*
* PARAMETERS
* p_list
@@ -310,9 +300,7 @@ cl_is_list_inited(
* SYNOPSIS
*/
cl_status_t
-cl_list_init(
- IN cl_list_t* const p_list,
- IN const size_t min_items );
+cl_list_init(IN cl_list_t * const p_list, IN const size_t min_items);
/*
* PARAMETERS
* p_list
@@ -346,9 +334,7 @@ cl_list_init(
*
* SYNOPSIS
*/
-void
-cl_list_destroy(
- IN cl_list_t* const p_list );
+void cl_list_destroy(IN cl_list_t * const p_list);
/*
* PARAMETERS
* p_list
@@ -380,14 +366,13 @@ cl_list_destroy(
*
* SYNOPSIS
*/
-static inline boolean_t
-cl_is_list_empty(
- IN const cl_list_t* const p_list )
+static inline boolean_t cl_is_list_empty(IN const cl_list_t * const p_list)
{
- CL_ASSERT( p_list );
- CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );
- return( cl_is_qlist_empty( &p_list->list ) );
+ CL_ASSERT(p_list);
+ CL_ASSERT(cl_is_qpool_inited(&p_list->list_item_pool));
+ return (cl_is_qlist_empty(&p_list->list));
}
+
/*
* PARAMETERS
* p_list
@@ -412,24 +397,23 @@ cl_is_list_empty(
* SYNOPSIS
*/
static inline cl_status_t
-cl_list_insert_head(
- IN cl_list_t* const p_list,
- IN const void* const p_object )
+cl_list_insert_head(IN cl_list_t * const p_list, IN const void *const p_object)
{
- cl_pool_obj_t *p_pool_obj;
+ cl_pool_obj_t *p_pool_obj;
- CL_ASSERT( p_list );
- CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );
+ CL_ASSERT(p_list);
+ CL_ASSERT(cl_is_qpool_inited(&p_list->list_item_pool));
/* Get a list item to add to the list. */
- p_pool_obj = (cl_pool_obj_t*)cl_qpool_get( &p_list->list_item_pool );
- if( !p_pool_obj )
- return( CL_INSUFFICIENT_MEMORY );
+ p_pool_obj = (cl_pool_obj_t *) cl_qpool_get(&p_list->list_item_pool);
+ if (!p_pool_obj)
+ return (CL_INSUFFICIENT_MEMORY);
p_pool_obj->p_object = p_object;
- cl_qlist_insert_head( &p_list->list, &p_pool_obj->pool_item.list_item );
- return( CL_SUCCESS );
+ cl_qlist_insert_head(&p_list->list, &p_pool_obj->pool_item.list_item);
+ return (CL_SUCCESS);
}
+
/*
* PARAMETERS
* p_list
@@ -464,24 +448,23 @@ cl_list_insert_head(
* SYNOPSIS
*/
static inline cl_status_t
-cl_list_insert_tail(
- IN cl_list_t* const p_list,
- IN const void* const p_object )
+cl_list_insert_tail(IN cl_list_t * const p_list, IN const void *const p_object)
{
- cl_pool_obj_t *p_pool_obj;
+ cl_pool_obj_t *p_pool_obj;
- CL_ASSERT( p_list );
- CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );
+ CL_ASSERT(p_list);
+ CL_ASSERT(cl_is_qpool_inited(&p_list->list_item_pool));
/* Get a list item to add to the list. */
- p_pool_obj = (cl_pool_obj_t*)cl_qpool_get( &p_list->list_item_pool );
- if( !p_pool_obj )
- return( CL_INSUFFICIENT_MEMORY );
+ p_pool_obj = (cl_pool_obj_t *) cl_qpool_get(&p_list->list_item_pool);
+ if (!p_pool_obj)
+ return (CL_INSUFFICIENT_MEMORY);
p_pool_obj->p_object = p_object;
- cl_qlist_insert_tail( &p_list->list, &p_pool_obj->pool_item.list_item );
- return( CL_SUCCESS );
+ cl_qlist_insert_tail(&p_list->list, &p_pool_obj->pool_item.list_item);
+ return (CL_SUCCESS);
}
+
/*
* PARAMETERS
* p_list
@@ -517,11 +500,9 @@ cl_list_insert_tail(
* SYNOPSIS
*/
cl_status_t
-cl_list_insert_array_head(
- IN cl_list_t* const p_list,
- IN const void* const p_array,
- IN uint32_t item_count,
- IN const uint32_t item_size );
+cl_list_insert_array_head(IN cl_list_t * const p_list,
+ IN const void *const p_array,
+ IN uint32_t item_count, IN const uint32_t item_size);
/*
* PARAMETERS
* p_list
@@ -564,11 +545,9 @@ cl_list_insert_array_head(
* SYNOPSIS
*/
cl_status_t
-cl_list_insert_array_tail(
- IN cl_list_t* const p_list,
- IN const void* const p_array,
- IN uint32_t item_count,
- IN const uint32_t item_size);
+cl_list_insert_array_tail(IN cl_list_t * const p_list,
+ IN const void *const p_array,
+ IN uint32_t item_count, IN const uint32_t item_size);
/*
* PARAMETERS
* p_list
@@ -611,26 +590,26 @@ cl_list_insert_array_tail(
* SYNOPSIS
*/
static inline cl_status_t
-cl_list_insert_next(
- IN cl_list_t* const p_list,
- IN cl_list_iterator_t iterator,
- IN const void* const p_object )
+cl_list_insert_next(IN cl_list_t * const p_list,
+ IN cl_list_iterator_t iterator,
+ IN const void *const p_object)
{
- cl_pool_obj_t *p_pool_obj;
+ cl_pool_obj_t *p_pool_obj;
- CL_ASSERT( p_list );
- CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );
+ CL_ASSERT(p_list);
+ CL_ASSERT(cl_is_qpool_inited(&p_list->list_item_pool));
/* Get a list item to add to the list. */
- p_pool_obj = (cl_pool_obj_t*)cl_qpool_get( &p_list->list_item_pool );
- if( !p_pool_obj )
- return( CL_INSUFFICIENT_MEMORY );
+ p_pool_obj = (cl_pool_obj_t *) cl_qpool_get(&p_list->list_item_pool);
+ if (!p_pool_obj)
+ return (CL_INSUFFICIENT_MEMORY);
p_pool_obj->p_object = p_object;
- cl_qlist_insert_next( &p_list->list, (cl_list_item_t*)iterator,
- &p_pool_obj->pool_item.list_item );
- return( CL_SUCCESS );
+ cl_qlist_insert_next(&p_list->list, (cl_list_item_t *) iterator,
+ &p_pool_obj->pool_item.list_item);
+ return (CL_SUCCESS);
}
+
/*
* PARAMETERS
* p_list
@@ -664,26 +643,26 @@ cl_list_insert_next(
* SYNOPSIS
*/
static inline cl_status_t
-cl_list_insert_prev(
- IN cl_list_t* const p_list,
- IN cl_list_iterator_t iterator,
- IN const void* const p_object )
+cl_list_insert_prev(IN cl_list_t * const p_list,
+ IN cl_list_iterator_t iterator,
+ IN const void *const p_object)
{
- cl_pool_obj_t *p_pool_obj;
+ cl_pool_obj_t *p_pool_obj;
- CL_ASSERT( p_list );
- CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );
+ CL_ASSERT(p_list);
+ CL_ASSERT(cl_is_qpool_inited(&p_list->list_item_pool));
/* Get a list item to add to the list. */
- p_pool_obj = (cl_pool_obj_t*)cl_qpool_get( &p_list->list_item_pool );
- if( !p_pool_obj )
- return( CL_INSUFFICIENT_MEMORY );
+ p_pool_obj = (cl_pool_obj_t *) cl_qpool_get(&p_list->list_item_pool);
+ if (!p_pool_obj)
+ return (CL_INSUFFICIENT_MEMORY);
p_pool_obj->p_object = p_object;
- cl_qlist_insert_prev( &p_list->list, (cl_list_item_t*)iterator,
- &p_pool_obj->pool_item.list_item );
- return( CL_SUCCESS );
+ cl_qlist_insert_prev(&p_list->list, (cl_list_item_t *) iterator,
+ &p_pool_obj->pool_item.list_item);
+ return (CL_SUCCESS);
}
+
/*
* PARAMETERS
* p_list
@@ -715,29 +694,28 @@ cl_list_insert_prev(
*
* SYNOPSIS
*/
-static inline void*
-cl_list_remove_head(
- IN cl_list_t* const p_list )
+static inline void *cl_list_remove_head(IN cl_list_t * const p_list)
{
- cl_pool_obj_t *p_pool_obj;
- void* p_obj;
+ cl_pool_obj_t *p_pool_obj;
+ void *p_obj;
- CL_ASSERT( p_list );
- CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );
+ CL_ASSERT(p_list);
+ CL_ASSERT(cl_is_qpool_inited(&p_list->list_item_pool));
/* See if the list is empty. */
- if( cl_is_qlist_empty( &p_list->list ) )
- return( NULL );
+ if (cl_is_qlist_empty(&p_list->list))
+ return (NULL);
/* Get the item at the head of the list. */
- p_pool_obj = (cl_pool_obj_t*)cl_qlist_remove_head( &p_list->list );
+ p_pool_obj = (cl_pool_obj_t *) cl_qlist_remove_head(&p_list->list);
- p_obj = (void*)p_pool_obj->p_object;
+ p_obj = (void *)p_pool_obj->p_object;
/* Place the pool item back into the pool. */
- cl_qpool_put( &p_list->list_item_pool, &p_pool_obj->pool_item );
+ cl_qpool_put(&p_list->list_item_pool, &p_pool_obj->pool_item);
- return( p_obj );
+ return (p_obj);
}
+
/*
* PARAMETERS
* p_list
@@ -762,27 +740,26 @@ cl_list_remove_head(
*
* SYNOPSIS
*/
-static inline void*
-cl_list_remove_tail(
- IN cl_list_t* const p_list )
+static inline void *cl_list_remove_tail(IN cl_list_t * const p_list)
{
- cl_pool_obj_t *p_pool_obj;
+ cl_pool_obj_t *p_pool_obj;
- CL_ASSERT( p_list );
- CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );
+ CL_ASSERT(p_list);
+ CL_ASSERT(cl_is_qpool_inited(&p_list->list_item_pool));
/* See if the list is empty. */
- if( cl_is_qlist_empty( &p_list->list ) )
- return( NULL );
+ if (cl_is_qlist_empty(&p_list->list))
+ return (NULL);
/* Get the item at the head of the list. */
- p_pool_obj = (cl_pool_obj_t*)cl_qlist_remove_tail( &p_list->list );
+ p_pool_obj = (cl_pool_obj_t *) cl_qlist_remove_tail(&p_list->list);
/* Place the list item back into the pool. */
- cl_qpool_put( &p_list->list_item_pool, &p_pool_obj->pool_item );
+ cl_qpool_put(&p_list->list_item_pool, &p_pool_obj->pool_item);
- return( (void*)p_pool_obj->p_object );
+ return ((void *)p_pool_obj->p_object);
}
+
/*
* PARAMETERS
* p_list
@@ -808,16 +785,15 @@ cl_list_remove_tail(
*
* SYNOPSIS
*/
-static inline void
-cl_list_remove_all(
- IN cl_list_t* const p_list )
+static inline void cl_list_remove_all(IN cl_list_t * const p_list)
{
- CL_ASSERT( p_list );
- CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );
+ CL_ASSERT(p_list);
+ CL_ASSERT(cl_is_qpool_inited(&p_list->list_item_pool));
/* Return all the list items to the pool. */
- cl_qpool_put_list( &p_list->list_item_pool, &p_list->list );
+ cl_qpool_put_list(&p_list->list_item_pool, &p_list->list);
}
+
/*
* PARAMETERS
* p_list
@@ -841,9 +817,8 @@ cl_list_remove_all(
* SYNOPSIS
*/
cl_status_t
-cl_list_remove_object(
- IN cl_list_t* const p_list,
- IN const void* const p_object );
+cl_list_remove_object(IN cl_list_t * const p_list,
+ IN const void *const p_object);
/*
* PARAMETERS
* p_list
@@ -875,18 +850,17 @@ cl_list_remove_object(
* SYNOPSIS
*/
static inline void
-cl_list_remove_item(
- IN cl_list_t* const p_list,
- IN cl_list_iterator_t iterator )
+cl_list_remove_item(IN cl_list_t * const p_list, IN cl_list_iterator_t iterator)
{
- CL_ASSERT( p_list );
- CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );
+ CL_ASSERT(p_list);
+ CL_ASSERT(cl_is_qpool_inited(&p_list->list_item_pool));
- cl_qlist_remove_item( &p_list->list, (cl_list_item_t*)iterator );
+ cl_qlist_remove_item(&p_list->list, (cl_list_item_t *) iterator);
/* Place the list item back into the pool. */
- cl_qpool_put( &p_list->list_item_pool, (cl_pool_item_t*)iterator );
+ cl_qpool_put(&p_list->list_item_pool, (cl_pool_item_t *) iterator);
}
+
/*
* PARAMETERS
* p_list
@@ -915,9 +889,8 @@ cl_list_remove_item(
* SYNOPSIS
*/
boolean_t
-cl_is_object_in_list(
- IN const cl_list_t* const p_list,
- IN const void* const p_object );
+cl_is_object_in_list(IN const cl_list_t * const p_list,
+ IN const void *const p_object);
/*
* PARAMETERS
* p_list
@@ -945,15 +918,14 @@ cl_is_object_in_list(
*
* SYNOPSIS
*/
-static inline cl_list_iterator_t
-cl_list_end(
- IN const cl_list_t* const p_list )
+static inline cl_list_iterator_t cl_list_end(IN const cl_list_t * const p_list)
{
- CL_ASSERT( p_list );
- CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );
+ CL_ASSERT(p_list);
+ CL_ASSERT(cl_is_qpool_inited(&p_list->list_item_pool));
- return( cl_qlist_end( &p_list->list ) );
+ return (cl_qlist_end(&p_list->list));
}
+
/*
* PARAMETERS
* p_list
@@ -982,15 +954,14 @@ cl_list_end(
*
* SYNOPSIS
*/
-static inline cl_list_iterator_t
-cl_list_head(
- IN const cl_list_t* const p_list )
+static inline cl_list_iterator_t cl_list_head(IN const cl_list_t * const p_list)
{
- CL_ASSERT( p_list );
- CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );
+ CL_ASSERT(p_list);
+ CL_ASSERT(cl_is_qpool_inited(&p_list->list_item_pool));
- return( cl_qlist_head( &p_list->list ) );
+ return (cl_qlist_head(&p_list->list));
}
+
/*
* PARAMETERS
* p_list
@@ -1021,15 +992,14 @@ cl_list_head(
*
* SYNOPSIS
*/
-static inline cl_list_iterator_t
-cl_list_tail(
- IN const cl_list_t* const p_list )
+static inline cl_list_iterator_t cl_list_tail(IN const cl_list_t * const p_list)
{
- CL_ASSERT( p_list );
- CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );
+ CL_ASSERT(p_list);
+ CL_ASSERT(cl_is_qpool_inited(&p_list->list_item_pool));
- return( cl_qlist_tail( &p_list->list ) );
+ return (cl_qlist_tail(&p_list->list));
}
+
/*
* PARAMETERS
* p_list
@@ -1061,14 +1031,13 @@ cl_list_tail(
*
* SYNOPSIS
*/
-static inline cl_list_iterator_t
-cl_list_next(
- IN cl_list_iterator_t iterator )
+static inline cl_list_iterator_t cl_list_next(IN cl_list_iterator_t iterator)
{
- CL_ASSERT( iterator );
+ CL_ASSERT(iterator);
- return( cl_qlist_next( iterator ) );
+ return (cl_qlist_next(iterator));
}
+
/*
* PARAMETERS
* p_list
@@ -1104,14 +1073,13 @@ cl_list_next(
*
* SYNOPSIS
*/
-static inline cl_list_iterator_t
-cl_list_prev(
- IN cl_list_iterator_t iterator )
+static inline cl_list_iterator_t cl_list_prev(IN cl_list_iterator_t iterator)
{
- CL_ASSERT( iterator );
+ CL_ASSERT(iterator);
- return( cl_qlist_prev( iterator ) );
+ return (cl_qlist_prev(iterator));
}
+
/*
* PARAMETERS
* p_list
@@ -1147,14 +1115,13 @@ cl_list_prev(
*
* SYNOPSIS
*/
-static inline void*
-cl_list_obj(
- IN cl_list_iterator_t iterator )
+static inline void *cl_list_obj(IN cl_list_iterator_t iterator)
{
- CL_ASSERT( iterator );
+ CL_ASSERT(iterator);
- return( (void*)((cl_pool_obj_t*)iterator)->p_object );
+ return ((void *)((cl_pool_obj_t *) iterator)->p_object);
}
+
/*
* PARAMETERS
* iterator
@@ -1180,10 +1147,9 @@ cl_list_obj(
* SYNOPSIS
*/
cl_list_iterator_t
-cl_list_find_from_head(
- IN const cl_list_t* const p_list,
- IN cl_pfn_list_find_t pfn_func,
- IN const void* const context );
+cl_list_find_from_head(IN const cl_list_t * const p_list,
+ IN cl_pfn_list_find_t pfn_func,
+ IN const void *const context);
/*
* PARAMETERS
* p_list
@@ -1225,10 +1191,9 @@ cl_list_find_from_head(
* SYNOPSIS
*/
cl_list_iterator_t
-cl_list_find_from_tail(
- IN const cl_list_t* const p_list,
- IN cl_pfn_list_find_t pfn_func,
- IN const void* const context );
+cl_list_find_from_tail(IN const cl_list_t * const p_list,
+ IN cl_pfn_list_find_t pfn_func,
+ IN const void *const context);
/*
* PARAMETERS
* p_list
@@ -1270,10 +1235,9 @@ cl_list_find_from_tail(
* SYNOPSIS
*/
void
-cl_list_apply_func(
- IN const cl_list_t* const p_list,
- IN cl_pfn_list_apply_t pfn_func,
- IN const void* const context );
+cl_list_apply_func(IN const cl_list_t * const p_list,
+ IN cl_pfn_list_apply_t pfn_func,
+ IN const void *const context);
/*
* PARAMETERS
* p_list
@@ -1310,15 +1274,14 @@ cl_list_apply_func(
*
* SYNOPSIS
*/
-static inline size_t
-cl_list_count(
- IN const cl_list_t* const p_list )
+static inline size_t cl_list_count(IN const cl_list_t * const p_list)
{
- CL_ASSERT( p_list );
- CL_ASSERT( cl_is_qpool_inited( &p_list->list_item_pool ) );
+ CL_ASSERT(p_list);
+ CL_ASSERT(cl_is_qpool_inited(&p_list->list_item_pool));
- return( cl_qlist_count( &p_list->list ) );
+ return (cl_qlist_count(&p_list->list));
}
+
/*
* PARAMETERS
* p_list
@@ -1332,5 +1295,4 @@ cl_list_count(
*********/
END_C_DECLS
-
-#endif /* _CL_LIST_H_ */
+#endif /* _CL_LIST_H_ */
diff --git a/opensm/include/complib/cl_log.h b/opensm/include/complib/cl_log.h
index 2ab34da..4ea14ce 100644
--- a/opensm/include/complib/cl_log.h
+++ b/opensm/include/complib/cl_log.h
@@ -51,13 +51,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Log Provider
* NAME
* Log Provider
@@ -66,7 +65,6 @@ BEGIN_C_DECLS
* The log provider allows users to log information in a system log instead of
* the console or debugger target.
**********/
-
/****d* Component Library: Log Provider/cl_log_type_t
* NAME
* cl_log_type_t
@@ -77,12 +75,10 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-typedef enum _cl_log_type
-{
+ typedef enum _cl_log_type {
CL_LOG_INFO,
CL_LOG_WARN,
CL_LOG_ERROR
-
} cl_log_type_t;
/*
* VALUES
@@ -109,12 +105,10 @@ typedef enum _cl_log_type
* SYNOPSIS
*/
void
-cl_log_event(
- IN const char* const name,
- IN const cl_log_type_t type,
- IN const char* const message,
- IN const void* const p_data OPTIONAL,
- IN const uint32_t data_len );
+cl_log_event(IN const char *const name,
+ IN const cl_log_type_t type,
+ IN const char *const message,
+ IN const void *const p_data OPTIONAL, IN const uint32_t data_len);
/*
* PARAMETERS
* name
@@ -150,5 +144,4 @@ cl_log_event(
*********/
END_C_DECLS
-
-#endif /* _CL_LOG_H_ */
+#endif /* _CL_LOG_H_ */
diff --git a/opensm/include/complib/cl_map.h b/opensm/include/complib/cl_map.h
index 3ce6e54..6112a08 100644
--- a/opensm/include/complib/cl_map.h
+++ b/opensm/include/complib/cl_map.h
@@ -52,13 +52,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Map
* NAME
* Map
@@ -101,7 +100,6 @@ BEGIN_C_DECLS
* Attributes:
* cl_map_count, cl_is_map_empty, cl_is_map_inited
*********/
-
/****s* Component Library: Map/cl_map_t
* NAME
* cl_map_t
@@ -114,10 +112,9 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-typedef struct _cl_map
-{
- cl_qmap_t qmap;
- cl_qpool_t pool;
+ typedef struct _cl_map {
+ cl_qmap_t qmap;
+ cl_qpool_t pool;
} cl_map_t;
/*
@@ -161,13 +158,12 @@ typedef const cl_map_item_t *cl_map_iterator_t;
*
* SYNOPSIS
*/
-static inline size_t
-cl_map_count(
- IN const cl_map_t* const p_map )
+static inline size_t cl_map_count(IN const cl_map_t * const p_map)
{
- CL_ASSERT( p_map );
- return( cl_qmap_count( &p_map->qmap ) );
+ CL_ASSERT(p_map);
+ return (cl_qmap_count(&p_map->qmap));
}
+
/*
* PARAMETERS
* p_map
@@ -189,13 +185,12 @@ cl_map_count(
*
* SYNOPSIS
*/
-static inline boolean_t
-cl_is_map_empty(
- IN const cl_map_t* const p_map )
+static inline boolean_t cl_is_map_empty(IN const cl_map_t * const p_map)
{
- CL_ASSERT( p_map );
- return( cl_is_qmap_empty( &p_map->qmap ) );
+ CL_ASSERT(p_map);
+ return (cl_is_qmap_empty(&p_map->qmap));
}
+
/*
* PARAMETERS
* p_map
@@ -219,12 +214,11 @@ cl_is_map_empty(
*
* SYNOPSIS
*/
-static inline uint64_t
-cl_map_key(
- IN const cl_map_iterator_t itor )
+static inline uint64_t cl_map_key(IN const cl_map_iterator_t itor)
{
- return( cl_qmap_key( itor ) );
+ return (cl_qmap_key(itor));
}
+
/*
* PARAMETERS
* itor
@@ -252,9 +246,7 @@ cl_map_key(
*
* SYNOPSIS
*/
-void
-cl_map_construct(
- IN cl_map_t* const p_map );
+void cl_map_construct(IN cl_map_t * const p_map);
/*
* PARAMETERS
* p_map
@@ -283,16 +275,15 @@ cl_map_construct(
*
* SYNOPSIS
*/
-static inline boolean_t
-cl_is_map_inited(
- IN const cl_map_t* const p_map )
+static inline boolean_t cl_is_map_inited(IN const cl_map_t * const p_map)
{
/*
* The map's pool of map items is the last thing initialized.
* We can therefore use it to test for initialization.
*/
- return( cl_is_qpool_inited( &p_map->pool ) );
+ return (cl_is_qpool_inited(&p_map->pool));
}
+
/*
* PARAMETERS
* p_map
@@ -321,10 +312,7 @@ cl_is_map_inited(
*
* SYNOPSIS
*/
-cl_status_t
-cl_map_init(
- IN cl_map_t* const p_map,
- IN const uint32_t min_items );
+cl_status_t cl_map_init(IN cl_map_t * const p_map, IN const uint32_t min_items);
/*
* PARAMETERS
* p_map
@@ -354,9 +342,7 @@ cl_map_init(
*
* SYNOPSIS
*/
-void
-cl_map_destroy(
- IN cl_map_t* const p_map );
+void cl_map_destroy(IN cl_map_t * const p_map);
/*
* PARAMETERS
* p_map
@@ -386,13 +372,12 @@ cl_map_destroy(
*
* SYNOPSIS
*/
-static inline cl_map_iterator_t
-cl_map_end(
- IN const cl_map_t* const p_map )
+static inline cl_map_iterator_t cl_map_end(IN const cl_map_t * const p_map)
{
- CL_ASSERT( p_map );
- return( cl_qmap_end( &p_map->qmap ) );
+ CL_ASSERT(p_map);
+ return (cl_qmap_end(&p_map->qmap));
}
+
/*
* PARAMETERS
* p_map
@@ -423,13 +408,12 @@ cl_map_end(
*
* SYNOPSIS
*/
-static inline cl_map_iterator_t
-cl_map_head(
- IN const cl_map_t* const p_map )
+static inline cl_map_iterator_t cl_map_head(IN const cl_map_t * const p_map)
{
- CL_ASSERT( p_map );
- return( cl_qmap_head( &p_map->qmap ) );
+ CL_ASSERT(p_map);
+ return (cl_qmap_head(&p_map->qmap));
}
+
/*
* PARAMETERS
* p_map
@@ -457,13 +441,12 @@ cl_map_head(
*
* SYNOPSIS
*/
-static inline cl_map_iterator_t
-cl_map_tail(
- IN const cl_map_t* const p_map )
+static inline cl_map_iterator_t cl_map_tail(IN const cl_map_t * const p_map)
{
- CL_ASSERT( p_map );
- return( cl_qmap_tail( &p_map->qmap ) );
+ CL_ASSERT(p_map);
+ return (cl_qmap_tail(&p_map->qmap));
}
+
/*
* PARAMETERS
* p_map
@@ -492,13 +475,12 @@ cl_map_tail(
*
* SYNOPSIS
*/
-static inline cl_map_iterator_t
-cl_map_next(
- IN const cl_map_iterator_t itor )
+static inline cl_map_iterator_t cl_map_next(IN const cl_map_iterator_t itor)
{
- CL_ASSERT( itor );
- return( cl_qmap_next( itor ) );
+ CL_ASSERT(itor);
+ return (cl_qmap_next(itor));
}
+
/*
* PARAMETERS
* itor
@@ -528,13 +510,12 @@ cl_map_next(
*
* SYNOPSIS
*/
-static inline cl_map_iterator_t
-cl_map_prev(
- IN const cl_map_iterator_t itor )
+static inline cl_map_iterator_t cl_map_prev(IN const cl_map_iterator_t itor)
{
- CL_ASSERT( itor );
- return( cl_qmap_prev( itor ) );
+ CL_ASSERT(itor);
+ return (cl_qmap_prev(itor));
}
+
/*
* PARAMETERS
* itor
@@ -563,11 +544,8 @@ cl_map_prev(
*
* SYNOPSIS
*/
-void*
-cl_map_insert(
- IN cl_map_t* const p_map,
- IN const uint64_t key,
- IN const void* const p_object );
+void *cl_map_insert(IN cl_map_t * const p_map,
+ IN const uint64_t key, IN const void *const p_object);
/*
* PARAMETERS
* p_map
@@ -605,10 +583,7 @@ cl_map_insert(
*
* SYNOPSIS
*/
-void*
-cl_map_get(
- IN const cl_map_t* const p_map,
- IN const uint64_t key );
+void *cl_map_get(IN const cl_map_t * const p_map, IN const uint64_t key);
/*
* PARAMETERS
* p_map
@@ -641,10 +616,7 @@ cl_map_get(
*
* SYNOPSIS
*/
-void*
-cl_map_get_next(
- IN const cl_map_t* const p_map,
- IN const uint64_t key );
+void *cl_map_get_next(IN const cl_map_t * const p_map, IN const uint64_t key);
/*
* PARAMETERS
* p_map
@@ -678,9 +650,7 @@ cl_map_get_next(
* SYNOPSIS
*/
void
-cl_map_remove_item(
- IN cl_map_t* const p_map,
- IN const cl_map_iterator_t itor );
+cl_map_remove_item(IN cl_map_t * const p_map, IN const cl_map_iterator_t itor);
/*
* PARAMETERS
* p_map
@@ -716,10 +686,7 @@ cl_map_remove_item(
*
* SYNOPSIS
*/
-void*
-cl_map_remove(
- IN cl_map_t* const p_map,
- IN const uint64_t key );
+void *cl_map_remove(IN cl_map_t * const p_map, IN const uint64_t key);
/*
* PARAMETERS
* p_map
@@ -749,9 +716,7 @@ cl_map_remove(
*
* SYNOPSIS
*/
-void
-cl_map_remove_all(
- IN cl_map_t* const p_map );
+void cl_map_remove_all(IN cl_map_t * const p_map);
/*
* PARAMETERS
* p_map
@@ -773,12 +738,11 @@ cl_map_remove_all(
*
* SYNOPSIS
*/
-static inline void*
-cl_map_obj(
- IN const cl_map_iterator_t itor )
+static inline void *cl_map_obj(IN const cl_map_iterator_t itor)
{
- return( cl_qmap_obj( PARENT_STRUCT( itor, cl_map_obj_t, item ) ) );
+ return (cl_qmap_obj(PARENT_STRUCT(itor, cl_map_obj_t, item)));
}
+
/*
* PARAMETERS
* itor
@@ -805,9 +769,8 @@ cl_map_obj(
* SYNOPSIS
*/
cl_status_t
-cl_map_merge(
- OUT cl_map_t* const p_dest_map,
- IN OUT cl_map_t* const p_src_map );
+cl_map_merge(OUT cl_map_t * const p_dest_map,
+ IN OUT cl_map_t * const p_src_map);
/*
* PARAMETERS
* p_dest_map
@@ -843,11 +806,9 @@ cl_map_merge(
* SYNOPSIS
*/
cl_status_t
-cl_map_delta(
- IN OUT cl_map_t* const p_map1,
- IN OUT cl_map_t* const p_map2,
- OUT cl_map_t* const p_new,
- OUT cl_map_t* const p_old );
+cl_map_delta(IN OUT cl_map_t * const p_map1,
+ IN OUT cl_map_t * const p_map2,
+ OUT cl_map_t * const p_new, OUT cl_map_t * const p_old);
/*
* PARAMETERS
* p_map1
@@ -888,5 +849,4 @@ cl_map_delta(
*********/
END_C_DECLS
-
-#endif /* _CL_MAP_H_ */
+#endif /* _CL_MAP_H_ */
diff --git a/opensm/include/complib/cl_math.h b/opensm/include/complib/cl_math.h
index 123bd22..9201dfa 100644
--- a/opensm/include/complib/cl_math.h
+++ b/opensm/include/complib/cl_math.h
@@ -51,13 +51,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****d* Component Library: Math/MAX
* NAME
* MAX
@@ -84,7 +83,6 @@ BEGIN_C_DECLS
#ifndef MAX
#define MAX(x,y) ((x) > (y) ? (x) : (y))
#endif
-
/****d* Component Library: Math/MIN
* NAME
* MIN
@@ -111,7 +109,6 @@ BEGIN_C_DECLS
#ifndef MIN
#define MIN(x,y) ((x) < (y) ? (x) : (y))
#endif
-
/****d* Component Library: Math/ROUNDUP
* NAME
* ROUNDUP
@@ -142,7 +139,5 @@ BEGIN_C_DECLS
#define ROUNDUP(val, align) \
((((val) / (align))*(align)) + (((val) % (align)) ? (align) : 0))
#endif
-
-END_C_DECLS
-
-#endif /* _CL_MATH_H_ */
+ END_C_DECLS
+#endif /* _CL_MATH_H_ */
diff --git a/opensm/include/complib/cl_passivelock.h b/opensm/include/complib/cl_passivelock.h
index b1ac973..982fd95 100644
--- a/opensm/include/complib/cl_passivelock.h
+++ b/opensm/include/complib/cl_passivelock.h
@@ -54,13 +54,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Passive Lock
* NAME
* Passive Lock
@@ -86,7 +85,6 @@ BEGIN_C_DECLS
* Manipulation
* cl_plock_acquire, cl_plock_excl_acquire, cl_plock_release
*********/
-
/****s* Component Library: Passive Lock/cl_plock_t
* NAME
* cl_plock_t
@@ -99,10 +97,9 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-typedef struct _cl_plock
-{
- pthread_rwlock_t lock;
- cl_state_t state;
+ typedef struct _cl_plock {
+ pthread_rwlock_t lock;
+ cl_state_t state;
} cl_plock_t;
/*
* FIELDS
@@ -127,14 +124,13 @@ typedef struct _cl_plock
*
* SYNOPSIS
*/
-static inline void
-cl_plock_construct(
- IN cl_plock_t* const p_lock )
+static inline void cl_plock_construct(IN cl_plock_t * const p_lock)
{
- CL_ASSERT( p_lock );
+ CL_ASSERT(p_lock);
- p_lock->state = CL_UNINITIALIZED;
+ p_lock->state = CL_UNINITIALIZED;
}
+
/*
* PARAMETERS
* p_lock
@@ -163,15 +159,14 @@ cl_plock_construct(
*
* SYNOPSIS
*/
-static inline void
-cl_plock_destroy(
- IN cl_plock_t* const p_lock )
+static inline void cl_plock_destroy(IN cl_plock_t * const p_lock)
{
- CL_ASSERT( p_lock );
- p_lock->state = CL_DESTROYING;
- pthread_rwlock_destroy( &p_lock->lock );
- p_lock->state = CL_DESTROYED;
+ CL_ASSERT(p_lock);
+ p_lock->state = CL_DESTROYING;
+ pthread_rwlock_destroy(&p_lock->lock);
+ p_lock->state = CL_DESTROYED;
}
+
/*
* PARAMETERS
* p_lock
@@ -201,18 +196,18 @@ cl_plock_destroy(
*
* SYNOPSIS
*/
-static inline cl_status_t
-cl_plock_init(
- IN cl_plock_t* const p_lock )
+static inline cl_status_t cl_plock_init(IN cl_plock_t * const p_lock)
{
- cl_status_t status;
+ cl_status_t status;
- CL_ASSERT( p_lock );
- status = (cl_status_t)pthread_rwlock_init( &p_lock->lock, NULL );
- if (status) return CL_ERROR;
- p_lock->state = CL_INITIALIZED;
- return( CL_SUCCESS );
+ CL_ASSERT(p_lock);
+ status = (cl_status_t) pthread_rwlock_init(&p_lock->lock, NULL);
+ if (status)
+ return CL_ERROR;
+ p_lock->state = CL_INITIALIZED;
+ return (CL_SUCCESS);
}
+
/*
* PARAMETERS
* p_lock
@@ -242,17 +237,16 @@ cl_plock_init(
*
* SYNOPSIS
*/
-static inline void
-cl_plock_acquire(
- IN cl_plock_t* const p_lock )
+static inline void cl_plock_acquire(IN cl_plock_t * const p_lock)
{
- cl_status_t status;
- CL_ASSERT( p_lock );
- CL_ASSERT( p_lock->state == CL_INITIALIZED );
+ cl_status_t status;
+ CL_ASSERT(p_lock);
+ CL_ASSERT(p_lock->state == CL_INITIALIZED);
- status = (cl_status_t)pthread_rwlock_rdlock(&p_lock->lock);
- CL_ASSERT( status == 0 );
+ status = (cl_status_t) pthread_rwlock_rdlock(&p_lock->lock);
+ CL_ASSERT(status == 0);
}
+
/*
* PARAMETERS
* p_lock
@@ -275,18 +269,17 @@ cl_plock_acquire(
*
* SYNOPSIS
*/
-static inline void
-cl_plock_excl_acquire(
- IN cl_plock_t* const p_lock )
+static inline void cl_plock_excl_acquire(IN cl_plock_t * const p_lock)
{
- cl_status_t status;
+ cl_status_t status;
- CL_ASSERT( p_lock );
- CL_ASSERT( p_lock->state == CL_INITIALIZED );
+ CL_ASSERT(p_lock);
+ CL_ASSERT(p_lock->state == CL_INITIALIZED);
- status = (cl_status_t)pthread_rwlock_wrlock(&p_lock->lock);
- CL_ASSERT( status == 0 );
+ status = (cl_status_t) pthread_rwlock_wrlock(&p_lock->lock);
+ CL_ASSERT(status == 0);
}
+
/*
* PARAMETERS
* p_lock
@@ -309,17 +302,16 @@ cl_plock_excl_acquire(
*
* SYNOPSIS
*/
-static inline void
-cl_plock_release(
- IN cl_plock_t* const p_lock )
+static inline void cl_plock_release(IN cl_plock_t * const p_lock)
{
- cl_status_t status;
- CL_ASSERT( p_lock );
- CL_ASSERT( p_lock->state == CL_INITIALIZED );
+ cl_status_t status;
+ CL_ASSERT(p_lock);
+ CL_ASSERT(p_lock->state == CL_INITIALIZED);
- status = (cl_status_t)pthread_rwlock_unlock(&p_lock->lock);
- CL_ASSERT( status == 0 );
+ status = (cl_status_t) pthread_rwlock_unlock(&p_lock->lock);
+ CL_ASSERT(status == 0);
}
+
/*
* PARAMETERS
* p_lock
@@ -333,5 +325,4 @@ cl_plock_release(
*********/
END_C_DECLS
-
-#endif /* _CL_PASSIVE_LOCK_H_ */
+#endif /* _CL_PASSIVE_LOCK_H_ */
diff --git a/opensm/include/complib/cl_pool.h b/opensm/include/complib/cl_pool.h
index 2e196fb..435db48 100644
--- a/opensm/include/complib/cl_pool.h
+++ b/opensm/include/complib/cl_pool.h
@@ -53,13 +53,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Pool
* NAME
* Pool
@@ -96,7 +95,6 @@ BEGIN_C_DECLS
* Attributes:
* cl_is_pool_inited, cl_pool_count
*********/
-
/****d* Component Library: Pool/cl_pfn_pool_init_t
* NAME
* cl_pfn_pool_init_t
@@ -109,9 +107,7 @@ BEGIN_C_DECLS
* SYNOPSIS
*/
typedef cl_status_t
-(*cl_pfn_pool_init_t)(
- IN void* const p_object,
- IN void* context );
+ (*cl_pfn_pool_init_t) (IN void *const p_object, IN void *context);
/*
* PARAMETERS
* p_object
@@ -155,9 +151,7 @@ typedef cl_status_t
* SYNOPSIS
*/
typedef void
-(*cl_pfn_pool_dtor_t)(
- IN void* const p_object,
- IN void* context );
+ (*cl_pfn_pool_dtor_t) (IN void *const p_object, IN void *context);
/*
* PARAMETERS
* p_object
@@ -195,12 +189,11 @@ typedef void
*
* SYNOPSIS
*/
-typedef struct _cl_pool
-{
- cl_qcpool_t qcpool;
- cl_pfn_pool_init_t pfn_init;
- cl_pfn_pool_dtor_t pfn_dtor;
- const void *context;
+typedef struct _cl_pool {
+ cl_qcpool_t qcpool;
+ cl_pfn_pool_init_t pfn_init;
+ cl_pfn_pool_dtor_t pfn_dtor;
+ const void *context;
} cl_pool_t;
/*
@@ -235,9 +228,7 @@ typedef struct _cl_pool
*
* SYNOPSIS
*/
-void
-cl_pool_construct(
- IN cl_pool_t* const p_pool );
+void cl_pool_construct(IN cl_pool_t * const p_pool);
/*
* PARAMETERS
* p_pool
@@ -266,14 +257,13 @@ cl_pool_construct(
*
* SYNOPSIS
*/
-static inline uint32_t
-cl_is_pool_inited(
- IN const cl_pool_t* const p_pool )
+static inline uint32_t cl_is_pool_inited(IN const cl_pool_t * const p_pool)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_pool );
- return( cl_is_qcpool_inited( &p_pool->qcpool ) );
+ CL_ASSERT(p_pool);
+ return (cl_is_qcpool_inited(&p_pool->qcpool));
}
+
/*
* PARAMETERS
* p_pool
@@ -303,15 +293,14 @@ cl_is_pool_inited(
* SYNOPSIS
*/
cl_status_t
-cl_pool_init(
- IN cl_pool_t* const p_pool,
- IN const size_t min_count,
- IN const size_t max_count,
- IN const size_t grow_size,
- IN const size_t object_size,
- IN cl_pfn_pool_init_t pfn_initializer OPTIONAL,
- IN cl_pfn_pool_dtor_t pfn_destructor OPTIONAL,
- IN const void* const context );
+cl_pool_init(IN cl_pool_t * const p_pool,
+ IN const size_t min_count,
+ IN const size_t max_count,
+ IN const size_t grow_size,
+ IN const size_t object_size,
+ IN cl_pfn_pool_init_t pfn_initializer OPTIONAL,
+ IN cl_pfn_pool_dtor_t pfn_destructor OPTIONAL,
+ IN const void *const context);
/*
* PARAMETERS
* p_pool
@@ -380,13 +369,12 @@ cl_pool_init(
*
* SYNOPSIS
*/
-static inline void
-cl_pool_destroy(
- IN cl_pool_t* const p_pool )
+static inline void cl_pool_destroy(IN cl_pool_t * const p_pool)
{
- CL_ASSERT( p_pool );
- cl_qcpool_destroy( &p_pool->qcpool );
+ CL_ASSERT(p_pool);
+ cl_qcpool_destroy(&p_pool->qcpool);
}
+
/*
* PARAMETERS
* p_pool
@@ -421,13 +409,12 @@ cl_pool_destroy(
*
* SYNOPSIS
*/
-static inline size_t
-cl_pool_count(
- IN cl_pool_t* const p_pool )
+static inline size_t cl_pool_count(IN cl_pool_t * const p_pool)
{
- CL_ASSERT( p_pool );
- return( cl_qcpool_count( &p_pool->qcpool ) );
+ CL_ASSERT(p_pool);
+ return (cl_qcpool_count(&p_pool->qcpool));
}
+
/*
* PARAMETERS
* p_pool
@@ -450,21 +437,20 @@ cl_pool_count(
*
* SYNOPSIS
*/
-static inline void*
-cl_pool_get(
- IN cl_pool_t* const p_pool )
+static inline void *cl_pool_get(IN cl_pool_t * const p_pool)
{
- cl_pool_obj_t *p_pool_obj;
+ cl_pool_obj_t *p_pool_obj;
- CL_ASSERT( p_pool );
+ CL_ASSERT(p_pool);
- p_pool_obj = (cl_pool_obj_t*)cl_qcpool_get( &p_pool->qcpool );
- if( !p_pool_obj )
- return( NULL );
+ p_pool_obj = (cl_pool_obj_t *) cl_qcpool_get(&p_pool->qcpool);
+ if (!p_pool_obj)
+ return (NULL);
- CL_ASSERT( p_pool_obj->p_object );
- return( (void*)p_pool_obj->p_object );
+ CL_ASSERT(p_pool_obj->p_object);
+ return ((void *)p_pool_obj->p_object);
}
+
/*
* PARAMETERS
* p_pool
@@ -495,24 +481,23 @@ cl_pool_get(
* SYNOPSIS
*/
static inline void
-cl_pool_put(
- IN cl_pool_t* const p_pool,
- IN void* const p_object )
+cl_pool_put(IN cl_pool_t * const p_pool, IN void *const p_object)
{
- cl_pool_obj_t *p_pool_obj;
+ cl_pool_obj_t *p_pool_obj;
- CL_ASSERT( p_pool );
- CL_ASSERT( p_object );
+ CL_ASSERT(p_pool);
+ CL_ASSERT(p_object);
/* Calculate the offset to the list object representing this object. */
- p_pool_obj = (cl_pool_obj_t*)
- (((uint8_t*)p_object) - sizeof(cl_pool_obj_t));
+ p_pool_obj = (cl_pool_obj_t *)
+ (((uint8_t *) p_object) - sizeof(cl_pool_obj_t));
/* good sanity check */
- CL_ASSERT( p_pool_obj->p_object == p_object );
+ CL_ASSERT(p_pool_obj->p_object == p_object);
- cl_qcpool_put( &p_pool->qcpool, &p_pool_obj->pool_item );
+ cl_qcpool_put(&p_pool->qcpool, &p_pool_obj->pool_item);
}
+
/*
* PARAMETERS
* p_pool
@@ -546,13 +531,12 @@ cl_pool_put(
* SYNOPSIS
*/
static inline cl_status_t
-cl_pool_grow(
- IN cl_pool_t* const p_pool,
- IN const size_t obj_count )
+cl_pool_grow(IN cl_pool_t * const p_pool, IN const size_t obj_count)
{
- CL_ASSERT( p_pool );
- return( cl_qcpool_grow( &p_pool->qcpool, obj_count ) );
+ CL_ASSERT(p_pool);
+ return (cl_qcpool_grow(&p_pool->qcpool, obj_count));
}
+
/*
* PARAMETERS
* p_pool
@@ -580,5 +564,4 @@ cl_pool_grow(
*********/
END_C_DECLS
-
-#endif /* _CL_POOL_H_ */
+#endif /* _CL_POOL_H_ */
diff --git a/opensm/include/complib/cl_ptr_vector.h b/opensm/include/complib/cl_ptr_vector.h
index e64dc30..cacf99b 100644
--- a/opensm/include/complib/cl_ptr_vector.h
+++ b/opensm/include/complib/cl_ptr_vector.h
@@ -52,13 +52,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Pointer Vector
* NAME
* Pointer Vector
@@ -94,7 +93,6 @@ BEGIN_C_DECLS
* cl_ptr_vector_find_from_start, cl_ptr_vector_find_from_end
* cl_ptr_vector_apply_func
*********/
-
/****d* Component Library: Pointer Vector/cl_pfn_ptr_vec_apply_t
* NAME
* cl_pfn_ptr_vec_apply_t
@@ -105,11 +103,9 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-typedef void
-(*cl_pfn_ptr_vec_apply_t)(
- IN const size_t index,
- IN void* const element,
- IN void* context );
+ typedef void
+ (*cl_pfn_ptr_vec_apply_t) (IN const size_t index,
+ IN void *const element, IN void *context);
/*
* PARAMETERS
* index
@@ -144,10 +140,8 @@ typedef void
* SYNOPSIS
*/
typedef cl_status_t
-(*cl_pfn_ptr_vec_find_t)(
- IN const size_t index,
- IN const void* const element,
- IN void* context );
+ (*cl_pfn_ptr_vec_find_t) (IN const size_t index,
+ IN const void *const element, IN void *context);
/*
* PARAMETERS
* index
@@ -188,13 +182,12 @@ typedef cl_status_t
*
* SYNOPSIS
*/
-typedef struct _cl_ptr_vector
-{
- size_t size;
- size_t grow_size;
- size_t capacity;
- const void **p_ptr_array;
- cl_state_t state;
+typedef struct _cl_ptr_vector {
+ size_t size;
+ size_t grow_size;
+ size_t capacity;
+ const void **p_ptr_array;
+ cl_state_t state;
} cl_ptr_vector_t;
/*
@@ -230,9 +223,7 @@ typedef struct _cl_ptr_vector
*
* SYNOPSIS
*/
-void
-cl_ptr_vector_construct(
- IN cl_ptr_vector_t* const p_vector );
+void cl_ptr_vector_construct(IN cl_ptr_vector_t * const p_vector);
/*
* PARAMETERS
* p_vector
@@ -262,10 +253,8 @@ cl_ptr_vector_construct(
* SYNOPSIS
*/
cl_status_t
-cl_ptr_vector_init(
- IN cl_ptr_vector_t* const p_vector,
- IN const size_t min_size,
- IN const size_t grow_size );
+cl_ptr_vector_init(IN cl_ptr_vector_t * const p_vector,
+ IN const size_t min_size, IN const size_t grow_size);
/*
* PARAMETERS
* p_vector
@@ -297,9 +286,7 @@ cl_ptr_vector_init(
*
* SYNOPSIS
*/
-void
-cl_ptr_vector_destroy(
- IN cl_ptr_vector_t* const p_vector );
+void cl_ptr_vector_destroy(IN cl_ptr_vector_t * const p_vector);
/*
* PARAMETERS
* p_vector
@@ -329,14 +316,14 @@ cl_ptr_vector_destroy(
* SYNOPSIS
*/
static inline size_t
-cl_ptr_vector_get_capacity(
- IN const cl_ptr_vector_t* const p_vector )
+cl_ptr_vector_get_capacity(IN const cl_ptr_vector_t * const p_vector)
{
- CL_ASSERT( p_vector );
- CL_ASSERT( p_vector->state == CL_INITIALIZED );
+ CL_ASSERT(p_vector);
+ CL_ASSERT(p_vector->state == CL_INITIALIZED);
- return( p_vector->capacity );
+ return (p_vector->capacity);
}
+
/*
* PARAMETERS
* p_vector
@@ -364,14 +351,14 @@ cl_ptr_vector_get_capacity(
* SYNOPSIS
*/
static inline uint32_t
-cl_ptr_vector_get_size(
- IN const cl_ptr_vector_t* const p_vector )
+cl_ptr_vector_get_size(IN const cl_ptr_vector_t * const p_vector)
{
- CL_ASSERT( p_vector );
- CL_ASSERT( p_vector->state == CL_INITIALIZED );
- return( (uint32_t)p_vector->size );
+ CL_ASSERT(p_vector);
+ CL_ASSERT(p_vector->state == CL_INITIALIZED);
+ return ((uint32_t) p_vector->size);
}
+
/*
* PARAMETERS
* p_vector
@@ -394,17 +381,16 @@ cl_ptr_vector_get_size(
*
* SYNOPSIS
*/
-static inline void*
-cl_ptr_vector_get(
- IN const cl_ptr_vector_t* const p_vector,
- IN const size_t index )
+static inline void *cl_ptr_vector_get(IN const cl_ptr_vector_t * const p_vector,
+ IN const size_t index)
{
- CL_ASSERT( p_vector );
- CL_ASSERT( p_vector->state == CL_INITIALIZED );
- CL_ASSERT( p_vector->size > index );
+ CL_ASSERT(p_vector);
+ CL_ASSERT(p_vector->state == CL_INITIALIZED);
+ CL_ASSERT(p_vector->size > index);
- return( (void*)p_vector->p_ptr_array[index] );
+ return ((void *)p_vector->p_ptr_array[index]);
}
+
/*
* PARAMETERS
* p_vector
@@ -439,10 +425,8 @@ cl_ptr_vector_get(
* SYNOPSIS
*/
cl_status_t
-cl_ptr_vector_at(
- IN const cl_ptr_vector_t* const p_vector,
- IN const size_t index,
- OUT void** const p_element );
+cl_ptr_vector_at(IN const cl_ptr_vector_t * const p_vector,
+ IN const size_t index, OUT void **const p_element);
/*
* PARAMETERS
* p_vector
@@ -482,10 +466,8 @@ cl_ptr_vector_at(
* SYNOPSIS
*/
cl_status_t
-cl_ptr_vector_set(
- IN cl_ptr_vector_t* const p_vector,
- IN const size_t index,
- IN const void* const element );
+cl_ptr_vector_set(IN cl_ptr_vector_t * const p_vector,
+ IN const size_t index, IN const void *const element);
/*
* PARAMETERS
* p_vector
@@ -523,22 +505,22 @@ cl_ptr_vector_set(
* SYNOPSIS
*/
static inline cl_status_t
-cl_ptr_vector_insert(
- IN cl_ptr_vector_t* const p_vector,
- IN const void* const element,
- OUT size_t* const p_index OPTIONAL )
+cl_ptr_vector_insert(IN cl_ptr_vector_t * const p_vector,
+ IN const void *const element,
+ OUT size_t * const p_index OPTIONAL)
{
- cl_status_t status;
+ cl_status_t status;
- CL_ASSERT( p_vector );
- CL_ASSERT( p_vector->state == CL_INITIALIZED );
+ CL_ASSERT(p_vector);
+ CL_ASSERT(p_vector->state == CL_INITIALIZED);
- status = cl_ptr_vector_set( p_vector, p_vector->size, element );
- if( status == CL_SUCCESS && p_index )
+ status = cl_ptr_vector_set(p_vector, p_vector->size, element);
+ if (status == CL_SUCCESS && p_index)
*p_index = p_vector->size - 1;
- return( status );
+ return (status);
}
+
/*
* PARAMETERS
* p_vector
@@ -581,10 +563,8 @@ cl_ptr_vector_insert(
*
* SYNOPSIS
*/
-void*
-cl_ptr_vector_remove(
- IN cl_ptr_vector_t* const p_vector,
- IN const size_t index );
+void *cl_ptr_vector_remove(IN cl_ptr_vector_t * const p_vector,
+ IN const size_t index);
/*
* PARAMETERS
* p_vector
@@ -617,9 +597,8 @@ cl_ptr_vector_remove(
* SYNOPSIS
*/
cl_status_t
-cl_ptr_vector_set_capacity(
- IN cl_ptr_vector_t* const p_vector,
- IN const size_t new_capacity );
+cl_ptr_vector_set_capacity(IN cl_ptr_vector_t * const p_vector,
+ IN const size_t new_capacity);
/*
* PARAMETERS
* p_vector
@@ -657,9 +636,8 @@ cl_ptr_vector_set_capacity(
* SYNOPSIS
*/
cl_status_t
-cl_ptr_vector_set_size(
- IN cl_ptr_vector_t* const p_vector,
- IN const size_t size );
+cl_ptr_vector_set_size(IN cl_ptr_vector_t * const p_vector,
+ IN const size_t size);
/*
* PARAMETERS
* p_vector
@@ -697,9 +675,8 @@ cl_ptr_vector_set_size(
* SYNOPSIS
*/
cl_status_t
-cl_ptr_vector_set_min_size(
- IN cl_ptr_vector_t* const p_vector,
- IN const size_t min_size );
+cl_ptr_vector_set_min_size(IN cl_ptr_vector_t * const p_vector,
+ IN const size_t min_size);
/*
* PARAMETERS
* p_vector
@@ -738,10 +715,9 @@ cl_ptr_vector_set_min_size(
* SYNOPSIS
*/
void
-cl_ptr_vector_apply_func(
- IN const cl_ptr_vector_t* const p_vector,
- IN cl_pfn_ptr_vec_apply_t pfn_callback,
- IN const void* const context );
+cl_ptr_vector_apply_func(IN const cl_ptr_vector_t * const p_vector,
+ IN cl_pfn_ptr_vec_apply_t pfn_callback,
+ IN const void *const context);
/*
* PARAMETERS
* p_vector
@@ -778,10 +754,9 @@ cl_ptr_vector_apply_func(
* SYNOPSIS
*/
size_t
-cl_ptr_vector_find_from_start(
- IN const cl_ptr_vector_t* const p_vector,
- IN cl_pfn_ptr_vec_find_t pfn_callback,
- IN const void* const context );
+cl_ptr_vector_find_from_start(IN const cl_ptr_vector_t * const p_vector,
+ IN cl_pfn_ptr_vec_find_t pfn_callback,
+ IN const void *const context);
/*
* PARAMETERS
* p_vector
@@ -821,10 +796,9 @@ cl_ptr_vector_find_from_start(
* SYNOPSIS
*/
size_t
-cl_ptr_vector_find_from_end(
- IN const cl_ptr_vector_t* const p_vector,
- IN cl_pfn_ptr_vec_find_t pfn_callback,
- IN const void* const context );
+cl_ptr_vector_find_from_end(IN const cl_ptr_vector_t * const p_vector,
+ IN cl_pfn_ptr_vec_find_t pfn_callback,
+ IN const void *const context);
/*
* PARAMETERS
* p_vector
@@ -854,5 +828,4 @@ cl_ptr_vector_find_from_end(
*********/
END_C_DECLS
-
-#endif /* _CL_PTR_VECTOR_H_ */
+#endif /* _CL_PTR_VECTOR_H_ */
diff --git a/opensm/include/complib/cl_qcomppool.h b/opensm/include/complib/cl_qcomppool.h
index 818523f..91f5867 100644
--- a/opensm/include/complib/cl_qcomppool.h
+++ b/opensm/include/complib/cl_qcomppool.h
@@ -55,13 +55,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Quick Composite Pool
* NAME
* Quick Composite Pool
@@ -109,7 +108,6 @@ BEGIN_C_DECLS
* Attributes:
* cl_is_qcpool_inited, cl_qcpool_count
*********/
-
/****s* Component Library: Quick Composite Pool/cl_pool_item_t
* NAME
* cl_pool_item_t
@@ -119,12 +117,11 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-typedef struct _cl_pool_item
-{
- cl_list_item_t list_item;
+ typedef struct _cl_pool_item {
+ cl_list_item_t list_item;
#ifdef _DEBUG_
/* Pointer to the owner pool used for sanity checks. */
- struct _cl_qcpool *p_pool;
+ struct _cl_qcpool *p_pool;
#endif
} cl_pool_item_t;
@@ -154,11 +151,10 @@ typedef struct _cl_pool_item
*
* SYNOPSIS
*/
-typedef struct _cl_pool_obj
-{
+typedef struct _cl_pool_obj {
/* The pool item must be the first item to allow casting. */
- cl_pool_item_t pool_item;
- const void *p_object;
+ cl_pool_item_t pool_item;
+ const void *p_object;
} cl_pool_obj_t;
/*
@@ -188,11 +184,10 @@ typedef struct _cl_pool_obj
* SYNOPSIS
*/
typedef cl_status_t
-(*cl_pfn_qcpool_init_t)(
- IN void** const p_comp_array,
- IN const uint32_t num_components,
- IN void* context,
- OUT cl_pool_item_t** const pp_pool_item );
+ (*cl_pfn_qcpool_init_t) (IN void **const p_comp_array,
+ IN const uint32_t num_components,
+ IN void *context,
+ OUT cl_pool_item_t ** const pp_pool_item);
/*
* PARAMETERS
* p_comp_array
@@ -256,9 +251,8 @@ typedef cl_status_t
* SYNOPSIS
*/
typedef void
-(*cl_pfn_qcpool_dtor_t)(
- IN const cl_pool_item_t* const p_pool_item,
- IN void* context );
+ (*cl_pfn_qcpool_dtor_t) (IN const cl_pool_item_t * const p_pool_item,
+ IN void *context);
/*
* PARAMETERS
* p_pool_item
@@ -296,20 +290,19 @@ typedef void
*
* SYNOPSIS
*/
-typedef struct _cl_qcpool
-{
- uint32_t num_components;
- size_t *component_sizes;
- void **p_components;
- size_t num_objects;
- size_t max_objects;
- size_t grow_size;
- cl_pfn_qcpool_init_t pfn_init;
- cl_pfn_qcpool_dtor_t pfn_dtor;
- const void *context;
- cl_qlist_t free_list;
- cl_qlist_t alloc_list;
- cl_state_t state;
+typedef struct _cl_qcpool {
+ uint32_t num_components;
+ size_t *component_sizes;
+ void **p_components;
+ size_t num_objects;
+ size_t max_objects;
+ size_t grow_size;
+ cl_pfn_qcpool_init_t pfn_init;
+ cl_pfn_qcpool_dtor_t pfn_dtor;
+ const void *context;
+ cl_qlist_t free_list;
+ cl_qlist_t alloc_list;
+ cl_state_t state;
} cl_qcpool_t;
/*
@@ -363,9 +356,7 @@ typedef struct _cl_qcpool
*
* SYNOPSIS
*/
-void
-cl_qcpool_construct(
- IN cl_qcpool_t* const p_pool );
+void cl_qcpool_construct(IN cl_qcpool_t * const p_pool);
/*
* PARAMETERS
* p_pool
@@ -395,17 +386,16 @@ cl_qcpool_construct(
*
* SYNOPSIS
*/
-static inline uint32_t
-cl_is_qcpool_inited(
- IN const cl_qcpool_t* const p_pool )
+static inline uint32_t cl_is_qcpool_inited(IN const cl_qcpool_t * const p_pool)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_pool );
+ CL_ASSERT(p_pool);
/* CL_ASSERT that the pool is not in some invalid state. */
- CL_ASSERT( cl_is_state_valid( p_pool->state ) );
+ CL_ASSERT(cl_is_state_valid(p_pool->state));
- return( p_pool->state == CL_INITIALIZED );
+ return (p_pool->state == CL_INITIALIZED);
}
+
/*
* PARAMETERS
* p_pool
@@ -434,16 +424,15 @@ cl_is_qcpool_inited(
* SYNOPSIS
*/
cl_status_t
-cl_qcpool_init(
- IN cl_qcpool_t* const p_pool,
- IN const size_t min_size,
- IN const size_t max_size,
- IN const size_t grow_size,
- IN const size_t* const component_sizes,
- IN const uint32_t num_components,
- IN cl_pfn_qcpool_init_t pfn_initializer OPTIONAL,
- IN cl_pfn_qcpool_dtor_t pfn_destructor OPTIONAL,
- IN const void* const context );
+cl_qcpool_init(IN cl_qcpool_t * const p_pool,
+ IN const size_t min_size,
+ IN const size_t max_size,
+ IN const size_t grow_size,
+ IN const size_t * const component_sizes,
+ IN const uint32_t num_components,
+ IN cl_pfn_qcpool_init_t pfn_initializer OPTIONAL,
+ IN cl_pfn_qcpool_dtor_t pfn_destructor OPTIONAL,
+ IN const void *const context);
/*
* PARAMETERS
* p_pool
@@ -522,9 +511,7 @@ cl_qcpool_init(
*
* SYNOPSIS
*/
-void
-cl_qcpool_destroy(
- IN cl_qcpool_t* const p_pool );
+void cl_qcpool_destroy(IN cl_qcpool_t * const p_pool);
/*
* PARAMETERS
* p_pool
@@ -559,15 +546,14 @@ cl_qcpool_destroy(
*
* SYNOPSIS
*/
-static inline size_t
-cl_qcpool_count(
- IN cl_qcpool_t* const p_pool )
+static inline size_t cl_qcpool_count(IN cl_qcpool_t * const p_pool)
{
- CL_ASSERT( p_pool );
- CL_ASSERT( p_pool->state == CL_INITIALIZED );
+ CL_ASSERT(p_pool);
+ CL_ASSERT(p_pool->state == CL_INITIALIZED);
- return( cl_qlist_count( &p_pool->free_list ) );
+ return (cl_qlist_count(&p_pool->free_list));
}
+
/*
* PARAMETERS
* p_pool
@@ -592,9 +578,7 @@ cl_qcpool_count(
*
* SYNOPSIS
*/
-cl_pool_item_t*
-cl_qcpool_get(
- IN cl_qcpool_t* const p_pool );
+cl_pool_item_t *cl_qcpool_get(IN cl_qcpool_t * const p_pool);
/*
* PARAMETERS
* p_pool
@@ -626,19 +610,19 @@ cl_qcpool_get(
* SYNOPSIS
*/
static inline void
-cl_qcpool_put(
- IN cl_qcpool_t* const p_pool,
- IN cl_pool_item_t* const p_pool_item )
+cl_qcpool_put(IN cl_qcpool_t * const p_pool,
+ IN cl_pool_item_t * const p_pool_item)
{
- CL_ASSERT( p_pool );
- CL_ASSERT( p_pool->state == CL_INITIALIZED );
- CL_ASSERT( p_pool_item );
+ CL_ASSERT(p_pool);
+ CL_ASSERT(p_pool->state == CL_INITIALIZED);
+ CL_ASSERT(p_pool_item);
/* Make sure items being returned came from the specified pool. */
- CL_ASSERT( p_pool_item->p_pool == p_pool );
+ CL_ASSERT(p_pool_item->p_pool == p_pool);
/* return this lil' doggy to the pool */
- cl_qlist_insert_head( &p_pool->free_list, &p_pool_item->list_item );
+ cl_qlist_insert_head(&p_pool->free_list, &p_pool_item->list_item);
}
+
/*
* PARAMETERS
* p_pool
@@ -673,31 +657,29 @@ cl_qcpool_put(
* SYNOPSIS
*/
static inline void
-cl_qcpool_put_list(
- IN cl_qcpool_t* const p_pool,
- IN cl_qlist_t* const p_list )
+cl_qcpool_put_list(IN cl_qcpool_t * const p_pool, IN cl_qlist_t * const p_list)
{
#ifdef _DEBUG_
- cl_list_item_t *p_item;
+ cl_list_item_t *p_item;
#endif
- CL_ASSERT( p_pool );
- CL_ASSERT( p_pool->state == CL_INITIALIZED );
- CL_ASSERT( p_list );
+ CL_ASSERT(p_pool);
+ CL_ASSERT(p_pool->state == CL_INITIALIZED);
+ CL_ASSERT(p_list);
#ifdef _DEBUG_
/* Chech that all items in the list came from this pool. */
- p_item = cl_qlist_head( p_list );
- while( p_item != cl_qlist_end( p_list ) )
- {
- CL_ASSERT( ((cl_pool_item_t*)p_item)->p_pool == p_pool );
- p_item = cl_qlist_next( p_item );
+ p_item = cl_qlist_head(p_list);
+ while (p_item != cl_qlist_end(p_list)) {
+ CL_ASSERT(((cl_pool_item_t *) p_item)->p_pool == p_pool);
+ p_item = cl_qlist_next(p_item);
}
#endif
/* return these lil' doggies to the pool */
- cl_qlist_insert_list_head( &p_pool->free_list, p_list );
+ cl_qlist_insert_list_head(&p_pool->free_list, p_list);
}
+
/*
* PARAMETERS
* p_pool
@@ -731,10 +713,7 @@ cl_qcpool_put_list(
*
* SYNOPSIS
*/
-cl_status_t
-cl_qcpool_grow(
- IN cl_qcpool_t* const p_pool,
- IN size_t obj_count );
+cl_status_t cl_qcpool_grow(IN cl_qcpool_t * const p_pool, IN size_t obj_count);
/*
* PARAMETERS
* p_pool
@@ -762,5 +741,4 @@ cl_qcpool_grow(
*********/
END_C_DECLS
-
-#endif /* _CL_QUICK_COMPOSITE_POOL_H_ */
+#endif /* _CL_QUICK_COMPOSITE_POOL_H_ */
diff --git a/opensm/include/complib/cl_qlist.h b/opensm/include/complib/cl_qlist.h
index 273aff7..63f1b3a 100644
--- a/opensm/include/complib/cl_qlist.h
+++ b/opensm/include/complib/cl_qlist.h
@@ -51,13 +51,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Quick List
* NAME
* Quick List
@@ -110,7 +109,6 @@ BEGIN_C_DECLS
* Attributes:
* cl_qlist_count, cl_is_qlist_empty
*********/
-
/****s* Component Library: Quick List/cl_list_item_t
* NAME
* cl_list_item_t
@@ -120,12 +118,11 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-typedef struct _cl_list_item
-{
- struct _cl_list_item *p_next;
- struct _cl_list_item *p_prev;
+ typedef struct _cl_list_item {
+ struct _cl_list_item *p_next;
+ struct _cl_list_item *p_prev;
#ifdef _DEBUG_
- struct _cl_qlist *p_list;
+ struct _cl_qlist *p_list;
#endif
} cl_list_item_t;
@@ -150,10 +147,9 @@ typedef struct _cl_list_item
*
* SYNOPSIS
*/
-typedef struct _cl_list_obj
-{
- cl_list_item_t list_item;
- const void *p_object; /* User's context */
+typedef struct _cl_list_obj {
+ cl_list_item_t list_item;
+ const void *p_object; /* User's context */
} cl_list_obj_t;
/*
@@ -186,11 +182,10 @@ typedef struct _cl_list_obj
*
* SYNOPSIS
*/
-typedef struct _cl_qlist
-{
- cl_list_item_t end;
- size_t count;
- cl_state_t state;
+typedef struct _cl_qlist {
+ cl_list_item_t end;
+ size_t count;
+ cl_state_t state;
} cl_qlist_t;
/*
@@ -219,9 +214,8 @@ typedef struct _cl_qlist
* SYNOPSIS
*/
typedef void
-(*cl_pfn_qlist_apply_t)(
- IN cl_list_item_t* const p_list_item,
- IN void* context );
+ (*cl_pfn_qlist_apply_t) (IN cl_list_item_t * const p_list_item,
+ IN void *context);
/*
* PARAMETERS
* p_list_item
@@ -253,9 +247,8 @@ typedef void
* SYNOPSIS
*/
typedef cl_status_t
-(*cl_pfn_qlist_find_t)(
- IN const cl_list_item_t* const p_list_item,
- IN void* context );
+ (*cl_pfn_qlist_find_t) (IN const cl_list_item_t * const p_list_item,
+ IN void *context);
/*
* PARAMETERS
* p_list_item
@@ -291,20 +284,20 @@ typedef cl_status_t
* SYNOPSIS
*/
static inline void
-__cl_primitive_insert(
- IN cl_list_item_t* const p_list_item,
- IN cl_list_item_t* const p_new_item )
+__cl_primitive_insert(IN cl_list_item_t * const p_list_item,
+ IN cl_list_item_t * const p_new_item)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list_item );
+ CL_ASSERT(p_list_item);
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_new_item );
+ CL_ASSERT(p_new_item);
p_new_item->p_next = p_list_item;
p_new_item->p_prev = p_list_item->p_prev;
p_list_item->p_prev = p_new_item;
p_new_item->p_prev->p_next = p_new_item;
}
+
/*
* PARAMETERS
* p_list_item
@@ -327,27 +320,25 @@ __cl_primitive_insert(
*
* SYNOPSIS
*/
-static inline void
-__cl_primitive_remove(
- IN cl_list_item_t* const p_list_item )
+static inline void __cl_primitive_remove(IN cl_list_item_t * const p_list_item)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list_item );
+ CL_ASSERT(p_list_item);
/* set the back pointer */
- p_list_item->p_next->p_prev= p_list_item->p_prev;
+ p_list_item->p_next->p_prev = p_list_item->p_prev;
/* set the next pointer */
- p_list_item->p_prev->p_next= p_list_item->p_next;
+ p_list_item->p_prev->p_next = p_list_item->p_next;
/* if we're debugging, spruce up the pointers to help find bugs */
#if defined( _DEBUG_ )
- if( p_list_item != p_list_item->p_next )
- {
+ if (p_list_item != p_list_item->p_next) {
p_list_item->p_next = NULL;
p_list_item->p_prev = NULL;
}
-#endif /* defined( _DEBUG_ ) */
+#endif /* defined( _DEBUG_ ) */
}
+
/*
* PARAMETERS
* p_list_item
@@ -371,14 +362,14 @@ __cl_primitive_remove(
* SYNOPSIS
*/
static inline void
-cl_qlist_set_obj(
- IN cl_list_obj_t* const p_list_obj,
- IN const void* const p_object )
+cl_qlist_set_obj(IN cl_list_obj_t * const p_list_obj,
+ IN const void *const p_object)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list_obj );
+ CL_ASSERT(p_list_obj);
p_list_obj->p_object = p_object;
}
+
/*
* PARAMETERS
* p_list_obj
@@ -403,15 +394,14 @@ cl_qlist_set_obj(
*
* SYNOPSIS
*/
-static inline void*
-cl_qlist_obj(
- IN const cl_list_obj_t* const p_list_obj )
+static inline void *cl_qlist_obj(IN const cl_list_obj_t * const p_list_obj)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list_obj );
+ CL_ASSERT(p_list_obj);
- return( (void*)p_list_obj->p_object );
+ return ((void *)p_list_obj->p_object);
}
+
/*
* PARAMETERS
* p_list_obj
@@ -424,9 +414,7 @@ cl_qlist_obj(
* Quick List, cl_qlist_set_obj
*********/
-static inline void
-__cl_qlist_reset(
- IN cl_qlist_t* const p_list )
+static inline void __cl_qlist_reset(IN cl_qlist_t * const p_list)
{
/* Point the end item to itself. */
p_list->end.p_next = &p_list->end;
@@ -448,18 +436,17 @@ __cl_qlist_reset(
*
* SYNOPSIS
*/
-static inline void
-cl_qlist_init(
- IN cl_qlist_t* const p_list )
+static inline void cl_qlist_init(IN cl_qlist_t * const p_list)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
p_list->state = CL_INITIALIZED;
/* Reset the quick list data structure. */
- __cl_qlist_reset( p_list );
+ __cl_qlist_reset(p_list);
}
+
/*
* PARAMETERS
* p_list
@@ -486,17 +473,16 @@ cl_qlist_init(
*
* SYNOPSIS
*/
-static inline uint32_t
-cl_qlist_count(
- IN const cl_qlist_t* const p_list )
+static inline uint32_t cl_qlist_count(IN const cl_qlist_t * const p_list)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
- return( (uint32_t)p_list->count );
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
+ return ((uint32_t) p_list->count);
}
+
/*
* PARAMETERS
* p_list
@@ -519,17 +505,16 @@ cl_qlist_count(
*
* SYNOPSIS
*/
-static inline boolean_t
-cl_is_qlist_empty(
- IN const cl_qlist_t* const p_list )
+static inline boolean_t cl_is_qlist_empty(IN const cl_qlist_t * const p_list)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
- return( !cl_qlist_count( p_list ) );
+ return (!cl_qlist_count(p_list));
}
+
/*
* PARAMETERS
* p_list
@@ -554,18 +539,18 @@ cl_is_qlist_empty(
*
* SYNOPSIS
*/
-static inline cl_list_item_t*
-cl_qlist_next(
- IN const cl_list_item_t* const p_list_item )
+static inline cl_list_item_t *cl_qlist_next(IN const cl_list_item_t *
+ const p_list_item)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list_item );
+ CL_ASSERT(p_list_item);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list_item->p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list_item->p_list->state == CL_INITIALIZED);
/* Return the next item. */
- return( p_list_item->p_next );
+ return (p_list_item->p_next);
}
+
/*
* PARAMETERS
* p_list_item
@@ -592,18 +577,18 @@ cl_qlist_next(
*
* SYNOPSIS
*/
-static inline cl_list_item_t*
-cl_qlist_prev(
- IN const cl_list_item_t* const p_list_item )
+static inline cl_list_item_t *cl_qlist_prev(IN const cl_list_item_t *
+ const p_list_item)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list_item );
+ CL_ASSERT(p_list_item);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list_item->p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list_item->p_list->state == CL_INITIALIZED);
/* Return the previous item. */
- return( p_list_item->p_prev );
+ return (p_list_item->p_prev);
}
+
/*
* PARAMETERS
* p_list_item
@@ -630,17 +615,16 @@ cl_qlist_prev(
*
* SYNOPSIS
*/
-static inline cl_list_item_t*
-cl_qlist_head(
- IN const cl_qlist_t* const p_list )
+static inline cl_list_item_t *cl_qlist_head(IN const cl_qlist_t * const p_list)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
- return( cl_qlist_next( &p_list->end ) );
+ return (cl_qlist_next(&p_list->end));
}
+
/*
* PARAMETERS
* p_list
@@ -669,17 +653,16 @@ cl_qlist_head(
*
* SYNOPSIS
*/
-static inline cl_list_item_t*
-cl_qlist_tail(
- IN const cl_qlist_t* const p_list )
+static inline cl_list_item_t *cl_qlist_tail(IN const cl_qlist_t * const p_list)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
- return( cl_qlist_prev( &p_list->end ) );
+ return (cl_qlist_prev(&p_list->end));
}
+
/*
* PARAMETERS
* p_list
@@ -707,17 +690,17 @@ cl_qlist_tail(
*
* SYNOPSIS
*/
-static inline const cl_list_item_t*
-cl_qlist_end(
- IN const cl_qlist_t* const p_list )
+static inline const cl_list_item_t *cl_qlist_end(IN const cl_qlist_t *
+ const p_list)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
- return( &p_list->end );
+ return (&p_list->end);
}
+
/*
* PARAMETERS
* p_list
@@ -750,16 +733,15 @@ cl_qlist_end(
* SYNOPSIS
*/
static inline void
-cl_qlist_insert_head(
- IN cl_qlist_t* const p_list,
- IN cl_list_item_t* const p_list_item )
+cl_qlist_insert_head(IN cl_qlist_t * const p_list,
+ IN cl_list_item_t * const p_list_item)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list_item );
+ CL_ASSERT(p_list_item);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
/*
* The list item must not already be part of the list. Note that this
@@ -767,17 +749,18 @@ cl_qlist_insert_head(
* list pointer equal to the specified list. The chances of this
* happening are acceptable in light of the value of this check.
*/
- CL_ASSERT( p_list_item->p_list != p_list );
+ CL_ASSERT(p_list_item->p_list != p_list);
#if defined( _DEBUG_ )
p_list_item->p_list = p_list;
#endif
/* Insert before the head. */
- __cl_primitive_insert( cl_qlist_head( p_list ), p_list_item );
+ __cl_primitive_insert(cl_qlist_head(p_list), p_list_item);
p_list->count++;
}
+
/*
* PARAMETERS
* p_list
@@ -811,16 +794,15 @@ cl_qlist_insert_head(
* SYNOPSIS
*/
static inline void
-cl_qlist_insert_tail(
- IN cl_qlist_t* const p_list,
- IN cl_list_item_t* const p_list_item )
+cl_qlist_insert_tail(IN cl_qlist_t * const p_list,
+ IN cl_list_item_t * const p_list_item)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list_item );
+ CL_ASSERT(p_list_item);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
/*
* The list item must not already be part of the list. Note that this
@@ -828,7 +810,7 @@ cl_qlist_insert_tail(
* list pointer equal to the specified list. The chances of this
* happening are acceptable in light of the value of this check.
*/
- CL_ASSERT( p_list_item->p_list != p_list );
+ CL_ASSERT(p_list_item->p_list != p_list);
#if defined( _DEBUG_ )
p_list_item->p_list = p_list;
@@ -838,10 +820,11 @@ cl_qlist_insert_tail(
* Put the new element in front of the end which is the same
* as being at the tail
*/
- __cl_primitive_insert( &p_list->end, p_list_item );
+ __cl_primitive_insert(&p_list->end, p_list_item);
p_list->count++;
}
+
/*
* PARAMETERS
* p_list
@@ -875,9 +858,8 @@ cl_qlist_insert_tail(
* SYNOPSIS
*/
void
-cl_qlist_insert_list_head(
- IN cl_qlist_t* const p_dest_list,
- IN cl_qlist_t* const p_src_list );
+cl_qlist_insert_list_head(IN cl_qlist_t * const p_dest_list,
+ IN cl_qlist_t * const p_src_list);
/*
* PARAMETERS
* p_dest_list
@@ -914,9 +896,8 @@ cl_qlist_insert_list_head(
* SYNOPSIS
*/
void
-cl_qlist_insert_list_tail(
- IN cl_qlist_t* const p_dest_list,
- IN cl_qlist_t* const p_src_list );
+cl_qlist_insert_list_tail(IN cl_qlist_t * const p_dest_list,
+ IN cl_qlist_t * const p_src_list);
/*
* PARAMETERS
* p_dest_list
@@ -953,11 +934,9 @@ cl_qlist_insert_list_tail(
* SYNOPSIS
*/
void
-cl_qlist_insert_array_head(
- IN cl_qlist_t* const p_list,
- IN cl_list_item_t* const p_array,
- IN uint32_t item_count,
- IN const uint32_t item_size );
+cl_qlist_insert_array_head(IN cl_qlist_t * const p_list,
+ IN cl_list_item_t * const p_array,
+ IN uint32_t item_count, IN const uint32_t item_size);
/*
* PARAMETERS
* p_list
@@ -1004,11 +983,9 @@ cl_qlist_insert_array_head(
* SYNOPSIS
*/
void
-cl_qlist_insert_array_tail(
- IN cl_qlist_t* const p_list,
- IN cl_list_item_t* const p_array,
- IN uint32_t item_count,
- IN const uint32_t item_size);
+cl_qlist_insert_array_tail(IN cl_qlist_t * const p_list,
+ IN cl_list_item_t * const p_array,
+ IN uint32_t item_count, IN const uint32_t item_size);
/*
* PARAMETERS
* p_list
@@ -1055,19 +1032,18 @@ cl_qlist_insert_array_tail(
* SYNOPSIS
*/
static inline void
-cl_qlist_insert_prev(
- IN cl_qlist_t* const p_list,
- IN cl_list_item_t* const p_list_item,
- IN cl_list_item_t* const p_new_item )
+cl_qlist_insert_prev(IN cl_qlist_t * const p_list,
+ IN cl_list_item_t * const p_list_item,
+ IN cl_list_item_t * const p_new_item)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list_item );
+ CL_ASSERT(p_list_item);
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_new_item );
+ CL_ASSERT(p_new_item);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
/*
* The list item must not already be part of the list. Note that this
@@ -1075,16 +1051,17 @@ cl_qlist_insert_prev(
* list pointer equal to the specified list. The chances of this
* happening are acceptable in light of the value of this check.
*/
- CL_ASSERT( p_new_item->p_list != p_list );
+ CL_ASSERT(p_new_item->p_list != p_list);
#if defined( _DEBUG_ )
p_new_item->p_list = p_list;
#endif
- __cl_primitive_insert( p_list_item, p_new_item );
+ __cl_primitive_insert(p_list_item, p_new_item);
p_list->count++;
}
+
/*
* PARAMETERS
* p_list
@@ -1119,19 +1096,18 @@ cl_qlist_insert_prev(
* SYNOPSIS
*/
static inline void
-cl_qlist_insert_next(
- IN cl_qlist_t* const p_list,
- IN cl_list_item_t* const p_list_item,
- IN cl_list_item_t* const p_new_item )
+cl_qlist_insert_next(IN cl_qlist_t * const p_list,
+ IN cl_list_item_t * const p_list_item,
+ IN cl_list_item_t * const p_new_item)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list_item );
+ CL_ASSERT(p_list_item);
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_new_item );
+ CL_ASSERT(p_new_item);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
/*
* The list item must not already be part of the list. Note that this
@@ -1139,16 +1115,17 @@ cl_qlist_insert_next(
* list pointer equal to the specified list. The chances of this
* happening are acceptable in light of the value of this check.
*/
- CL_ASSERT( p_new_item->p_list != p_list );
+ CL_ASSERT(p_new_item->p_list != p_list);
#if defined( _DEBUG_ )
p_new_item->p_list = p_list;
#endif
- __cl_primitive_insert( cl_qlist_next( p_list_item ), p_new_item );
+ __cl_primitive_insert(cl_qlist_next(p_list_item), p_new_item);
p_list->count++;
}
+
/*
* PARAMETERS
* p_list
@@ -1183,35 +1160,34 @@ cl_qlist_insert_next(
*
* SYNOPSIS
*/
-static inline cl_list_item_t*
-cl_qlist_remove_head(
- IN cl_qlist_t* const p_list )
+static inline cl_list_item_t *cl_qlist_remove_head(IN cl_qlist_t * const p_list)
{
- cl_list_item_t *p_item;
+ cl_list_item_t *p_item;
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
- p_item = cl_qlist_head( p_list );
+ p_item = cl_qlist_head(p_list);
/* CL_ASSERT that the list item is part of the list. */
- CL_ASSERT( p_item->p_list == p_list );
+ CL_ASSERT(p_item->p_list == p_list);
- if( p_item == cl_qlist_end( p_list ) )
- return( p_item );
+ if (p_item == cl_qlist_end(p_list))
+ return (p_item);
#if defined( _DEBUG_ )
/* Clear the item's link to the list. */
p_item->p_list = NULL;
#endif
- __cl_primitive_remove( p_item );
+ __cl_primitive_remove(p_item);
p_list->count--;
- return( p_item );
+ return (p_item);
}
+
/*
* PARAMETERS
* p_list
@@ -1237,35 +1213,34 @@ cl_qlist_remove_head(
*
* SYNOPSIS
*/
-static inline cl_list_item_t*
-cl_qlist_remove_tail(
- IN cl_qlist_t* const p_list )
+static inline cl_list_item_t *cl_qlist_remove_tail(IN cl_qlist_t * const p_list)
{
- cl_list_item_t *p_item;
+ cl_list_item_t *p_item;
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
- p_item = cl_qlist_tail( p_list );
+ p_item = cl_qlist_tail(p_list);
/* CL_ASSERT that the list item is part of the list. */
- CL_ASSERT( p_item->p_list == p_list );
+ CL_ASSERT(p_item->p_list == p_list);
- if( p_item == cl_qlist_end( p_list ) )
- return( p_item );
+ if (p_item == cl_qlist_end(p_list))
+ return (p_item);
#if defined( _DEBUG_ )
/* Clear the item's link to the list. */
p_item->p_list = NULL;
#endif
- __cl_primitive_remove( p_item );
+ __cl_primitive_remove(p_item);
p_list->count--;
- return( p_item );
+ return (p_item);
}
+
/*
* PARAMETERS
* p_list
@@ -1291,20 +1266,19 @@ cl_qlist_remove_tail(
* SYNOPSIS
*/
static inline void
-cl_qlist_remove_item(
- IN cl_qlist_t* const p_list,
- IN cl_list_item_t* const p_list_item )
+cl_qlist_remove_item(IN cl_qlist_t * const p_list,
+ IN cl_list_item_t * const p_list_item)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list_item );
+ CL_ASSERT(p_list_item);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
/* CL_ASSERT that the list item is part of the list. */
- CL_ASSERT( p_list_item->p_list == p_list );
+ CL_ASSERT(p_list_item->p_list == p_list);
- if( p_list_item == cl_qlist_end( p_list ) )
+ if (p_list_item == cl_qlist_end(p_list))
return;
#if defined( _DEBUG_ )
@@ -1312,10 +1286,11 @@ cl_qlist_remove_item(
p_list_item->p_list = NULL;
#endif
- __cl_primitive_remove( p_list_item );
+ __cl_primitive_remove(p_list_item);
p_list->count--;
}
+
/*
* PARAMETERS
* p_list
@@ -1345,27 +1320,25 @@ cl_qlist_remove_item(
*
* SYNOPSIS
*/
-static inline void
-cl_qlist_remove_all(
- IN cl_qlist_t* const p_list )
+static inline void cl_qlist_remove_all(IN cl_qlist_t * const p_list)
{
#if defined( _DEBUG_ )
- cl_list_item_t *p_list_item;
+ cl_list_item_t *p_list_item;
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
- p_list_item = cl_qlist_head( p_list );
- while( p_list_item != cl_qlist_end( p_list ) )
- {
- p_list_item = cl_qlist_next( p_list_item );
- cl_qlist_prev( p_list_item )->p_list = NULL;
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
+ p_list_item = cl_qlist_head(p_list);
+ while (p_list_item != cl_qlist_end(p_list)) {
+ p_list_item = cl_qlist_next(p_list_item);
+ cl_qlist_prev(p_list_item)->p_list = NULL;
}
#endif
- __cl_qlist_reset( p_list );
+ __cl_qlist_reset(p_list);
}
+
/*
* PARAMETERS
* p_list
@@ -1390,9 +1363,8 @@ cl_qlist_remove_all(
* SYNOPSIS
*/
boolean_t
-cl_is_item_in_qlist(
- IN const cl_qlist_t* const p_list,
- IN const cl_list_item_t* const p_list_item );
+cl_is_item_in_qlist(IN const cl_qlist_t * const p_list,
+ IN const cl_list_item_t * const p_list_item);
/*
* PARAMETERS
* p_list
@@ -1420,12 +1392,10 @@ cl_is_item_in_qlist(
*
* SYNOPSIS
*/
-cl_list_item_t*
-cl_qlist_find_next(
- IN const cl_qlist_t* const p_list,
- IN const cl_list_item_t* const p_list_item,
- IN cl_pfn_qlist_find_t pfn_func,
- IN const void* const context );
+cl_list_item_t *cl_qlist_find_next(IN const cl_qlist_t * const p_list,
+ IN const cl_list_item_t * const p_list_item,
+ IN cl_pfn_qlist_find_t pfn_func,
+ IN const void *const context);
/*
* PARAMETERS
* p_list
@@ -1474,12 +1444,10 @@ cl_qlist_find_next(
*
* SYNOPSIS
*/
-cl_list_item_t*
-cl_qlist_find_prev(
- IN const cl_qlist_t* const p_list,
- IN const cl_list_item_t* const p_list_item,
- IN cl_pfn_qlist_find_t pfn_func,
- IN const void* const context );
+cl_list_item_t *cl_qlist_find_prev(IN const cl_qlist_t * const p_list,
+ IN const cl_list_item_t * const p_list_item,
+ IN cl_pfn_qlist_find_t pfn_func,
+ IN const void *const context);
/*
* PARAMETERS
* p_list
@@ -1528,22 +1496,24 @@ cl_qlist_find_prev(
*
* SYNOPSIS
*/
-static inline cl_list_item_t*
-cl_qlist_find_from_head(
- IN const cl_qlist_t* const p_list,
- IN cl_pfn_qlist_find_t pfn_func,
- IN const void* const context )
+static inline cl_list_item_t *cl_qlist_find_from_head(IN const cl_qlist_t *
+ const p_list,
+ IN cl_pfn_qlist_find_t
+ pfn_func,
+ IN const void *const
+ context)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
/* CL_ASSERT that a find function is provided. */
- CL_ASSERT( pfn_func );
+ CL_ASSERT(pfn_func);
- return( cl_qlist_find_next( p_list, cl_qlist_end( p_list ), pfn_func,
- context ) );
+ return (cl_qlist_find_next(p_list, cl_qlist_end(p_list), pfn_func,
+ context));
}
+
/*
* PARAMETERS
* p_list
@@ -1588,22 +1558,24 @@ cl_qlist_find_from_head(
*
* SYNOPSIS
*/
-static inline cl_list_item_t*
-cl_qlist_find_from_tail(
- IN const cl_qlist_t* const p_list,
- IN cl_pfn_qlist_find_t pfn_func,
- IN const void* const context )
+static inline cl_list_item_t *cl_qlist_find_from_tail(IN const cl_qlist_t *
+ const p_list,
+ IN cl_pfn_qlist_find_t
+ pfn_func,
+ IN const void *const
+ context)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_list );
+ CL_ASSERT(p_list);
/* CL_ASSERT that the list was initialized. */
- CL_ASSERT( p_list->state == CL_INITIALIZED );
+ CL_ASSERT(p_list->state == CL_INITIALIZED);
/* CL_ASSERT that a find function is provided. */
- CL_ASSERT( pfn_func );
+ CL_ASSERT(pfn_func);
- return( cl_qlist_find_prev( p_list, cl_qlist_end( p_list ), pfn_func,
- context ) );
+ return (cl_qlist_find_prev(p_list, cl_qlist_end(p_list), pfn_func,
+ context));
}
+
/*
* PARAMETERS
* p_list
@@ -1649,10 +1621,9 @@ cl_qlist_find_from_tail(
* SYNOPSIS
*/
void
-cl_qlist_apply_func(
- IN const cl_qlist_t* const p_list,
- IN cl_pfn_qlist_apply_t pfn_func,
- IN const void* const context );
+cl_qlist_apply_func(IN const cl_qlist_t * const p_list,
+ IN cl_pfn_qlist_apply_t pfn_func,
+ IN const void *const context);
/*
* PARAMETERS
* p_list
@@ -1689,11 +1660,10 @@ cl_qlist_apply_func(
* SYNOPSIS
*/
void
-cl_qlist_move_items(
- IN cl_qlist_t* const p_src_list,
- IN cl_qlist_t* const p_dest_list,
- IN cl_pfn_qlist_find_t pfn_func,
- IN const void* const context );
+cl_qlist_move_items(IN cl_qlist_t * const p_src_list,
+ IN cl_qlist_t * const p_dest_list,
+ IN cl_pfn_qlist_find_t pfn_func,
+ IN const void *const context);
/*
* PARAMETERS
* p_src_list
@@ -1733,5 +1703,4 @@ cl_qlist_move_items(
*********/
END_C_DECLS
-
-#endif /* _CL_QUICK_LIST_H_ */
+#endif /* _CL_QUICK_LIST_H_ */
diff --git a/opensm/include/complib/cl_qlockpool.h b/opensm/include/complib/cl_qlockpool.h
index 3404d05..58a9b4b 100644
--- a/opensm/include/complib/cl_qlockpool.h
+++ b/opensm/include/complib/cl_qlockpool.h
@@ -53,13 +53,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Quick Locking Pool
* NAME
* Quick Locking Pool
@@ -80,7 +79,6 @@ BEGIN_C_DECLS
* Manipulation
* cl_qlock_pool_get, cl_qlock_pool_put
*********/
-
/****s* Component Library: Quick Locking Pool/cl_qlock_pool_t
* NAME
* cl_qlock_pool_t
@@ -93,10 +91,9 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-typedef struct _cl_qlock_pool
-{
- cl_spinlock_t lock;
- cl_qpool_t pool;
+ typedef struct _cl_qlock_pool {
+ cl_spinlock_t lock;
+ cl_qpool_t pool;
} cl_qlock_pool_t;
/*
@@ -120,12 +117,10 @@ typedef struct _cl_qlock_pool
*
* SYNOPSIS
*/
-static inline void
-cl_qlock_pool_construct(
- IN cl_qlock_pool_t* const p_pool )
+static inline void cl_qlock_pool_construct(IN cl_qlock_pool_t * const p_pool)
{
- cl_qpool_construct( &p_pool->pool );
- cl_spinlock_construct( &p_pool->lock );
+ cl_qpool_construct(&p_pool->pool);
+ cl_spinlock_construct(&p_pool->lock);
}
/*
@@ -156,25 +151,22 @@ cl_qlock_pool_construct(
*
* SYNOPSIS
*/
-static inline void
-cl_qlock_pool_destroy(
- IN cl_qlock_pool_t* const p_pool )
+static inline void cl_qlock_pool_destroy(IN cl_qlock_pool_t * const p_pool)
{
/*
- If the pool has already been put into use, grab the lock
- to sync with other threads before we blow everything away.
- */
- if( cl_is_qpool_inited( &p_pool->pool ) )
- {
- cl_spinlock_acquire( &p_pool->lock );
- cl_qpool_destroy( &p_pool->pool );
- cl_spinlock_release( &p_pool->lock );
- }
- else
- cl_qpool_destroy( &p_pool->pool );
+ If the pool has already been put into use, grab the lock
+ to sync with other threads before we blow everything away.
+ */
+ if (cl_is_qpool_inited(&p_pool->pool)) {
+ cl_spinlock_acquire(&p_pool->lock);
+ cl_qpool_destroy(&p_pool->pool);
+ cl_spinlock_release(&p_pool->lock);
+ } else
+ cl_qpool_destroy(&p_pool->pool);
- cl_spinlock_destroy( &p_pool->lock );
+ cl_spinlock_destroy(&p_pool->lock);
}
+
/*
* PARAMETERS
* p_pool
@@ -203,29 +195,30 @@ cl_qlock_pool_destroy(
* SYNOPSIS
*/
static inline cl_status_t
-cl_qlock_pool_init(
- IN cl_qlock_pool_t* const p_pool,
- IN const size_t min_size,
- IN const size_t max_size,
- IN const size_t grow_size,
- IN const size_t object_size,
- IN cl_pfn_qpool_init_t pfn_initializer OPTIONAL,
- IN cl_pfn_qpool_dtor_t pfn_destructor OPTIONAL,
- IN const void* const context )
+cl_qlock_pool_init(IN cl_qlock_pool_t * const p_pool,
+ IN const size_t min_size,
+ IN const size_t max_size,
+ IN const size_t grow_size,
+ IN const size_t object_size,
+ IN cl_pfn_qpool_init_t pfn_initializer OPTIONAL,
+ IN cl_pfn_qpool_dtor_t pfn_destructor OPTIONAL,
+ IN const void *const context)
{
cl_status_t status;
- cl_qlock_pool_construct( p_pool );
+ cl_qlock_pool_construct(p_pool);
- status = cl_spinlock_init( &p_pool->lock );
- if( status )
- return( status );
+ status = cl_spinlock_init(&p_pool->lock);
+ if (status)
+ return (status);
- status = cl_qpool_init( &p_pool->pool, min_size, max_size, grow_size,
- object_size, pfn_initializer, pfn_destructor, context );
+ status = cl_qpool_init(&p_pool->pool, min_size, max_size, grow_size,
+ object_size, pfn_initializer, pfn_destructor,
+ context);
- return( status );
+ return (status);
}
+
/*
* PARAMETERS
* p_pool
@@ -292,15 +285,14 @@ cl_qlock_pool_init(
*
* SYNOPSIS
*/
-static inline cl_pool_item_t*
-cl_qlock_pool_get(
- IN cl_qlock_pool_t* const p_pool )
+static inline cl_pool_item_t *cl_qlock_pool_get(IN cl_qlock_pool_t *
+ const p_pool)
{
- cl_pool_item_t* p_item;
- cl_spinlock_acquire( &p_pool->lock );
- p_item = cl_qpool_get( &p_pool->pool );
- cl_spinlock_release( &p_pool->lock );
- return( p_item );
+ cl_pool_item_t *p_item;
+ cl_spinlock_acquire(&p_pool->lock);
+ p_item = cl_qpool_get(&p_pool->pool);
+ cl_spinlock_release(&p_pool->lock);
+ return (p_item);
}
/*
@@ -332,14 +324,14 @@ cl_qlock_pool_get(
* SYNOPSIS
*/
static inline void
-cl_qlock_pool_put(
- IN cl_qlock_pool_t* const p_pool,
- IN cl_pool_item_t* const p_item )
+cl_qlock_pool_put(IN cl_qlock_pool_t * const p_pool,
+ IN cl_pool_item_t * const p_item)
{
- cl_spinlock_acquire( &p_pool->lock );
- cl_qpool_put( &p_pool->pool, p_item );
- cl_spinlock_release( &p_pool->lock );
+ cl_spinlock_acquire(&p_pool->lock);
+ cl_qpool_put(&p_pool->pool, p_item);
+ cl_spinlock_release(&p_pool->lock);
}
+
/*
* PARAMETERS
* p_pool
@@ -361,5 +353,4 @@ cl_qlock_pool_put(
*********/
END_C_DECLS
-
-#endif /* _CL_QLOCKPOOL_H_ */
+#endif /* _CL_QLOCKPOOL_H_ */
diff --git a/opensm/include/complib/cl_qmap.h b/opensm/include/complib/cl_qmap.h
index e069d6f..959c3ca 100644
--- a/opensm/include/complib/cl_qmap.h
+++ b/opensm/include/complib/cl_qmap.h
@@ -52,13 +52,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Quick Map
* NAME
* Quick Map
@@ -106,7 +105,6 @@ BEGIN_C_DECLS
* Attributes:
* cl_qmap_count, cl_is_qmap_empty,
*********/
-
/****i* Component Library: Quick Map/cl_map_color_t
* NAME
* cl_map_color_t
@@ -117,11 +115,9 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-typedef enum _cl_map_color
-{
+ typedef enum _cl_map_color {
CL_MAP_RED,
CL_MAP_BLACK
-
} cl_map_color_t;
/*
* VALUES
@@ -147,17 +143,16 @@ typedef enum _cl_map_color
*
* SYNOPSIS
*/
-typedef struct _cl_map_item
-{
+typedef struct _cl_map_item {
/* Must be first to allow casting. */
- cl_pool_item_t pool_item;
- struct _cl_map_item *p_left;
- struct _cl_map_item *p_right;
- struct _cl_map_item *p_up;
- cl_map_color_t color;
- uint64_t key;
+ cl_pool_item_t pool_item;
+ struct _cl_map_item *p_left;
+ struct _cl_map_item *p_right;
+ struct _cl_map_item *p_up;
+ cl_map_color_t color;
+ uint64_t key;
#ifdef _DEBUG_
- struct _cl_qmap *p_map;
+ struct _cl_qmap *p_map;
#endif
} cl_map_item_t;
@@ -216,10 +211,9 @@ typedef struct _cl_map_item
*
* SYNOPSIS
*/
-typedef struct _cl_map_obj
-{
- cl_map_item_t item;
- const void *p_object;
+typedef struct _cl_map_obj {
+ cl_map_item_t item;
+ const void *p_object;
} cl_map_obj_t;
/*
@@ -256,12 +250,11 @@ typedef struct _cl_map_obj
*
* SYNOPSIS
*/
-typedef struct _cl_qmap
-{
- cl_map_item_t root;
- cl_map_item_t nil;
- cl_state_t state;
- size_t count;
+typedef struct _cl_qmap {
+ cl_map_item_t root;
+ cl_map_item_t nil;
+ cl_state_t state;
+ size_t count;
} cl_qmap_t;
/*
@@ -297,9 +290,7 @@ typedef struct _cl_qmap
* SYNOPSIS
*/
typedef void
-(*cl_pfn_qmap_apply_t)(
- IN cl_map_item_t* const p_map_item,
- IN void* context );
+ (*cl_pfn_qmap_apply_t) (IN cl_map_item_t * const p_map_item, IN void *context);
/*
* PARAMETERS
* p_map_item
@@ -330,14 +321,13 @@ typedef void
*
* SYNOPSIS
*/
-static inline uint32_t
-cl_qmap_count(
- IN const cl_qmap_t* const p_map )
+static inline uint32_t cl_qmap_count(IN const cl_qmap_t * const p_map)
{
- CL_ASSERT( p_map );
- CL_ASSERT( p_map->state == CL_INITIALIZED );
- return( (uint32_t)p_map->count );
+ CL_ASSERT(p_map);
+ CL_ASSERT(p_map->state == CL_INITIALIZED);
+ return ((uint32_t) p_map->count);
}
+
/*
* PARAMETERS
* p_map
@@ -359,15 +349,14 @@ cl_qmap_count(
*
* SYNOPSIS
*/
-static inline boolean_t
-cl_is_qmap_empty(
- IN const cl_qmap_t* const p_map )
+static inline boolean_t cl_is_qmap_empty(IN const cl_qmap_t * const p_map)
{
- CL_ASSERT( p_map );
- CL_ASSERT( p_map->state == CL_INITIALIZED );
+ CL_ASSERT(p_map);
+ CL_ASSERT(p_map->state == CL_INITIALIZED);
- return( p_map->count == 0 );
+ return (p_map->count == 0);
}
+
/*
* PARAMETERS
* p_map
@@ -392,13 +381,13 @@ cl_is_qmap_empty(
* SYNOPSIS
*/
static inline void
-cl_qmap_set_obj(
- IN cl_map_obj_t* const p_map_obj,
- IN const void* const p_object )
+cl_qmap_set_obj(IN cl_map_obj_t * const p_map_obj,
+ IN const void *const p_object)
{
- CL_ASSERT( p_map_obj );
+ CL_ASSERT(p_map_obj);
p_map_obj->p_object = p_object;
}
+
/*
* PARAMETERS
* p_map_obj
@@ -424,13 +413,12 @@ cl_qmap_set_obj(
*
* SYNOPSIS
*/
-static inline void*
-cl_qmap_obj(
- IN const cl_map_obj_t* const p_map_obj )
+static inline void *cl_qmap_obj(IN const cl_map_obj_t * const p_map_obj)
{
- CL_ASSERT( p_map_obj );
- return( (void*)p_map_obj->p_object );
+ CL_ASSERT(p_map_obj);
+ return ((void *)p_map_obj->p_object);
}
+
/*
* PARAMETERS
* p_map_obj
@@ -452,13 +440,12 @@ cl_qmap_obj(
*
* SYNOPSIS
*/
-static inline uint64_t
-cl_qmap_key(
- IN const cl_map_item_t* const p_item )
+static inline uint64_t cl_qmap_key(IN const cl_map_item_t * const p_item)
{
- CL_ASSERT( p_item );
- return( p_item->key );
+ CL_ASSERT(p_item);
+ return (p_item->key);
}
+
/*
* PARAMETERS
* p_item
@@ -483,9 +470,7 @@ cl_qmap_key(
*
* SYNOPSIS
*/
-void
-cl_qmap_init(
- IN cl_qmap_t* const p_map );
+void cl_qmap_init(IN cl_qmap_t * const p_map);
/*
* PARAMETERS
* p_map
@@ -510,15 +495,14 @@ cl_qmap_init(
*
* SYNOPSIS
*/
-static inline const cl_map_item_t*
-cl_qmap_end(
- IN const cl_qmap_t* const p_map )
+static inline const cl_map_item_t *cl_qmap_end(IN const cl_qmap_t * const p_map)
{
- CL_ASSERT( p_map );
- CL_ASSERT( p_map->state == CL_INITIALIZED );
+ CL_ASSERT(p_map);
+ CL_ASSERT(p_map->state == CL_INITIALIZED);
/* Nil is the end of the map. */
- return( &p_map->nil );
+ return (&p_map->nil);
}
+
/*
* PARAMETERS
* p_map
@@ -549,14 +533,13 @@ cl_qmap_end(
*
* SYNOPSIS
*/
-static inline cl_map_item_t*
-cl_qmap_head(
- IN const cl_qmap_t* const p_map )
+static inline cl_map_item_t *cl_qmap_head(IN const cl_qmap_t * const p_map)
{
- CL_ASSERT( p_map );
- CL_ASSERT( p_map->state == CL_INITIALIZED );
- return( (cl_map_item_t*)p_map->nil.pool_item.list_item.p_next );
+ CL_ASSERT(p_map);
+ CL_ASSERT(p_map->state == CL_INITIALIZED);
+ return ((cl_map_item_t *) p_map->nil.pool_item.list_item.p_next);
}
+
/*
* PARAMETERS
* p_map
@@ -586,14 +569,13 @@ cl_qmap_head(
*
* SYNOPSIS
*/
-static inline cl_map_item_t*
-cl_qmap_tail(
- IN const cl_qmap_t* const p_map )
+static inline cl_map_item_t *cl_qmap_tail(IN const cl_qmap_t * const p_map)
{
- CL_ASSERT( p_map );
- CL_ASSERT( p_map->state == CL_INITIALIZED );
- return( (cl_map_item_t*)p_map->nil.pool_item.list_item.p_prev );
+ CL_ASSERT(p_map);
+ CL_ASSERT(p_map->state == CL_INITIALIZED);
+ return ((cl_map_item_t *) p_map->nil.pool_item.list_item.p_prev);
}
+
/*
* PARAMETERS
* p_map
@@ -623,13 +605,12 @@ cl_qmap_tail(
*
* SYNOPSIS
*/
-static inline cl_map_item_t*
-cl_qmap_next(
- IN const cl_map_item_t* const p_item )
+static inline cl_map_item_t *cl_qmap_next(IN const cl_map_item_t * const p_item)
{
- CL_ASSERT( p_item );
- return( (cl_map_item_t*)p_item->pool_item.list_item.p_next );
+ CL_ASSERT(p_item);
+ return ((cl_map_item_t *) p_item->pool_item.list_item.p_next);
}
+
/*
* PARAMETERS
* p_item
@@ -656,13 +637,12 @@ cl_qmap_next(
*
* SYNOPSIS
*/
-static inline cl_map_item_t*
-cl_qmap_prev(
- IN const cl_map_item_t* const p_item )
+static inline cl_map_item_t *cl_qmap_prev(IN const cl_map_item_t * const p_item)
{
- CL_ASSERT( p_item );
- return( (cl_map_item_t*)p_item->pool_item.list_item.p_prev );
+ CL_ASSERT(p_item);
+ return ((cl_map_item_t *) p_item->pool_item.list_item.p_prev);
}
+
/*
* PARAMETERS
* p_item
@@ -689,11 +669,9 @@ cl_qmap_prev(
*
* SYNOPSIS
*/
-cl_map_item_t*
-cl_qmap_insert(
- IN cl_qmap_t* const p_map,
- IN const uint64_t key,
- IN cl_map_item_t* const p_item );
+cl_map_item_t *cl_qmap_insert(IN cl_qmap_t * const p_map,
+ IN const uint64_t key,
+ IN cl_map_item_t * const p_item);
/*
* PARAMETERS
* p_map
@@ -727,10 +705,8 @@ cl_qmap_insert(
*
* SYNOPSIS
*/
-cl_map_item_t*
-cl_qmap_get(
- IN const cl_qmap_t* const p_map,
- IN const uint64_t key );
+cl_map_item_t *cl_qmap_get(IN const cl_qmap_t * const p_map,
+ IN const uint64_t key);
/*
* PARAMETERS
* p_map
@@ -763,10 +739,8 @@ cl_qmap_get(
*
* SYNOPSIS
*/
-cl_map_item_t*
-cl_qmap_get_next(
- IN const cl_qmap_t* const p_map,
- IN const uint64_t key );
+cl_map_item_t *cl_qmap_get_next(IN const cl_qmap_t * const p_map,
+ IN const uint64_t key);
/*
* PARAMETERS
* p_map
@@ -800,9 +774,8 @@ cl_qmap_get_next(
* SYNOPSIS
*/
void
-cl_qmap_remove_item(
- IN cl_qmap_t* const p_map,
- IN cl_map_item_t* const p_item );
+cl_qmap_remove_item(IN cl_qmap_t * const p_map,
+ IN cl_map_item_t * const p_item);
/*
* PARAMETERS
* p_item
@@ -831,10 +804,8 @@ cl_qmap_remove_item(
*
* SYNOPSIS
*/
-cl_map_item_t*
-cl_qmap_remove(
- IN cl_qmap_t* const p_map,
- IN const uint64_t key );
+cl_map_item_t *cl_qmap_remove(IN cl_qmap_t * const p_map,
+ IN const uint64_t key);
/*
* PARAMETERS
* p_map
@@ -864,18 +835,17 @@ cl_qmap_remove(
*
* SYNOPSIS
*/
-static inline void
-cl_qmap_remove_all(
- IN cl_qmap_t* const p_map )
+static inline void cl_qmap_remove_all(IN cl_qmap_t * const p_map)
{
- CL_ASSERT( p_map );
- CL_ASSERT( p_map->state == CL_INITIALIZED );
+ CL_ASSERT(p_map);
+ CL_ASSERT(p_map->state == CL_INITIALIZED);
p_map->root.p_left = &p_map->nil;
p_map->nil.pool_item.list_item.p_next = &p_map->nil.pool_item.list_item;
p_map->nil.pool_item.list_item.p_prev = &p_map->nil.pool_item.list_item;
p_map->count = 0;
}
+
/*
* PARAMETERS
* p_map
@@ -899,9 +869,8 @@ cl_qmap_remove_all(
* SYNOPSIS
*/
void
-cl_qmap_merge(
- OUT cl_qmap_t* const p_dest_map,
- IN OUT cl_qmap_t* const p_src_map );
+cl_qmap_merge(OUT cl_qmap_t * const p_dest_map,
+ IN OUT cl_qmap_t * const p_src_map);
/*
* PARAMETERS
* p_dest_map
@@ -934,11 +903,9 @@ cl_qmap_merge(
* SYNOPSIS
*/
void
-cl_qmap_delta(
- IN OUT cl_qmap_t* const p_map1,
- IN OUT cl_qmap_t* const p_map2,
- OUT cl_qmap_t* const p_new,
- OUT cl_qmap_t* const p_old );
+cl_qmap_delta(IN OUT cl_qmap_t * const p_map1,
+ IN OUT cl_qmap_t * const p_map2,
+ OUT cl_qmap_t * const p_new, OUT cl_qmap_t * const p_old);
/*
* PARAMETERS
* p_map1
@@ -985,10 +952,9 @@ cl_qmap_delta(
* SYNOPSIS
*/
void
-cl_qmap_apply_func(
- IN const cl_qmap_t* const p_map,
- IN cl_pfn_qmap_apply_t pfn_func,
- IN const void* const context );
+cl_qmap_apply_func(IN const cl_qmap_t * const p_map,
+ IN cl_pfn_qmap_apply_t pfn_func,
+ IN const void *const context);
/*
* PARAMETERS
* p_map
@@ -1014,5 +980,4 @@ cl_qmap_apply_func(
*********/
END_C_DECLS
-
-#endif /* _CL_QMAP_H_ */
+#endif /* _CL_QMAP_H_ */
diff --git a/opensm/include/complib/cl_qpool.h b/opensm/include/complib/cl_qpool.h
index 0b3f756..5a38206 100644
--- a/opensm/include/complib/cl_qpool.h
+++ b/opensm/include/complib/cl_qpool.h
@@ -53,13 +53,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Quick Pool
* NAME
* Quick Pool
@@ -102,7 +101,6 @@ BEGIN_C_DECLS
* Attributes:
* cl_is_qpool_inited, cl_qpool_count
*********/
-
/****d* Component Library: Quick Pool/cl_pfn_qpool_init_t
* NAME
* cl_pfn_qpool_init_t
@@ -115,10 +113,9 @@ BEGIN_C_DECLS
* SYNOPSIS
*/
typedef cl_status_t
-(*cl_pfn_qpool_init_t)(
- IN void* const p_object,
- IN void* context,
- OUT cl_pool_item_t** const pp_pool_item );
+ (*cl_pfn_qpool_init_t) (IN void *const p_object,
+ IN void *context,
+ OUT cl_pool_item_t ** const pp_pool_item);
/*
* PARAMETERS
* p_object
@@ -172,9 +169,8 @@ typedef cl_status_t
* SYNOPSIS
*/
typedef void
-(*cl_pfn_qpool_dtor_t)(
- IN const cl_pool_item_t* const p_pool_item,
- IN void* context );
+ (*cl_pfn_qpool_dtor_t) (IN const cl_pool_item_t * const p_pool_item,
+ IN void *context);
/*
* PARAMETERS
* p_pool_item
@@ -212,12 +208,11 @@ typedef void
*
* SYNOPSIS
*/
-typedef struct _cl_qpool
-{
- cl_qcpool_t qcpool;
- cl_pfn_qpool_init_t pfn_init;
- cl_pfn_qpool_dtor_t pfn_dtor;
- const void *context;
+typedef struct _cl_qpool {
+ cl_qcpool_t qcpool;
+ cl_pfn_qpool_init_t pfn_init;
+ cl_pfn_qpool_dtor_t pfn_dtor;
+ const void *context;
} cl_qpool_t;
/*
@@ -252,9 +247,7 @@ typedef struct _cl_qpool
*
* SYNOPSIS
*/
-void
-cl_qpool_construct(
- IN cl_qpool_t* const p_pool );
+void cl_qpool_construct(IN cl_qpool_t * const p_pool);
/*
* PARAMETERS
* p_pool
@@ -283,14 +276,13 @@ cl_qpool_construct(
*
* SYNOPSIS
*/
-static inline uint32_t
-cl_is_qpool_inited(
- IN const cl_qpool_t* const p_pool )
+static inline uint32_t cl_is_qpool_inited(IN const cl_qpool_t * const p_pool)
{
/* CL_ASSERT that a non-null pointer is provided. */
- CL_ASSERT( p_pool );
- return( cl_is_qcpool_inited( &p_pool->qcpool ) );
+ CL_ASSERT(p_pool);
+ return (cl_is_qcpool_inited(&p_pool->qcpool));
}
+
/*
* PARAMETERS
* p_pool
@@ -320,15 +312,14 @@ cl_is_qpool_inited(
* SYNOPSIS
*/
cl_status_t
-cl_qpool_init(
- IN cl_qpool_t* const p_pool,
- IN const size_t min_size,
- IN const size_t max_size,
- IN const size_t grow_size,
- IN const size_t object_size,
- IN cl_pfn_qpool_init_t pfn_initializer OPTIONAL,
- IN cl_pfn_qpool_dtor_t pfn_destructor OPTIONAL,
- IN const void* const context );
+cl_qpool_init(IN cl_qpool_t * const p_pool,
+ IN const size_t min_size,
+ IN const size_t max_size,
+ IN const size_t grow_size,
+ IN const size_t object_size,
+ IN cl_pfn_qpool_init_t pfn_initializer OPTIONAL,
+ IN cl_pfn_qpool_dtor_t pfn_destructor OPTIONAL,
+ IN const void *const context);
/*
* PARAMETERS
* p_pool
@@ -399,13 +390,12 @@ cl_qpool_init(
*
* SYNOPSIS
*/
-static inline void
-cl_qpool_destroy(
- IN cl_qpool_t* const p_pool )
+static inline void cl_qpool_destroy(IN cl_qpool_t * const p_pool)
{
- CL_ASSERT( p_pool );
- cl_qcpool_destroy( &p_pool->qcpool );
+ CL_ASSERT(p_pool);
+ cl_qcpool_destroy(&p_pool->qcpool);
}
+
/*
* PARAMETERS
* p_pool
@@ -440,13 +430,12 @@ cl_qpool_destroy(
*
* SYNOPSIS
*/
-static inline size_t
-cl_qpool_count(
- IN cl_qpool_t* const p_pool )
+static inline size_t cl_qpool_count(IN cl_qpool_t * const p_pool)
{
- CL_ASSERT( p_pool );
- return( cl_qcpool_count( &p_pool->qcpool ) );
+ CL_ASSERT(p_pool);
+ return (cl_qcpool_count(&p_pool->qcpool));
}
+
/*
* PARAMETERS
* p_pool
@@ -470,13 +459,12 @@ cl_qpool_count(
*
* SYNOPSIS
*/
-static inline cl_pool_item_t*
-cl_qpool_get(
- IN cl_qpool_t* const p_pool )
+static inline cl_pool_item_t *cl_qpool_get(IN cl_qpool_t * const p_pool)
{
- CL_ASSERT( p_pool );
- return( cl_qcpool_get( &p_pool->qcpool ) );
+ CL_ASSERT(p_pool);
+ return (cl_qcpool_get(&p_pool->qcpool));
}
+
/*
* PARAMETERS
* p_pool
@@ -507,13 +495,13 @@ cl_qpool_get(
* SYNOPSIS
*/
static inline void
-cl_qpool_put(
- IN cl_qpool_t* const p_pool,
- IN cl_pool_item_t* const p_pool_item )
+cl_qpool_put(IN cl_qpool_t * const p_pool,
+ IN cl_pool_item_t * const p_pool_item)
{
- CL_ASSERT( p_pool );
- cl_qcpool_put( &p_pool->qcpool, p_pool_item );
+ CL_ASSERT(p_pool);
+ cl_qcpool_put(&p_pool->qcpool, p_pool_item);
}
+
/*
* PARAMETERS
* p_pool
@@ -548,13 +536,12 @@ cl_qpool_put(
* SYNOPSIS
*/
static inline void
-cl_qpool_put_list(
- IN cl_qpool_t* const p_pool,
- IN cl_qlist_t* const p_list )
+cl_qpool_put_list(IN cl_qpool_t * const p_pool, IN cl_qlist_t * const p_list)
{
- CL_ASSERT( p_pool );
- cl_qcpool_put_list( &p_pool->qcpool, p_list );
+ CL_ASSERT(p_pool);
+ cl_qcpool_put_list(&p_pool->qcpool, p_list);
}
+
/*
* PARAMETERS
* p_pool
@@ -589,13 +576,12 @@ cl_qpool_put_list(
* SYNOPSIS
*/
static inline cl_status_t
-cl_qpool_grow(
- IN cl_qpool_t* const p_pool,
- IN const size_t obj_count )
+cl_qpool_grow(IN cl_qpool_t * const p_pool, IN const size_t obj_count)
{
- CL_ASSERT( p_pool );
- return( cl_qcpool_grow( &p_pool->qcpool, obj_count ) );
+ CL_ASSERT(p_pool);
+ return (cl_qcpool_grow(&p_pool->qcpool, obj_count));
}
+
/*
* PARAMETERS
* p_pool
@@ -623,5 +609,4 @@ cl_qpool_grow(
*********/
END_C_DECLS
-
-#endif /* _CL_QUICK_POOL_H_ */
+#endif /* _CL_QUICK_POOL_H_ */
diff --git a/opensm/include/complib/cl_spinlock.h b/opensm/include/complib/cl_spinlock.h
index 89ca2b5..2e4cdf3 100644
--- a/opensm/include/complib/cl_spinlock.h
+++ b/opensm/include/complib/cl_spinlock.h
@@ -51,13 +51,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Public/Spinlock
* NAME
* Spinlock
@@ -81,7 +80,6 @@ BEGIN_C_DECLS
* cl_spinlock_acquire, cl_spinlock_release
* cl_spinlock_acquire_irq, cl_spinlock_release_irq
*********/
-
/****f* Component Library: Spinlock/cl_spinlock_construct
* NAME
* cl_spinlock_construct
@@ -92,9 +90,7 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-void
-cl_spinlock_construct(
- IN cl_spinlock_t* const p_spinlock );
+void cl_spinlock_construct(IN cl_spinlock_t * const p_spinlock);
/*
* PARAMETERS
* p_spin_lock
@@ -123,9 +119,7 @@ cl_spinlock_construct(
*
* SYNOPSIS
*/
-cl_status_t
-cl_spinlock_init(
- IN cl_spinlock_t* const p_spinlock );
+cl_status_t cl_spinlock_init(IN cl_spinlock_t * const p_spinlock);
/*
* PARAMETERS
* p_spin_lock
@@ -159,9 +153,7 @@ cl_spinlock_init(
*
* SYNOPSIS
*/
-void
-cl_spinlock_destroy(
- IN cl_spinlock_t* const p_spinlock );
+void cl_spinlock_destroy(IN cl_spinlock_t * const p_spinlock);
/*
* PARAMETERS
* p_spin_lock
@@ -192,9 +184,7 @@ cl_spinlock_destroy(
*
* SYNOPSIS
*/
-void
-cl_spinlock_acquire(
- IN cl_spinlock_t* const p_spinlock );
+void cl_spinlock_acquire(IN cl_spinlock_t * const p_spinlock);
/*
* PARAMETERS
* p_spin_lock
@@ -220,9 +210,7 @@ cl_spinlock_acquire(
*
* SYNOPSIS
*/
-void
-cl_spinlock_acquire_irq(
- IN cl_spinlock_t* const p_spinlock );
+void cl_spinlock_acquire_irq(IN cl_spinlock_t * const p_spinlock);
/*
* PARAMETERS
* p_spin_lock
@@ -244,9 +232,7 @@ cl_spinlock_acquire_irq(
*
* SYNOPSIS
*/
-void
-cl_spinlock_release(
- IN cl_spinlock_t* const p_spinlock );
+void cl_spinlock_release(IN cl_spinlock_t * const p_spinlock);
/*
* PARAMETERS
* p_spin_lock
@@ -271,9 +257,7 @@ cl_spinlock_release(
*
* SYNOPSIS
*/
-void
-cl_spinlock_release_irq(
- IN cl_spinlock_t* const p_spinlock );
+void cl_spinlock_release_irq(IN cl_spinlock_t * const p_spinlock);
/*
* PARAMETERS
* p_spin_lock
@@ -290,5 +274,4 @@ cl_spinlock_release_irq(
*********/
END_C_DECLS
-
-#endif /* _CL_SPINLOCK_H_ */
+#endif /* _CL_SPINLOCK_H_ */
diff --git a/opensm/include/complib/cl_spinlock_osd.h b/opensm/include/complib/cl_spinlock_osd.h
index ff8cded..5800340 100644
--- a/opensm/include/complib/cl_spinlock_osd.h
+++ b/opensm/include/complib/cl_spinlock_osd.h
@@ -49,23 +49,19 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
#include <complib/cl_types.h>
-#include <pthread.h> /* usr/include/ */
-
-typedef struct _cl_spinlock_t
-{
- pthread_mutex_t mutex;
- cl_state_t state;
+#include <pthread.h> /* usr/include/ */
+ typedef struct _cl_spinlock_t {
+ pthread_mutex_t mutex;
+ cl_state_t state;
} cl_spinlock_t;
END_C_DECLS
-
-#endif /* _CL_SPINLOCK_OSD_H_ */
+#endif /* _CL_SPINLOCK_OSD_H_ */
diff --git a/opensm/include/complib/cl_thread.h b/opensm/include/complib/cl_thread.h
index ac90b0a..fdd73a9 100644
--- a/opensm/include/complib/cl_thread.h
+++ b/opensm/include/complib/cl_thread.h
@@ -51,13 +51,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****i* Component Library/Thread
* NAME
* Thread
@@ -68,7 +67,6 @@ BEGIN_C_DECLS
* The cl_thread_t structure should be treated as opaque and should be
* manipulated only through the provided functions.
*********/
-
/****d* Component Library: Thread/cl_pfn_thread_callback_t
* NAME
* cl_pfn_thread_callback_t
@@ -79,9 +77,8 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-typedef void
-(*cl_pfn_thread_callback_t)(
- IN void* context );
+ typedef void
+ (*cl_pfn_thread_callback_t) (IN void *context);
/*
* PARAMETERS
* context
@@ -110,12 +107,11 @@ typedef void
*
* SYNOPSIS
*/
-typedef struct _cl_thread
-{
- cl_thread_osd_t osd;
- cl_pfn_thread_callback_t pfn_callback;
- const void *context;
- char name[16];
+typedef struct _cl_thread {
+ cl_thread_osd_t osd;
+ cl_pfn_thread_callback_t pfn_callback;
+ const void *context;
+ char name[16];
} cl_thread_t;
/*
@@ -145,9 +141,7 @@ typedef struct _cl_thread
*
* SYNOPSIS
*/
-void
-cl_thread_construct(
- IN cl_thread_t* const p_thread );
+void cl_thread_construct(IN cl_thread_t * const p_thread);
/*
* PARAMETERS
* p_thread
@@ -176,11 +170,9 @@ cl_thread_construct(
* SYNOPSIS
*/
cl_status_t
-cl_thread_init(
- IN cl_thread_t* const p_thread,
- IN cl_pfn_thread_callback_t pfn_callback,
- IN const void* const context,
- IN const char* const name );
+cl_thread_init(IN cl_thread_t * const p_thread,
+ IN cl_pfn_thread_callback_t pfn_callback,
+ IN const void *const context, IN const char *const name);
/*
* PARAMETERS
* p_thread
@@ -228,9 +220,7 @@ cl_thread_init(
*
* SYNOPSIS
*/
-void
-cl_thread_destroy(
- IN cl_thread_t* const p_thread );
+void cl_thread_destroy(IN cl_thread_t * const p_thread);
/*
* PARAMETERS
* p_thread
@@ -261,9 +251,7 @@ cl_thread_destroy(
*
* SYNOPSIS
*/
-void
-cl_thread_suspend(
- IN const uint32_t pause_ms );
+void cl_thread_suspend(IN const uint32_t pause_ms);
/*
* PARAMETERS
* pause_ms
@@ -291,9 +279,7 @@ cl_thread_suspend(
*
* SYNOPSIS
*/
-void
-cl_thread_stall(
- IN const uint32_t pause_us );
+void cl_thread_stall(IN const uint32_t pause_us);
/*
* PARAMETERS
* pause_us
@@ -321,8 +307,7 @@ cl_thread_stall(
*
* SYNOPSIS
*/
-int
-cl_proc_count( void );
+int cl_proc_count(void);
/*
* RETURN VALUE
* Returns the number of processors in the system.
@@ -338,9 +323,7 @@ cl_proc_count( void );
*
* SYNOPSIS
*/
-boolean_t
-cl_is_current_thread(
- IN const cl_thread_t* const p_thread );
+boolean_t cl_is_current_thread(IN const cl_thread_t * const p_thread);
/*
* PARAMETERS
* p_thread
@@ -367,8 +350,7 @@ cl_is_current_thread(
*
* SYNOPSIS
*/
-boolean_t
-cl_is_blockable( void );
+boolean_t cl_is_blockable(void);
/*
* RETURN VALUE
* TRUE
@@ -378,5 +360,4 @@ cl_is_blockable( void );
*********/
END_C_DECLS
-
-#endif /* _CL_THREAD_H_ */
+#endif /* _CL_THREAD_H_ */
diff --git a/opensm/include/complib/cl_thread_osd.h b/opensm/include/complib/cl_thread_osd.h
index a67b157..69ae1d2 100644
--- a/opensm/include/complib/cl_thread_osd.h
+++ b/opensm/include/complib/cl_thread_osd.h
@@ -49,31 +49,26 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
#include <complib/cl_types.h>
#include <complib/cl_event.h>
#include <pthread.h>
-
/* Linux user mode thread object structure definition. */
-typedef struct _cl_thread_osd_t
-{
- pthread_t id;
- cl_state_t state;
+ typedef struct _cl_thread_osd_t {
+ pthread_t id;
+ cl_state_t state;
} cl_thread_osd_t;
-static inline boolean_t
-cl_is_blockable ( void )
+static inline boolean_t cl_is_blockable(void)
{
return TRUE;
}
END_C_DECLS
-
-#endif /* _CL_THREAD_OSD_H_ */
+#endif /* _CL_THREAD_OSD_H_ */
diff --git a/opensm/include/complib/cl_threadpool.h b/opensm/include/complib/cl_threadpool.h
index eafbfa7..c136d2d 100644
--- a/opensm/include/complib/cl_threadpool.h
+++ b/opensm/include/complib/cl_threadpool.h
@@ -53,13 +53,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Thread Pool
* NAME
* Thread Pool
@@ -85,7 +84,6 @@ BEGIN_C_DECLS
* Manipulation
* cl_thread_pool_signal
*********/
-
/****s* Component Library: Thread Pool/cl_thread_pool_t
* NAME
* cl_thread_pool_t
@@ -98,9 +96,8 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-typedef struct _cl_thread_pool
-{
- void (*pfn_callback)(void*);
+ typedef struct _cl_thread_pool {
+ void (*pfn_callback) (void *);
void *context;
unsigned running_count;
unsigned events;
@@ -146,12 +143,10 @@ typedef struct _cl_thread_pool
* SYNOPSIS
*/
cl_status_t
-cl_thread_pool_init(
- IN cl_thread_pool_t* const p_thread_pool,
- IN unsigned count,
- IN void (*pfn_callback)(void*),
- IN void *context,
- IN const char* const name );
+cl_thread_pool_init(IN cl_thread_pool_t * const p_thread_pool,
+ IN unsigned count,
+ IN void (*pfn_callback) (void *),
+ IN void *context, IN const char *const name);
/*
* PARAMETERS
* p_thread_pool
@@ -201,9 +196,7 @@ cl_thread_pool_init(
*
* SYNOPSIS
*/
-void
-cl_thread_pool_destroy(
- IN cl_thread_pool_t* const p_thread_pool );
+void cl_thread_pool_destroy(IN cl_thread_pool_t * const p_thread_pool);
/*
* PARAMETERS
* p_thread_pool
@@ -235,9 +228,7 @@ cl_thread_pool_destroy(
*
* SYNOPSIS
*/
-cl_status_t
-cl_thread_pool_signal(
- IN cl_thread_pool_t* const p_thread_pool );
+cl_status_t cl_thread_pool_signal(IN cl_thread_pool_t * const p_thread_pool);
/*
* PARAMETERS
* p_thread_pool
@@ -259,5 +250,4 @@ cl_thread_pool_signal(
*********/
END_C_DECLS
-
-#endif /* _CL_THREAD_POOL_H_ */
+#endif /* _CL_THREAD_POOL_H_ */
diff --git a/opensm/include/complib/cl_timer.h b/opensm/include/complib/cl_timer.h
index 29fef88..fdbfb31 100644
--- a/opensm/include/complib/cl_timer.h
+++ b/opensm/include/complib/cl_timer.h
@@ -51,13 +51,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Timer
* NAME
* Timer
@@ -85,7 +84,6 @@ BEGIN_C_DECLS
* Manipulation:
* cl_timer_start, cl_timer_stop
*********/
-
/****d* Component Library: Timer/cl_pfn_timer_callback_t
* NAME
* cl_pfn_timer_callback_t
@@ -96,9 +94,8 @@ BEGIN_C_DECLS
*
* SYNOPSIS
*/
-typedef void
-(*cl_pfn_timer_callback_t)(
- IN void* context );
+ typedef void
+ (*cl_pfn_timer_callback_t) (IN void *context);
/*
* PARAMETERS
* context
@@ -130,9 +127,7 @@ typedef void
*
* SYNOPSIS
*/
-void
-cl_timer_construct(
- IN cl_timer_t* const p_timer );
+void cl_timer_construct(IN cl_timer_t * const p_timer);
/*
* PARAMETERS
* p_timer
@@ -161,10 +156,9 @@ cl_timer_construct(
* SYNOPSIS
*/
cl_status_t
-cl_timer_init(
- IN cl_timer_t* const p_timer,
- IN cl_pfn_timer_callback_t pfn_callback,
- IN const void* const context );
+cl_timer_init(IN cl_timer_t * const p_timer,
+ IN cl_pfn_timer_callback_t pfn_callback,
+ IN const void *const context);
/*
* PARAMETERS
* p_timer
@@ -200,9 +194,7 @@ cl_timer_init(
*
* SYNOPSIS
*/
-void
-cl_timer_destroy(
- IN cl_timer_t* const p_timer );
+void cl_timer_destroy(IN cl_timer_t * const p_timer);
/*
* PARAMETERS
* p_timer
@@ -231,9 +223,7 @@ cl_timer_destroy(
* SYNOPSIS
*/
cl_status_t
-cl_timer_start(
- IN cl_timer_t* const p_timer,
- IN const uint32_t time_ms );
+cl_timer_start(IN cl_timer_t * const p_timer, IN const uint32_t time_ms);
/*
* PARAMETERS
* p_timer
@@ -267,9 +257,7 @@ cl_timer_start(
*
* SYNOPSIS
*/
-void
-cl_timer_stop(
- IN cl_timer_t* const p_timer );
+void cl_timer_stop(IN cl_timer_t * const p_timer);
/*
* PARAMETERS
* p_timer
@@ -297,9 +285,7 @@ cl_timer_stop(
* SYNOPSIS
*/
cl_status_t
-cl_timer_trim(
- IN cl_timer_t* const p_timer,
- IN const uint32_t time_ms );
+cl_timer_trim(IN cl_timer_t * const p_timer, IN const uint32_t time_ms);
/*
* PARAMETERS
* p_timer
@@ -337,8 +323,7 @@ cl_timer_trim(
*
* SYNOPSIS
*/
-uint64_t
-cl_get_time_stamp( void );
+uint64_t cl_get_time_stamp(void);
/*
* RETURN VALUE
* Time elapsed, in microseconds, since the system was booted.
@@ -357,8 +342,7 @@ cl_get_time_stamp( void );
*
* SYNOPSIS
*/
-uint32_t
-cl_get_time_stamp_sec( void );
+uint32_t cl_get_time_stamp_sec(void);
/*
* RETURN VALUE
* Time elapsed, in seconds, since the system was booted.
@@ -368,5 +352,4 @@ cl_get_time_stamp_sec( void );
*********/
END_C_DECLS
-
-#endif /* _CL_TIMER_H_ */
+#endif /* _CL_TIMER_H_ */
diff --git a/opensm/include/complib/cl_timer_osd.h b/opensm/include/complib/cl_timer_osd.h
index a5a3802..962cdfb 100644
--- a/opensm/include/complib/cl_timer_osd.h
+++ b/opensm/include/complib/cl_timer_osd.h
@@ -52,44 +52,36 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
#include <complib/cl_qlist.h>
#include <pthread.h>
-
-typedef enum _cl_timer_state
-{
+ typedef enum _cl_timer_state {
CL_TIMER_IDLE,
CL_TIMER_QUEUED,
CL_TIMER_RUNNING
-
} cl_timer_state_t;
-typedef struct _cl_timer_t
-{
- cl_list_item_t list_item;
- cl_timer_state_t timer_state;
- cl_state_t state;
- cl_pfn_timer_callback_t pfn_callback;
- const void *context;
- pthread_cond_t cond;
- struct timespec timeout;
+typedef struct _cl_timer_t {
+ cl_list_item_t list_item;
+ cl_timer_state_t timer_state;
+ cl_state_t state;
+ cl_pfn_timer_callback_t pfn_callback;
+ const void *context;
+ pthread_cond_t cond;
+ struct timespec timeout;
} cl_timer_t;
/* Internal functions to create the timer provider. */
-cl_status_t
-__cl_timer_prov_create( void );
+cl_status_t __cl_timer_prov_create(void);
/* Internal function to destroy the timer provider. */
-void
-__cl_timer_prov_destroy( void );
+void __cl_timer_prov_destroy(void);
END_C_DECLS
-
-#endif /* _CL_TIMER_OSD_H_ */
+#endif /* _CL_TIMER_OSD_H_ */
diff --git a/opensm/include/complib/cl_types.h b/opensm/include/complib/cl_types.h
index 549250a..2663989 100644
--- a/opensm/include/complib/cl_types.h
+++ b/opensm/include/complib/cl_types.h
@@ -53,34 +53,32 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
#include <complib/cl_types_osd.h>
#include <stddef.h>
-
-typedef uint16_t net16_t;
-typedef uint32_t net32_t;
-typedef uint64_t net64_t;
+typedef uint16_t net16_t;
+typedef uint32_t net32_t;
+typedef uint64_t net64_t;
/* explicit cast of void* to uint32_t */
#ifndef ASSERT_VOIDP2UINTN
#if __WORDSIZE == 64
#define ASSERT_VOIDP2UINTN(var) \
CL_ASSERT( (intptr_t)var <= 0xffffffffffffffffL )
-#else /* __WORDSIZE == 64 */
+#else /* __WORDSIZE == 64 */
#if __WORDSIZE == 32
/* need to cast carefully to avoid the warining of un-needed check */
#define ASSERT_VOIDP2UINTN(var) \
CL_ASSERT( (intptr_t)var <= 0x100000000ULL )
-#else /* __WORDSIZE == 32 */
+#else /* __WORDSIZE == 32 */
#error "Need to know WORDSIZE to tell how to cast to unsigned long int"
-#endif /* __WORDSIZE == 32 */
-#endif /* __WORDSIZE == 64 */
+#endif /* __WORDSIZE == 32 */
+#endif /* __WORDSIZE == 64 */
#endif
/* explicit casting of void* to long */
@@ -188,10 +186,10 @@ typedef uint64_t net64_t;
* keyword, if used, follows the parameter name.
*********/
#ifndef IN
-#define IN /* Function input parameter */
+#define IN /* Function input parameter */
#endif
#ifndef OUT
-#define OUT /* Function output parameter */
+#define OUT /* Function output parameter */
#endif
#ifndef OPTIONAL
#define OPTIONAL /* Optional function parameter - NULL if not used */
@@ -278,8 +276,7 @@ typedef uint64_t net64_t;
*
* SYNOPSIS
*/
-typedef enum _cl_status
-{
+typedef enum _cl_status {
CL_SUCCESS = 0,
CL_ERROR,
CL_INVALID_STATE,
@@ -302,8 +299,7 @@ typedef enum _cl_status
CL_DISCONNECT,
CL_DUPLICATE,
- CL_STATUS_COUNT /* should be the last value */
-
+ CL_STATUS_COUNT /* should be the last value */
} cl_status_t;
/*
* SEE ALSO
@@ -311,7 +307,7 @@ typedef enum _cl_status
*********/
/* Status values above converted to text for easier printing. */
-extern const char* cl_status_text[];
+extern const char *cl_status_text[];
#ifndef cl_panic
/****f* Component Library: Error Trapping/cl_panic
@@ -324,10 +320,7 @@ extern const char* cl_status_text[];
*
* SYNOPSIS
*/
-void
-cl_panic(
- IN const char* const message,
- IN ... );
+void cl_panic(IN const char *const message, IN ...);
/*
* PARAMETERS
* message
@@ -346,7 +339,7 @@ cl_panic(
*
* cl_panic sends the message to the current message logging target.
*********/
-#endif /* cl_panic */
+#endif /* cl_panic */
/****d* Component Library: Data Types/CL_STATUS_MSG
* NAME
@@ -382,11 +375,11 @@ cl_panic(
#if !defined( FALSE )
#define FALSE 0
-#endif /* !defined( TRUE ) */
+#endif /* !defined( TRUE ) */
#if !defined( TRUE )
#define TRUE (!FALSE)
-#endif /* !defined( TRUE ) */
+#endif /* !defined( TRUE ) */
/****d* Component Library: Unreferenced Parameters/UNUSED_PARAM
* NAME
@@ -415,13 +408,11 @@ cl_panic(
*
* SYNOPSIS
*/
-typedef enum _cl_state
-{
+typedef enum _cl_state {
CL_UNINITIALIZED = 1,
CL_INITIALIZED,
CL_DESTROYING,
CL_DESTROYED
-
} cl_state_t;
/*
* VALUES
@@ -449,13 +440,12 @@ typedef enum _cl_state
*
* SYNOPSIS
*/
-static inline boolean_t
-cl_is_state_valid(
- IN const cl_state_t state )
+static inline boolean_t cl_is_state_valid(IN const cl_state_t state)
{
- return( (state == CL_UNINITIALIZED) || (state == CL_INITIALIZED) ||
- (state == CL_DESTROYING) || (state == CL_DESTROYED) );
+ return ((state == CL_UNINITIALIZED) || (state == CL_INITIALIZED) ||
+ (state == CL_DESTROYING) || (state == CL_DESTROYED));
}
+
/*
* PARAMETERS
* state
@@ -476,5 +466,4 @@ cl_is_state_valid(
*********/
END_C_DECLS
-
-#endif /* _DATA_TYPES_H_ */
+#endif /* _DATA_TYPES_H_ */
diff --git a/opensm/include/complib/cl_types_osd.h b/opensm/include/complib/cl_types_osd.h
index 9d22847..fe7e829 100644
--- a/opensm/include/complib/cl_types_osd.h
+++ b/opensm/include/complib/cl_types_osd.h
@@ -52,40 +52,36 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
#if defined (_DEBUG_)
#ifdef __IA64__
#define cl_break() asm(" break 0")
-#else /* __IA64__ */
+#else /* __IA64__ */
#define cl_break() asm(" int $3")
-#endif /* __IA64__ */
-#else /* _DEBUG_ */
+#endif /* __IA64__ */
+#else /* _DEBUG_ */
#define cl_break
#endif
-
#include <inttypes.h>
#include <assert.h>
#include <string.h>
-
#if defined (_DEBUG_)
#define CL_ASSERT assert
-#else /* _DEBUG_ */
+#else /* _DEBUG_ */
#define CL_ASSERT( __exp__ )
-#endif /* _DEBUG_ */
-
+#endif /* _DEBUG_ */
/*
* Types not explicitly defined are native to the platform.
*/
-typedef unsigned long uintn_t;
-typedef long intn_t;
-typedef int boolean_t;
-typedef volatile int32_t atomic32_t;
+typedef unsigned long uintn_t;
+typedef long intn_t;
+typedef int boolean_t;
+typedef volatile int32_t atomic32_t;
#ifndef NULL
#define NULL (void*)0
@@ -94,5 +90,4 @@ typedef volatile int32_t atomic32_t;
#define UNUSED_PARAM( P )
END_C_DECLS
-
-#endif /* _CL_TYPES_OSD_H_ */
+#endif /* _CL_TYPES_OSD_H_ */
diff --git a/opensm/include/complib/cl_vector.h b/opensm/include/complib/cl_vector.h
index 049e223..e1e8ca7 100644
--- a/opensm/include/complib/cl_vector.h
+++ b/opensm/include/complib/cl_vector.h
@@ -53,13 +53,12 @@
#ifdef __cplusplus
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
-#else /* !__cplusplus */
+#else /* !__cplusplus */
# define BEGIN_C_DECLS
# define END_C_DECLS
-#endif /* __cplusplus */
+#endif /* __cplusplus */
BEGIN_C_DECLS
-
/****h* Component Library/Vector
* NAME
* Vector
@@ -108,7 +107,6 @@ BEGIN_C_DECLS
* cl_vector_find_from_start, cl_vector_find_from_end
* cl_vector_apply_func
*********/
-
/****d* Component Library: Vector/cl_pfn_vec_init_t
* NAME
* cl_pfn_vec_init_t
@@ -120,9 +118,7 @@ BEGIN_C_DECLS
* SYNOPSIS
*/
typedef cl_status_t
-(*cl_pfn_vec_init_t)(
- IN void* const p_element,
- IN void* context );
+ (*cl_pfn_vec_init_t) (IN void *const p_element, IN void *context);
/*
* PARAMETERS
* p_element
@@ -161,9 +157,7 @@ typedef cl_status_t
* SYNOPSIS
*/
typedef void
-(*cl_pfn_vec_dtor_t)(
- IN void* const p_element,
- IN void* context );
+ (*cl_pfn_vec_dtor_t) (IN void *const p_element, IN void *context);
/*
* PARAMETERS
* p_element
@@ -195,10 +189,8 @@ typedef void
* SYNOPSIS
*/
typedef void
-(*cl_pfn_vec_apply_t)(
- IN const size_t index,
- IN void* const p_element,
- IN void* context );
+ (*cl_pfn_vec_apply_t) (IN const size_t index,
+ IN void *const p_element, IN void *context);
/*
* PARAMETERS
* index
@@ -233,10 +225,8 @@ typedef void
* SYNOPSIS
*/
typedef cl_status_t
-(*cl_pfn_vec_find_t)(
- IN const size_t index,
- IN const void* const p_element,
- IN void* context );
+ (*cl_pfn_vec_find_t) (IN const size_t index,
+ IN const void *const p_element, IN void *context);
/*
* PARAMETERS
* index
@@ -274,10 +264,8 @@ typedef cl_status_t
* SYNOPSIS
*/
typedef void
-(*cl_pfn_vec_copy_t)(
- IN void* const p_dest,
- IN const void* const p_src,
- IN const size_t size );
+ (*cl_pfn_vec_copy_t) (IN void *const p_dest,
+ IN const void *const p_src, IN const size_t size);
/*
* PARAMETERS
* p_dest
@@ -308,19 +296,18 @@ typedef void
*
* SYNOPSIS
*/
-typedef struct _cl_vector
-{
- size_t size;
- size_t grow_size;
- size_t capacity;
- size_t element_size;
- cl_pfn_vec_init_t pfn_init;
- cl_pfn_vec_dtor_t pfn_dtor;
- cl_pfn_vec_copy_t pfn_copy;
- const void *context;
- cl_qlist_t alloc_list;
- void **p_ptr_array;
- cl_state_t state;
+typedef struct _cl_vector {
+ size_t size;
+ size_t grow_size;
+ size_t capacity;
+ size_t element_size;
+ cl_pfn_vec_init_t pfn_init;
+ cl_pfn_vec_dtor_t pfn_dtor;
+ cl_pfn_vec_copy_t pfn_copy;
+ const void *context;
+ cl_qlist_t alloc_list;
+ void **p_ptr_array;
+ cl_state_t state;
} cl_vector_t;
/*
@@ -371,9 +358,7 @@ typedef struct _cl_vector
*
* SYNOPSIS
*/
-void
-cl_vector_construct(
- IN cl_vector_t* const p_vector );
+void cl_vector_construct(IN cl_vector_t * const p_vector);
/*
* PARAMETERS
* p_vector
@@ -402,14 +387,13 @@ cl_vector_construct(
* SYNOPSIS
*/
cl_status_t
-cl_vector_init(
- IN cl_vector_t* const p_vector,
- IN const size_t min_size,
- IN const size_t grow_size,
- IN const size_t element_size,
- IN cl_pfn_vec_init_t pfn_init OPTIONAL,
- IN cl_pfn_vec_dtor_t pfn_dtor OPTIONAL,
- IN const void* const context );
+cl_vector_init(IN cl_vector_t * const p_vector,
+ IN const size_t min_size,
+ IN const size_t grow_size,
+ IN const size_t element_size,
+ IN cl_pfn_vec_init_t pfn_init OPTIONAL,
+ IN cl_pfn_vec_dtor_t pfn_dtor OPTIONAL,
+ IN const void *const context);
/*
* PARAMETERS
* p_vector
@@ -464,9 +448,7 @@ cl_vector_init(
*
* SYNOPSIS
*/
-void
-cl_vector_destroy(
- IN cl_vector_t* const p_vector );
+void cl_vector_destroy(IN cl_vector_t * const p_vector);
/*
* PARAMETERS
* p_vector
@@ -496,14 +478,14 @@ cl_vector_destroy(
* SYNOPSIS
*/
static inline size_t
-cl_vector_get_capacity(
- IN const cl_vector_t* const p_vector )
+cl_vector_get_capacity(IN const cl_vector_t * const p_vector)
{
- CL_ASSERT( p_vector );
- CL_ASSERT( p_vector->state == CL_INITIALIZED );
+ CL_ASSERT(p_vector);
+ CL_ASSERT(p_vector->state == CL_INITIALIZED);
- return( p_vector->capacity );
+ return (p_vector->capacity);
}
+
/*
* PARAMETERS
* p_vector
@@ -530,15 +512,14 @@ cl_vector_get_capacity(
*
* SYNOPSIS
*/
-static inline size_t
-cl_vector_get_size(
- IN const cl_vector_t* const p_vector )
+static inline size_t cl_vector_get_size(IN const cl_vector_t * const p_vector)
{
- CL_ASSERT( p_vector );
- CL_ASSERT( p_vector->state == CL_INITIALIZED );
+ CL_ASSERT(p_vector);
+ CL_ASSERT(p_vector->state == CL_INITIALIZED);
- return( p_vector->size );
+ return (p_vector->size);
}
+
/*
* PARAMETERS
* p_vector
@@ -561,16 +542,15 @@ cl_vector_get_size(
*
* SYNOPSIS
*/
-static inline void*
-cl_vector_get_ptr(
- IN const cl_vector_t* const p_vector,
- IN const size_t index )
+static inline void *cl_vector_get_ptr(IN const cl_vector_t * const p_vector,
+ IN const size_t index)
{
- CL_ASSERT( p_vector );
- CL_ASSERT( p_vector->state == CL_INITIALIZED );
+ CL_ASSERT(p_vector);
+ CL_ASSERT(p_vector->state == CL_INITIALIZED);
- return( p_vector->p_ptr_array[index] );
+ return (p_vector->p_ptr_array[index]);
}
+
/*
* PARAMETERS
* p_vector
@@ -604,21 +584,20 @@ cl_vector_get_ptr(
* SYNOPSIS
*/
static inline void
-cl_vector_get(
- IN const cl_vector_t* const p_vector,
- IN const size_t index,
- OUT void* const p_element )
+cl_vector_get(IN const cl_vector_t * const p_vector,
+ IN const size_t index, OUT void *const p_element)
{
void *p_src;
- CL_ASSERT( p_vector );
- CL_ASSERT( p_vector->state == CL_INITIALIZED );
- CL_ASSERT( p_element );
+ CL_ASSERT(p_vector);
+ CL_ASSERT(p_vector->state == CL_INITIALIZED);
+ CL_ASSERT(p_element);
/* Get a pointer to the element. */
- p_src = cl_vector_get_ptr( p_vector, index );
- p_vector->pfn_copy( p_src, p_element, p_vector->element_size );
+ p_src = cl_vector_get_ptr(p_vector, index);
+ p_vector->pfn_copy(p_src, p_element, p_vector->element_size);
}
+
/*
* PARAMETERS
* p_vector
@@ -661,10 +640,8 @@ cl_vector_get(
* SYNOPSIS
*/
cl_status_t
-cl_vector_at(
- IN const cl_vector_t* const p_vector,
- IN const size_t index,
- OUT void* const p_element );
+cl_vector_at(IN const cl_vector_t * const p_vector,
+ IN const size_t index, OUT void *const p_element);
/*
* PARAMETERS
* p_vector
@@ -703,10 +680,8 @@ cl_vector_at(
* SYNOPSIS
*/
cl_status_t
-cl_vector_set(
- IN cl_vector_t* const p_vector,
- IN const size_t index,
- IN void* const p_element );
+cl_vector_set(IN cl_vector_t * const p_vector,
+ IN const size_t index, IN void *const p_element);
/*
* PARAMETERS
* p_vector
@@ -745,9 +720,8 @@ cl_vector_set(
* SYNOPSIS
*/
cl_status_t
-cl_vector_set_capacity(
- IN cl_vector_t* const p_vector,
- IN const size_t new_capacity );
+cl_vector_set_capacity(IN cl_vector_t * const p_vector,
+ IN const size_t new_capacity);
/*
* PARAMETERS
* p_vector
@@ -784,9 +758,7 @@ cl_vector_set_capacity(
* SYNOPSIS
*/
cl_status_t
-cl_vector_set_size(
- IN cl_vector_t* const p_vector,
- IN const size_t size );
+cl_vector_set_size(IN cl_vector_t * const p_vector, IN const size_t size);
/*
* PARAMETERS
* p_vector
@@ -826,9 +798,8 @@ cl_vector_set_size(
* SYNOPSIS
*/
cl_status_t
-cl_vector_set_min_size(
- IN cl_vector_t* const p_vector,
- IN const size_t min_size );
+cl_vector_set_min_size(IN cl_vector_t * const p_vector,
+ IN const size_t min_size);
/*
* PARAMETERS
* p_vector
@@ -865,10 +836,9 @@ cl_vector_set_min_size(
* SYNOPSIS
*/
void
-cl_vector_apply_func(
- IN const cl_vector_t* const p_vector,
- IN cl_pfn_vec_apply_t pfn_callback,
- IN const void* const context );
+cl_vector_apply_func(IN const cl_vector_t * const p_vector,
+ IN cl_pfn_vec_apply_t pfn_callback,
+ IN const void *const context);
/*
* PARAMETERS
* p_vector
@@ -905,10 +875,9 @@ cl_vector_apply_func(
* SYNOPSIS
*/
size_t
-cl_vector_find_from_start(
- IN const cl_vector_t* const p_vector,
- IN cl_pfn_vec_find_t pfn_callback,
- IN const void* const context );
+cl_vector_find_from_start(IN const cl_vector_t * const p_vector,
+ IN cl_pfn_vec_find_t pfn_callback,
+ IN const void *const context);
/*
* PARAMETERS
* p_vector
@@ -947,10 +916,9 @@ cl_vector_find_from_start(
* SYNOPSIS
*/
size_t
-cl_vector_find_from_end(
- IN const cl_vector_t* const p_vector,
- IN cl_pfn_vec_find_t pfn_callback,
- IN const void* const context );
+cl_vector_find_from_end(IN const cl_vector_t * const p_vector,
+ IN cl_pfn_vec_find_t pfn_callback,
+ IN const void *const context);
/*
* PARAMETERS
* p_vector
@@ -980,5 +948,4 @@ cl_vector_find_from_end(
*********/
END_C_DECLS
-
-#endif /* _CL_VECTOR_H_ */
+#endif /* _CL_VECTOR_H_ */
--
1.5.3.rc2.38.g11308
More information about the general
mailing list