Lines Matching refs:str
1054 static int hex2bitmap(const char *str, unsigned long *bitmap, int bits)
1062 if (str[0] == '0' && str[1] == 'x')
1063 str++;
1064 if (*str == 'x')
1065 str++;
1067 for (i = 0; isxdigit(*str) && i < bits; str++) {
1068 b = hex_to_bin(*str);
1075 if (*str == '\n')
1076 str++;
1077 if (*str)
1099 static int modify_bitmap(const char *str, unsigned long *bitmap, int bits)
1108 while (*str) {
1109 sign = *str++;
1112 a = z = simple_strtoul(str, &np, 0);
1113 if (str == np || a >= bits)
1115 str = np;
1116 if (*str == '-') {
1117 z = simple_strtoul(++str, &np, 0);
1118 if (str == np || a > z || z >= bits)
1120 str = np;
1127 while (*str == ',' || *str == '\n')
1128 str++;
1134 static int ap_parse_bitmap_str(const char *str, unsigned long *bitmap, int bits,
1141 if (*str == '+' || *str == '-') {
1143 rc = modify_bitmap(str, newmap, bits);
1146 rc = hex2bitmap(str, newmap, bits);
1151 int ap_parse_mask_str(const char *str,
1170 rc = ap_parse_bitmap_str(str, bitmap, bits, newmap);