* [PATCH 1/6] staging/lustre/lnet: remove kiblnd_debug_conn/rx/tx
@ 2014-03-05 13:27 Peng Tao
2014-03-05 13:27 ` [PATCH 2/6] staging/lustre/libcfs: remove cfs_strncasecmp Peng Tao
2014-03-09 3:23 ` [PATCH 1/6] staging/lustre/lnet: remove kiblnd_debug_conn/rx/tx Greg KH
0 siblings, 2 replies; 7+ messages in thread
From: Peng Tao @ 2014-03-05 13:27 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, Peng Tao, Andreas Dilger, Oleg Drokin
They are not called by anyone and cause gcc warning:
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c:609: warning: ‘kiblnd_debug_conn’
defined but not used
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c:589: warning: ‘kiblnd_debug_rx’
defined but not used
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c:597: warning: ‘kiblnd_debug_tx’
defined but not used
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
---
.../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 68 --------------------
1 files changed, 0 insertions(+), 68 deletions(-)
diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
index 0727998..d42c8f6 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
@@ -584,74 +584,6 @@ kiblnd_get_conn_by_idx(lnet_ni_t *ni, int index)
return NULL;
}
-static void
-kiblnd_debug_rx(kib_rx_t *rx)
-{
- CDEBUG(D_CONSOLE, " %p status %d msg_type %x cred %d\n",
- rx, rx->rx_status, rx->rx_msg->ibm_type,
- rx->rx_msg->ibm_credits);
-}
-
-static void
-kiblnd_debug_tx(kib_tx_t *tx)
-{
- CDEBUG(D_CONSOLE, " %p snd %d q %d w %d rc %d dl %lx "
- "cookie "LPX64" msg %s%s type %x cred %d\n",
- tx, tx->tx_sending, tx->tx_queued, tx->tx_waiting,
- tx->tx_status, tx->tx_deadline, tx->tx_cookie,
- tx->tx_lntmsg[0] == NULL ? "-" : "!",
- tx->tx_lntmsg[1] == NULL ? "-" : "!",
- tx->tx_msg->ibm_type, tx->tx_msg->ibm_credits);
-}
-
-static void
-kiblnd_debug_conn(kib_conn_t *conn)
-{
- struct list_head *tmp;
- int i;
-
- spin_lock(&conn->ibc_lock);
-
- CDEBUG(D_CONSOLE, "conn[%d] %p [version %x] -> %s: \n",
- atomic_read(&conn->ibc_refcount), conn,
- conn->ibc_version, libcfs_nid2str(conn->ibc_peer->ibp_nid));
- CDEBUG(D_CONSOLE, " state %d nposted %d/%d cred %d o_cred %d r_cred %d\n",
- conn->ibc_state, conn->ibc_noops_posted,
- conn->ibc_nsends_posted, conn->ibc_credits,
- conn->ibc_outstanding_credits, conn->ibc_reserved_credits);
- CDEBUG(D_CONSOLE, " comms_err %d\n", conn->ibc_comms_error);
-
- CDEBUG(D_CONSOLE, " early_rxs:\n");
- list_for_each(tmp, &conn->ibc_early_rxs)
- kiblnd_debug_rx(list_entry(tmp, kib_rx_t, rx_list));
-
- CDEBUG(D_CONSOLE, " tx_noops:\n");
- list_for_each(tmp, &conn->ibc_tx_noops)
- kiblnd_debug_tx(list_entry(tmp, kib_tx_t, tx_list));
-
- CDEBUG(D_CONSOLE, " tx_queue_nocred:\n");
- list_for_each(tmp, &conn->ibc_tx_queue_nocred)
- kiblnd_debug_tx(list_entry(tmp, kib_tx_t, tx_list));
-
- CDEBUG(D_CONSOLE, " tx_queue_rsrvd:\n");
- list_for_each(tmp, &conn->ibc_tx_queue_rsrvd)
- kiblnd_debug_tx(list_entry(tmp, kib_tx_t, tx_list));
-
- CDEBUG(D_CONSOLE, " tx_queue:\n");
- list_for_each(tmp, &conn->ibc_tx_queue)
- kiblnd_debug_tx(list_entry(tmp, kib_tx_t, tx_list));
-
- CDEBUG(D_CONSOLE, " active_txs:\n");
- list_for_each(tmp, &conn->ibc_active_txs)
- kiblnd_debug_tx(list_entry(tmp, kib_tx_t, tx_list));
-
- CDEBUG(D_CONSOLE, " rxs:\n");
- for (i = 0; i < IBLND_RX_MSGS(conn->ibc_version); i++)
- kiblnd_debug_rx(&conn->ibc_rxs[i]);
-
- spin_unlock(&conn->ibc_lock);
-}
-
int
kiblnd_translate_mtu(int value)
{
--
1.7.7.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/6] staging/lustre/libcfs: remove cfs_strncasecmp
2014-03-05 13:27 [PATCH 1/6] staging/lustre/lnet: remove kiblnd_debug_conn/rx/tx Peng Tao
@ 2014-03-05 13:27 ` Peng Tao
2014-03-05 13:27 ` [PATCH 3/6] staging/lustre/libcfs_string.h: don't export internal functions Peng Tao
2014-03-09 3:23 ` [PATCH 1/6] staging/lustre/lnet: remove kiblnd_debug_conn/rx/tx Greg KH
1 sibling, 1 reply; 7+ messages in thread
From: Peng Tao @ 2014-03-05 13:27 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, Peng Tao, Andreas Dilger, Oleg Drokin
The only difference against generic strncasecmp() is that
cfs_strncasecmp() check NULL pointers and zero length parameter,
which all callers have already taken care of.
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
---
drivers/staging/lustre/lnet/lnet/router_proc.c | 4 +-
.../staging/lustre/lustre/libcfs/libcfs_string.c | 24 +------------------
2 files changed, 4 insertions(+), 24 deletions(-)
diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c
index 20d53e0..0cbd9fc 100644
--- a/drivers/staging/lustre/lnet/lnet/router_proc.c
+++ b/drivers/staging/lustre/lnet/lnet/router_proc.c
@@ -837,8 +837,8 @@ static int __proc_lnet_portal_rotor(void *data, int write,
rc = -EINVAL;
lnet_res_lock(0);
for (i = 0; portal_rotors[i].pr_name != NULL; i++) {
- if (cfs_strncasecmp(portal_rotors[i].pr_name, tmp,
- strlen(portal_rotors[i].pr_name)) == 0) {
+ if (strncasecmp(portal_rotors[i].pr_name, tmp,
+ strlen(portal_rotors[i].pr_name)) == 0) {
portal_rotor = portal_rotors[i].pr_value;
rc = 0;
break;
diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
index 922debd..dc6a59a 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
@@ -42,26 +42,6 @@
#include <linux/libcfs/libcfs.h>
-/* non-0 = don't match */
-int cfs_strncasecmp(const char *s1, const char *s2, size_t n)
-{
- if (s1 == NULL || s2 == NULL)
- return 1;
-
- if (n == 0)
- return 0;
-
- while (n-- != 0 && tolower(*s1) == tolower(*s2)) {
- if (n == 0 || *s1 == '\0' || *s2 == '\0')
- break;
- s1++;
- s2++;
- }
-
- return tolower(*(unsigned char *)s1) - tolower(*(unsigned char *)s2);
-}
-EXPORT_SYMBOL(cfs_strncasecmp);
-
/* Convert a text string to a bitmask */
int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
int *oldmask, int minmask, int allmask)
@@ -101,7 +81,7 @@ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
debugstr = bit2str(i);
if (debugstr != NULL &&
strlen(debugstr) == len &&
- cfs_strncasecmp(str, debugstr, len) == 0) {
+ strncasecmp(str, debugstr, len) == 0) {
if (op == '-')
newmask &= ~(1 << i);
else
@@ -111,7 +91,7 @@ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
}
}
if (!found && len == 3 &&
- (cfs_strncasecmp(str, "ALL", len) == 0)) {
+ (strncasecmp(str, "ALL", len) == 0)) {
if (op == '-')
newmask = minmask;
else
--
1.7.7.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/6] staging/lustre/libcfs_string.h: don't export internal functions
2014-03-05 13:27 ` [PATCH 2/6] staging/lustre/libcfs: remove cfs_strncasecmp Peng Tao
@ 2014-03-05 13:27 ` Peng Tao
2014-03-05 13:27 ` [PATCH 4/6] staging/lustre/libcfs: remove cfs_iswhite Peng Tao
0 siblings, 1 reply; 7+ messages in thread
From: Peng Tao @ 2014-03-05 13:27 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, Peng Tao, Andreas Dilger, Oleg Drokin
cfs_expr_list_print is removed due to no callers. Other internal
functions are held unexported.
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
---
.../lustre/include/linux/libcfs/libcfs_string.h | 3 ---
.../staging/lustre/lustre/libcfs/libcfs_string.c | 20 +-------------------
2 files changed, 1 insertions(+), 22 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
index a6bac9c..83b7f42 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
@@ -109,8 +109,6 @@ char *cfs_trimwhite(char *str);
int cfs_gettok(struct cfs_lstr *next, char delim, struct cfs_lstr *res);
int cfs_str2num_check(char *str, int nob, unsigned *num,
unsigned min, unsigned max);
-int cfs_range_expr_parse(struct cfs_lstr *src, unsigned min, unsigned max,
- int single_tok, struct cfs_range_expr **expr);
int cfs_expr_list_match(__u32 value, struct cfs_expr_list *expr_list);
int cfs_expr_list_values(struct cfs_expr_list *expr_list,
int max, __u32 **values);
@@ -124,7 +122,6 @@ cfs_expr_list_values_free(__u32 *values, int num)
}
void cfs_expr_list_free(struct cfs_expr_list *expr_list);
-void cfs_expr_list_print(struct cfs_expr_list *expr_list);
int cfs_expr_list_parse(char *str, int len, unsigned min, unsigned max,
struct cfs_expr_list **elpp);
void cfs_expr_list_free_list(struct list_head *list);
diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
index dc6a59a..b9ed2a89 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
@@ -109,7 +109,6 @@ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
*oldmask = newmask;
return 0;
}
-EXPORT_SYMBOL(cfs_str2mask);
/* get the first string out of @str */
char *cfs_firststr(char *str, size_t size)
@@ -213,7 +212,6 @@ cfs_gettok(struct cfs_lstr *next, char delim, struct cfs_lstr *res)
res->ls_len = end - res->ls_str + 1;
return 1;
}
-EXPORT_SYMBOL(cfs_gettok);
/**
* Converts string to integer.
@@ -242,7 +240,6 @@ cfs_str2num_check(char *str, int nob, unsigned *num,
return (*num >= min && *num <= max);
}
-EXPORT_SYMBOL(cfs_str2num_check);
/**
* Parses \<range_expr\> token of the syntax. If \a bracketed is false,
@@ -257,7 +254,7 @@ EXPORT_SYMBOL(cfs_str2num_check);
* \retval 0 will be returned if it can be parsed, otherwise -EINVAL or
* -ENOMEM will be returned.
*/
-int
+static int
cfs_range_expr_parse(struct cfs_lstr *src, unsigned min, unsigned max,
int bracketed, struct cfs_range_expr **expr)
{
@@ -320,7 +317,6 @@ cfs_range_expr_parse(struct cfs_lstr *src, unsigned min, unsigned max,
LIBCFS_FREE(re, sizeof(*re));
return -EINVAL;
}
-EXPORT_SYMBOL(cfs_range_expr_parse);
/**
* Matches value (\a value) against ranges expression list \a expr_list.
@@ -341,7 +337,6 @@ cfs_expr_list_match(__u32 value, struct cfs_expr_list *expr_list)
return 0;
}
-EXPORT_SYMBOL(cfs_expr_list_match);
/**
* Convert express list (\a expr_list) to an array of all matched values
@@ -412,18 +407,6 @@ cfs_expr_list_free(struct cfs_expr_list *expr_list)
}
EXPORT_SYMBOL(cfs_expr_list_free);
-void
-cfs_expr_list_print(struct cfs_expr_list *expr_list)
-{
- struct cfs_range_expr *expr;
-
- list_for_each_entry(expr, &expr_list->el_exprs, re_link) {
- CDEBUG(D_WARNING, "%d-%d/%d\n",
- expr->re_lo, expr->re_hi, expr->re_stride);
- }
-}
-EXPORT_SYMBOL(cfs_expr_list_print);
-
/**
* Parses \<cfs_expr_list\> token of the syntax.
*
@@ -506,7 +489,6 @@ cfs_expr_list_free_list(struct list_head *list)
cfs_expr_list_free(el);
}
}
-EXPORT_SYMBOL(cfs_expr_list_free_list);
int
cfs_ip_addr_parse(char *str, int len, struct list_head *list)
--
1.7.7.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/6] staging/lustre/libcfs: remove cfs_iswhite
2014-03-05 13:27 ` [PATCH 3/6] staging/lustre/libcfs_string.h: don't export internal functions Peng Tao
@ 2014-03-05 13:27 ` Peng Tao
2014-03-05 13:27 ` [PATCH 5/6] staging/lustre/libcfs: remove obsolete function declaration Peng Tao
0 siblings, 1 reply; 7+ messages in thread
From: Peng Tao @ 2014-03-05 13:27 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, Peng Tao, Andreas Dilger, Oleg Drokin
Kernel provides isspace().
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
---
.../lustre/include/linux/libcfs/libcfs_string.h | 15 ---------------
drivers/staging/lustre/lnet/lnet/config.c | 12 ++++++------
.../staging/lustre/lustre/libcfs/libcfs_string.c | 10 +++++-----
3 files changed, 11 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
index 83b7f42..73c251f 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
@@ -90,21 +90,6 @@ struct cfs_expr_list {
struct list_head el_exprs;
};
-static inline int
-cfs_iswhite(char c)
-{
- switch (c) {
- case ' ':
- case '\t':
- case '\n':
- case '\r':
- return 1;
- default:
- break;
- }
- return 0;
-}
-
char *cfs_trimwhite(char *str);
int cfs_gettok(struct cfs_lstr *next, char delim, struct cfs_lstr *res);
int cfs_str2num_check(char *str, int nob, unsigned *num,
diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c
index 6a07b0a..d97464e 100644
--- a/drivers/staging/lustre/lnet/lnet/config.c
+++ b/drivers/staging/lustre/lnet/lnet/config.c
@@ -443,7 +443,7 @@ lnet_str2tbs_sep(struct list_head *tbs, char *str)
/* Split 'str' into separate commands */
for (;;) {
/* skip leading whitespace */
- while (cfs_iswhite(*str))
+ while (isspace(*str))
str++;
/* scan for separator or comment */
@@ -460,7 +460,7 @@ lnet_str2tbs_sep(struct list_head *tbs, char *str)
}
for (i = 0; i < nob; i++)
- if (cfs_iswhite(str[i]))
+ if (isspace(str[i]))
ltb->ltb_text[i] = ' ';
else
ltb->ltb_text[i] = str[i];
@@ -667,7 +667,7 @@ lnet_parse_route(char *str, int *im_a_router)
sep = str;
for (;;) {
/* scan for token start */
- while (cfs_iswhite(*sep))
+ while (isspace(*sep))
sep++;
if (*sep == 0) {
if (ntokens < (got_hops ? 3 : 2))
@@ -679,7 +679,7 @@ lnet_parse_route(char *str, int *im_a_router)
token = sep++;
/* scan for token end */
- while (*sep != 0 && !cfs_iswhite(*sep))
+ while (*sep != 0 && !isspace(*sep))
sep++;
if (*sep != 0)
*sep++ = 0;
@@ -858,7 +858,7 @@ lnet_match_network_tokens(char *net_entry, __u32 *ipaddrs, int nip)
sep = tokens;
for (;;) {
/* scan for token start */
- while (cfs_iswhite(*sep))
+ while (isspace(*sep))
sep++;
if (*sep == 0)
break;
@@ -866,7 +866,7 @@ lnet_match_network_tokens(char *net_entry, __u32 *ipaddrs, int nip)
token = sep++;
/* scan for token end */
- while (*sep != 0 && !cfs_iswhite(*sep))
+ while (*sep != 0 && !isspace(*sep))
sep++;
if (*sep != 0)
*sep++ = 0;
diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
index b9ed2a89..ed0a6b5 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
@@ -143,12 +143,12 @@ cfs_trimwhite(char *str)
{
char *end;
- while (cfs_iswhite(*str))
+ while (isspace(*str))
str++;
end = str + strlen(str);
while (end > str) {
- if (!cfs_iswhite(end[-1]))
+ if (!isspace(end[-1]))
break;
end--;
}
@@ -178,7 +178,7 @@ cfs_gettok(struct cfs_lstr *next, char delim, struct cfs_lstr *res)
/* skip leading white spaces */
while (next->ls_len) {
- if (!cfs_iswhite(*next->ls_str))
+ if (!isspace(*next->ls_str))
break;
next->ls_str++;
next->ls_len--;
@@ -205,7 +205,7 @@ cfs_gettok(struct cfs_lstr *next, char delim, struct cfs_lstr *res)
/* skip ending whitespaces */
while (--end != res->ls_str) {
- if (!cfs_iswhite(*end))
+ if (!isspace(*end))
break;
}
@@ -234,7 +234,7 @@ cfs_str2num_check(char *str, int nob, unsigned *num,
return 0;
for (; endp < str + nob; endp++) {
- if (!cfs_iswhite(*endp))
+ if (!isspace(*endp))
return 0;
}
--
1.7.7.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/6] staging/lustre/libcfs: remove obsolete function declaration
2014-03-05 13:27 ` [PATCH 4/6] staging/lustre/libcfs: remove cfs_iswhite Peng Tao
@ 2014-03-05 13:27 ` Peng Tao
2014-03-05 13:27 ` [PATCH 6/6] staging/lustre/libcfs: remove NIDSTR_LOCK/UNLOCK Peng Tao
0 siblings, 1 reply; 7+ messages in thread
From: Peng Tao @ 2014-03-05 13:27 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, Peng Tao, Andreas Dilger, Oleg Drokin
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
---
.../lustre/include/linux/libcfs/libcfs_string.h | 12 ------------
1 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
index 73c251f..509dc1e 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
@@ -49,18 +49,6 @@ int cfs_strncasecmp(const char *s1, const char *s2, size_t n);
/* Convert a text string to a bitmask */
int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
int *oldmask, int minmask, int allmask);
-
-/* Allocate space for and copy an existing string.
- * Must free with kfree().
- */
-char *cfs_strdup(const char *str, u_int32_t flags);
-
-/* safe vsnprintf */
-int cfs_vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
-
-/* safe snprintf */
-int cfs_snprintf(char *buf, size_t size, const char *fmt, ...);
-
/* trim leading and trailing space characters */
char *cfs_firststr(char *str, size_t size);
--
1.7.7.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 6/6] staging/lustre/libcfs: remove NIDSTR_LOCK/UNLOCK
2014-03-05 13:27 ` [PATCH 5/6] staging/lustre/libcfs: remove obsolete function declaration Peng Tao
@ 2014-03-05 13:27 ` Peng Tao
0 siblings, 0 replies; 7+ messages in thread
From: Peng Tao @ 2014-03-05 13:27 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, Peng Tao, Andreas Dilger, Oleg Drokin
Cc: Andreas Dilger <andreas.dilger@intel.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
---
drivers/staging/lustre/lustre/libcfs/nidstrings.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/lustre/lustre/libcfs/nidstrings.c b/drivers/staging/lustre/lustre/libcfs/nidstrings.c
index 732ae55..cfb274f 100644
--- a/drivers/staging/lustre/lustre/libcfs/nidstrings.c
+++ b/drivers/staging/lustre/lustre/libcfs/nidstrings.c
@@ -65,23 +65,20 @@ void libcfs_init_nidstrings(void)
spin_lock_init(&libcfs_nidstring_lock);
}
-# define NIDSTR_LOCK(f) spin_lock_irqsave(&libcfs_nidstring_lock, f)
-# define NIDSTR_UNLOCK(f) spin_unlock_irqrestore(&libcfs_nidstring_lock, f)
-
static char *
libcfs_next_nidstring(void)
{
char *str;
unsigned long flags;
- NIDSTR_LOCK(flags);
+ spin_lock_irqsave(&libcfs_nidstring_lock, flags);
str = libcfs_nidstrings[libcfs_nidstring_idx++];
if (libcfs_nidstring_idx ==
sizeof(libcfs_nidstrings)/sizeof(libcfs_nidstrings[0]))
libcfs_nidstring_idx = 0;
- NIDSTR_UNLOCK(flags);
+ spin_unlock_irqrestore(&libcfs_nidstring_lock, flags);
return str;
}
--
1.7.7.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/6] staging/lustre/lnet: remove kiblnd_debug_conn/rx/tx
2014-03-05 13:27 [PATCH 1/6] staging/lustre/lnet: remove kiblnd_debug_conn/rx/tx Peng Tao
2014-03-05 13:27 ` [PATCH 2/6] staging/lustre/libcfs: remove cfs_strncasecmp Peng Tao
@ 2014-03-09 3:23 ` Greg KH
1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2014-03-09 3:23 UTC (permalink / raw)
To: Peng Tao; +Cc: linux-kernel, Andreas Dilger, Oleg Drokin
On Wed, Mar 05, 2014 at 09:27:15PM +0800, Peng Tao wrote:
> They are not called by anyone and cause gcc warning:
> drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c:609: warning: ‘kiblnd_debug_conn’
> defined but not used
> drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c:589: warning: ‘kiblnd_debug_rx’
> defined but not used
> drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c:597: warning: ‘kiblnd_debug_tx’
> defined but not used
Don't wrap error messages, it's not needed.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-03-09 3:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05 13:27 [PATCH 1/6] staging/lustre/lnet: remove kiblnd_debug_conn/rx/tx Peng Tao
2014-03-05 13:27 ` [PATCH 2/6] staging/lustre/libcfs: remove cfs_strncasecmp Peng Tao
2014-03-05 13:27 ` [PATCH 3/6] staging/lustre/libcfs_string.h: don't export internal functions Peng Tao
2014-03-05 13:27 ` [PATCH 4/6] staging/lustre/libcfs: remove cfs_iswhite Peng Tao
2014-03-05 13:27 ` [PATCH 5/6] staging/lustre/libcfs: remove obsolete function declaration Peng Tao
2014-03-05 13:27 ` [PATCH 6/6] staging/lustre/libcfs: remove NIDSTR_LOCK/UNLOCK Peng Tao
2014-03-09 3:23 ` [PATCH 1/6] staging/lustre/lnet: remove kiblnd_debug_conn/rx/tx Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).