struct list_head el_exprs;
};
-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 int *num,
unsigned int min, unsigned int max);
}
EXPORT_SYMBOL(cfs_firststr);
-char *
-cfs_trimwhite(char *str)
-{
- char *end;
-
- while (isspace(*str))
- str++;
-
- end = str + strlen(str);
- while (end > str) {
- if (!isspace(end[-1]))
- break;
- end--;
- }
-
- *end = 0;
- return str;
-}
-EXPORT_SYMBOL(cfs_trimwhite);
-
/**
* Extracts tokens from strings.
*
int c;
int i;
- str = cfs_trimwhite(pattern);
+ str = strim(pattern);
if (*str == 'n' || *str == 'N') {
pattern = str + 1;
if (*pattern != '\0') {
high = node ? MAX_NUMNODES - 1 : nr_cpu_ids - 1;
- for (str = cfs_trimwhite(pattern), c = 0;; c++) {
+ for (str = strim(pattern), c = 0;; c++) {
struct cfs_range_expr *range;
struct cfs_expr_list *el;
char *bracket = strchr(str, '[');
goto failed;
}
- str = cfs_trimwhite(str + n);
+ str = strim(str + n);
if (str != bracket) {
CERROR("Invalid pattern %s\n", str);
goto failed;
goto failed;
}
- str = cfs_trimwhite(bracket + 1);
+ str = strim(bracket + 1);
}
return cptab;
if (comma)
*comma++ = 0;
- net = libcfs_str2net(cfs_trimwhite(str));
+ net = libcfs_str2net(strim(str));
if (net == LNET_NIDNET(LNET_NID_ANY)) {
LCONSOLE_ERROR_MSG(0x113,
}
*bracket = 0;
- net = libcfs_str2net(cfs_trimwhite(str));
+ net = libcfs_str2net(strim(str));
if (net == LNET_NIDNET(LNET_NID_ANY)) {
tmp = str;
goto failed_syntax;
if (comma)
*comma++ = 0;
- iface = cfs_trimwhite(iface);
+ iface = strim(iface);
if (!*iface) {
tmp = iface;
goto failed_syntax;
comma = strchr(bracket + 1, ',');
if (comma) {
*comma = 0;
- str = cfs_trimwhite(str);
+ str = strim(str);
if (*str) {
tmp = str;
goto failed_syntax;
continue;
}
- str = cfs_trimwhite(str);
+ str = strim(str);
if (*str) {
tmp = str;
goto failed_syntax;
if (rc < 0)
goto out;
- tmp = cfs_trimwhite(buf);
+ tmp = strim(buf);
rc = -EINVAL;
lnet_res_lock(0);