[openib-general] [PATCH][SDP][3/22] Remove use of leading underscores in static names in sdp_buff.c
Tom Duffy
Tom.Duffy at Sun.COM
Mon Feb 28 14:00:30 PST 2005
Signed-off-by: Tom Duffy <tduffy at sun.com>
Index: drivers/infiniband/ulp/sdp/sdp_buff.c
===================================================================
--- drivers/infiniband/ulp/sdp/sdp_buff.c (revision 1929)
+++ drivers/infiniband/ulp/sdp/sdp_buff.c (working copy)
@@ -40,14 +40,14 @@ static struct sdpc_buff_root *main_pool
*/
/*
- * _sdp_buff_q_get - Get a buffer from a specific pool
+ * do_buff_q_get - Get a buffer from a specific pool
*/
-static inline struct sdpc_buff *_sdp_buff_q_get(struct sdpc_buff_q *pool,
- int fifo,
- int (*test_func)
+static inline struct sdpc_buff *do_buff_q_get(struct sdpc_buff_q *pool,
+ int fifo,
+ int (*test_func)
(struct sdpc_buff *buff,
void *arg),
- void *usr_arg)
+ void *usr_arg)
{
struct sdpc_buff *buff;
@@ -82,11 +82,10 @@ static inline struct sdpc_buff *_sdp_buf
}
/*
- * _sdp_buff_q_put - Place a buffer into a specific pool
+ * do_buff_q_put - Place a buffer into a specific pool
*/
-static inline int _sdp_buff_q_put(struct sdpc_buff_q *pool,
- struct sdpc_buff *buff,
- int fifo)
+static inline int do_buff_q_put(struct sdpc_buff_q *pool,
+ struct sdpc_buff *buff, int fifo)
{
/* fifo: false == tail, true == head */
if (buff->pool)
@@ -114,10 +113,10 @@ static inline int _sdp_buff_q_put(struct
}
/*
- * _sdp_buff_q_look - look at a buffer from a specific pool
+ * sdp_buff_q_look - look at a buffer from a specific pool
*/
-static inline struct sdpc_buff *_sdp_buff_q_look(struct sdpc_buff_q *pool,
- int fifo)
+static inline struct sdpc_buff *sdp_buff_q_look(struct sdpc_buff_q *pool,
+ int fifo)
{
if (!pool->head || fifo)
return pool->head;
@@ -126,10 +125,10 @@ static inline struct sdpc_buff *_sdp_buf
}
/*
- * _sdp_buff_q_remove - remove a specific buffer from a specific pool
+ * do_buff_q_remove - remove a specific buffer from a specific pool
*/
-static inline int _sdp_buff_q_remove(struct sdpc_buff_q *pool,
- struct sdpc_buff *buff)
+static inline int do_buff_q_remove(struct sdpc_buff_q *pool,
+ struct sdpc_buff *buff)
{
struct sdpc_buff *prev;
struct sdpc_buff *next;
@@ -175,7 +174,7 @@ int sdp_buff_q_remove(struct sdpc_buff *
struct sdpc_buff_q *pool;
pool = buff->pool;
- return _sdp_buff_q_remove(pool, buff);
+ return do_buff_q_remove(pool, buff);
}
/*
@@ -183,7 +182,7 @@ int sdp_buff_q_remove(struct sdpc_buff *
*/
struct sdpc_buff *sdp_buff_q_get(struct sdpc_buff_q *pool)
{
- return _sdp_buff_q_get(pool, 1, NULL, NULL);
+ return do_buff_q_get(pool, 1, NULL, NULL);
}
/*
@@ -191,7 +190,7 @@ struct sdpc_buff *sdp_buff_q_get(struct
*/
struct sdpc_buff *sdp_buff_q_get_head(struct sdpc_buff_q *pool)
{
- return _sdp_buff_q_get(pool, 1, NULL, NULL);
+ return do_buff_q_get(pool, 1, NULL, NULL);
}
/*
@@ -199,7 +198,7 @@ struct sdpc_buff *sdp_buff_q_get_head(st
*/
struct sdpc_buff *sdp_buff_q_get_tail(struct sdpc_buff_q *pool)
{
- return _sdp_buff_q_get(pool, 0, NULL, NULL);
+ return do_buff_q_get(pool, 0, NULL, NULL);
}
/*
@@ -207,7 +206,7 @@ struct sdpc_buff *sdp_buff_q_get_tail(st
*/
struct sdpc_buff *sdp_buff_q_look_head(struct sdpc_buff_q *pool)
{
- return _sdp_buff_q_look(pool, 1);
+ return sdp_buff_q_look(pool, 1);
}
/*
@@ -218,7 +217,7 @@ struct sdpc_buff *sdp_buff_q_fetch_head(
void *arg),
void *usr_arg)
{
- return _sdp_buff_q_get(pool, 1, test, usr_arg);
+ return do_buff_q_get(pool, 1, test, usr_arg);
}
/*
@@ -244,7 +243,7 @@ struct sdpc_buff *sdp_buff_q_fetch(struc
counter < pool->size; counter++, buff = buff->next) {
result = test(buff, usr_arg);
if (result > 0) {
- result = _sdp_buff_q_remove(pool, buff);
+ result = do_buff_q_remove(pool, buff);
SDP_EXPECT(result >= 0);
return buff;
@@ -290,41 +289,37 @@ int sdp_buff_q_trav_head(struct sdpc_buf
/*
* sdp_buff_q_put - Place a buffer into a specific pool
*/
-int sdp_buff_q_put(struct sdpc_buff_q *pool,
- struct sdpc_buff *buff)
+int sdp_buff_q_put(struct sdpc_buff_q *pool, struct sdpc_buff *buff)
{
- return _sdp_buff_q_put(pool, buff, 1);
+ return do_buff_q_put(pool, buff, 1);
}
/*
* sdp_buff_q_put_head - Place a buffer into the head of a specific pool
*/
-int sdp_buff_q_put_head(struct sdpc_buff_q *pool,
- struct sdpc_buff *buff)
+int sdp_buff_q_put_head(struct sdpc_buff_q *pool, struct sdpc_buff *buff)
{
- return _sdp_buff_q_put(pool, buff, 1);
+ return do_buff_q_put(pool, buff, 1);
}
/*
* sdp_buff_q_put_tail - Place a buffer into the tail of a specific pool
*/
-int sdp_buff_q_put_tail(struct sdpc_buff_q *pool,
- struct sdpc_buff *buff)
+int sdp_buff_q_put_tail(struct sdpc_buff_q *pool, struct sdpc_buff *buff)
{
- return _sdp_buff_q_put(pool, buff, 0);
+ return do_buff_q_put(pool, buff, 0);
}
/*
* sdp_buff_q_clear_unmap - clear the buffers out of a specific buffer pool
*/
-void sdp_buff_q_clear_unmap(struct sdpc_buff_q *pool,
- struct device *dev,
+void sdp_buff_q_clear_unmap(struct sdpc_buff_q *pool, struct device *dev,
int direction)
{
int result;
struct sdpc_buff *buff;
- while ((buff = _sdp_buff_q_get(pool, 0, NULL, NULL))) {
+ while ((buff = do_buff_q_get(pool, 0, NULL, NULL))) {
if (dev)
dma_unmap_single(dev, buff->real,
buff->tail - buff->data, direction);
@@ -341,9 +336,9 @@ void sdp_buff_q_clear_unmap(struct sdpc_
*/
/*
- * _sdp_buff_pool_release - release allocated buffers from the main pool
+ * sdp_buff_pool_release - release allocated buffers from the main pool
*/
-static void _sdp_buff_pool_release(struct sdpc_buff_root *m_pool, int count)
+static void sdp_buff_pool_release(struct sdpc_buff_root *m_pool, int count)
{
struct sdpc_buff *buff;
@@ -365,9 +360,9 @@ static void _sdp_buff_pool_release(struc
}
/*
- * _sdp_buff_pool_release_check - check for buffer release from main pool
+ * sdp_buff_pool_release_check - check for buffer release from main pool
*/
-static inline void _sdp_buff_pool_release_check(struct sdpc_buff_root *m_pool)
+static inline void sdp_buff_pool_release_check(struct sdpc_buff_root *m_pool)
{
/*
* If there are more then minimum buffers outstanding, free half of
@@ -383,14 +378,14 @@ static inline void _sdp_buff_pool_releas
count = min((m_pool->buff_cur - m_pool->buff_min),
(m_pool->free_mark/2));
- _sdp_buff_pool_release(m_pool, count);
+ sdp_buff_pool_release(m_pool, count);
}
}
/*
- * _sdp_buff_pool_alloc - allocate more buffers for the main pool
+ * sdp_buff_pool_alloc - allocate more buffers for the main pool
*/
-static int _sdp_buff_pool_alloc(struct sdpc_buff_root *m_pool)
+static int sdp_buff_pool_alloc(struct sdpc_buff_root *m_pool)
{
struct sdpc_buff *buff;
int total;
@@ -458,10 +453,7 @@ static int _sdp_buff_pool_alloc(struct s
/*
* sdp_buff_pool_init - Initialize the main buffer pool of memory
*/
-int sdp_buff_pool_init(int buff_min,
- int buff_max,
- int alloc_inc,
- int free_mark)
+int sdp_buff_pool_init(int buff_min, int buff_max, int alloc_inc, int free_mark)
{
int result;
@@ -522,7 +514,7 @@ int sdp_buff_pool_init(int buff_min,
/*
* allocate the minimum number of buffers.
*/
- result = _sdp_buff_pool_alloc(main_pool);
+ result = sdp_buff_pool_alloc(main_pool);
if (result < 0) {
sdp_warn("Error <%d> allocating buffers. <%d>",
result, buff_min);
@@ -558,7 +550,7 @@ void sdp_buff_pool_destroy(void)
/*
* Free all the buffers.
*/
- _sdp_buff_pool_release(main_pool, main_pool->buff_cur);
+ sdp_buff_pool_release(main_pool, main_pool->buff_cur);
/*
* Sanity check that the current number of buffers was released.
*/
@@ -596,7 +588,7 @@ struct sdpc_buff *sdp_buff_pool_get(void
spin_lock_irqsave(&main_pool->lock, flags);
if (!main_pool->pool.head) {
- result = _sdp_buff_pool_alloc(main_pool);
+ result = sdp_buff_pool_alloc(main_pool);
if (result < 0) {
sdp_warn("Error <%d> allocating buffers.", result);
spin_unlock_irqrestore(&main_pool->lock, flags);
@@ -670,7 +662,7 @@ int sdp_buff_pool_put(struct sdpc_buff *
main_pool->pool.size++;
- _sdp_buff_pool_release_check(main_pool);
+ sdp_buff_pool_release_check(main_pool);
spin_unlock_irqrestore(&main_pool->lock, flags);
@@ -732,7 +724,7 @@ int sdp_buff_pool_chain_put(struct sdpc_
main_pool->pool.size += count;
- (void)_sdp_buff_pool_release_check(main_pool);
+ (void)sdp_buff_pool_release_check(main_pool);
spin_unlock_irqrestore(&main_pool->lock, flags);
@@ -757,9 +749,7 @@ int sdp_buff_pool_buff_size(void)
/*
* sdp_proc_dump_buff_pool - write the buffer pool stats to a file (/proc)
*/
-int sdp_proc_dump_buff_pool(char *buffer,
- int max_size,
- off_t start_index,
+int sdp_proc_dump_buff_pool(char *buffer, int max_size, off_t start_index,
long *end_index)
{
unsigned long flags;
More information about the general
mailing list