Lines Matching +full:e +full:- +full:1137

1 // SPDX-License-Identifier: GPL-2.0-only
140 pr_warn("[%s:%u] bit offset for clump out-of-bounds: expected less than %u, got %u\n", in __check_eq_clump8()
202 expect_eq_pbl("0-22", bmap, 23); in test_zero_clear()
203 expect_eq_pbl("0-1023", bmap, 1024); in test_zero_clear()
205 /* single-word bitmaps */ in test_zero_clear()
207 expect_eq_pbl("9-1023", bmap, 1024); in test_zero_clear()
210 expect_eq_pbl("64-1023", bmap, 1024); in test_zero_clear()
214 expect_eq_pbl("64-78,98-1023", bmap, 1024); in test_zero_clear()
217 expect_eq_pbl("128-1023", bmap, 1024); in test_zero_clear()
249 expect_eq_uint(10, find_nth_bit(bmap, 64 * 3 - 1, 0)); in test_find_nth_bit()
250 expect_eq_uint(20, find_nth_bit(bmap, 64 * 3 - 1, 1)); in test_find_nth_bit()
251 expect_eq_uint(30, find_nth_bit(bmap, 64 * 3 - 1, 2)); in test_find_nth_bit()
252 expect_eq_uint(40, find_nth_bit(bmap, 64 * 3 - 1, 3)); in test_find_nth_bit()
253 expect_eq_uint(50, find_nth_bit(bmap, 64 * 3 - 1, 4)); in test_find_nth_bit()
254 expect_eq_uint(60, find_nth_bit(bmap, 64 * 3 - 1, 5)); in test_find_nth_bit()
255 expect_eq_uint(80, find_nth_bit(bmap, 64 * 3 - 1, 6)); in test_find_nth_bit()
256 expect_eq_uint(123, find_nth_bit(bmap, 64 * 3 - 1, 7)); in test_find_nth_bit()
257 expect_eq_uint(0, !!(find_nth_bit(bmap, 64 * 3 - 1, 8) < 64 * 3 - 1)); in test_find_nth_bit()
275 /* single-word bitmaps */ in test_fill_set()
277 expect_eq_pbl("0-8", bmap, 1024); in test_fill_set()
280 expect_eq_pbl("0-63", bmap, 1024); in test_fill_set()
284 expect_eq_pbl("0-63,79-97", bmap, 1024); in test_fill_set()
287 expect_eq_pbl("0-127", bmap, 1024); in test_fill_set()
291 expect_eq_pbl("0-1023", bmap, 1024); in test_fill_set()
302 /* single-word bitmaps */ in test_copy()
305 expect_eq_pbl("0-18", bmap2, 1024); in test_copy()
309 expect_eq_pbl("0-18", bmap2, 1024); in test_copy()
311 /* multi-word bitmaps */ in test_copy()
314 expect_eq_pbl("0-108", bmap2, 1024); in test_copy()
318 expect_eq_pbl("0-108", bmap2, 1024); in test_copy()
320 /* the following tests assume a 32- or 64-bit arch (even 128b in test_copy()
325 bitmap_copy(bmap2, bmap1, 109); /* ... but 0-padded til word length */ in test_copy()
326 expect_eq_pbl("0-108,128-1023", bmap2, 1024); in test_copy()
330 expect_eq_pbl("0-108,128-1023", bmap2, 1024); in test_copy()
346 expect_eq_uint(pos, order < 9 ? BIT(order) : -ENOMEM); in test_bitmap_region()
440 {0, "0-15", &exp1[2 * step], 32, 0},
441 {0, "16-31", &exp1[3 * step], 32, 0},
442 {0, "0-31:1/2", &exp1[4 * step], 32, 0},
443 {0, "1-31:1/2", &exp1[5 * step], 32, 0},
444 {0, "0-31:1/4", &exp1[6 * step], 32, 0},
445 {0, "1-31:1/4", &exp1[7 * step], 32, 0},
446 {0, "0-31:4/4", &exp1[8 * step], 32, 0},
447 {0, "1-31:4/4", &exp1[9 * step], 32, 0},
448 {0, "0-31:1/4,32-63:2/4", &exp1[10 * step], 64, 0},
449 {0, "0-31:3/4,32-63:4/4", &exp1[11 * step], 64, 0},
450 {0, " ,, 0-31:3/4 ,, 32-63:4/4 ,, ", &exp1[11 * step], 64, 0},
452 {0, "0-31:1/4,32-63:2/4,64-95:3/4,96-127:4/4", exp2, 128, 0},
454 {0, "0-2047:128/256", NULL, 2048, PARSE_TIME},
462 {0, "0-0", &exp1[0], 32, 0},
463 {0, "1-1", &exp1[1 * step], 32, 0},
464 {0, "15-15", &exp1[13 * step], 32, 0},
465 {0, "31-31", &exp1[14 * step], 32, 0},
467 {0, "0-0:0/1", &exp1[12 * step], 32, 0},
468 {0, "0-0:1/1", &exp1[0], 32, 0},
469 {0, "0-0:1/31", &exp1[0], 32, 0},
470 {0, "0-0:31/31", &exp1[0], 32, 0},
471 {0, "1-1:1/1", &exp1[1 * step], 32, 0},
472 {0, "0-15:16/31", &exp1[2 * step], 32, 0},
473 {0, "15-15:1/2", &exp1[13 * step], 32, 0},
474 {0, "15-15:31/31", &exp1[13 * step], 32, 0},
475 {0, "15-31:1/31", &exp1[13 * step], 32, 0},
476 {0, "16-31:16/31", &exp1[3 * step], 32, 0},
477 {0, "31-31:31/31", &exp1[14 * step], 32, 0},
479 {0, "N-N", &exp1[14 * step], 32, 0},
480 {0, "0-0:1/N", &exp1[0], 32, 0},
481 {0, "0-0:N/N", &exp1[0], 32, 0},
482 {0, "0-15:16/N", &exp1[2 * step], 32, 0},
483 {0, "15-15:N/N", &exp1[13 * step], 32, 0},
484 {0, "15-N:1/N", &exp1[13 * step], 32, 0},
485 {0, "16-N:16/N", &exp1[3 * step], 32, 0},
486 {0, "N-N:N/N", &exp1[14 * step], 32, 0},
488 {0, "0-N:1/3,1-N:1/3,2-N:1/3", &exp1[8 * step], 32, 0},
489 {0, "0-31:1/3,1-31:1/3,2-31:1/3", &exp1[8 * step], 32, 0},
490 {0, "1-10:8/12,8-31:24/29,0-31:0/3", &exp1[9 * step], 32, 0},
496 {-EINVAL, "al", NULL, 8, 0},
497 {-EINVAL, "alll", NULL, 8, 0},
499 {-EINVAL, "-1", NULL, 8, 0},
500 {-EINVAL, "-0", NULL, 8, 0},
501 {-EINVAL, "10-1", NULL, 8, 0},
502 {-ERANGE, "8-8", NULL, 8, 0},
503 {-ERANGE, "0-31", NULL, 8, 0},
504 {-EINVAL, "0-31:", NULL, 32, 0},
505 {-EINVAL, "0-31:0", NULL, 32, 0},
506 {-EINVAL, "0-31:0/", NULL, 32, 0},
507 {-EINVAL, "0-31:0/0", NULL, 32, 0},
508 {-EINVAL, "0-31:1/0", NULL, 32, 0},
509 {-EINVAL, "0-31:10/1", NULL, 32, 0},
510 {-EOVERFLOW, "0-98765432123456789:10/1", NULL, 8, 0},
512 {-EINVAL, "a-31", NULL, 8, 0},
513 {-EINVAL, "0-a1", NULL, 8, 0},
514 {-EINVAL, "a-31:10/1", NULL, 8, 0},
515 {-EINVAL, "0-31:a/1", NULL, 8, 0},
516 {-EINVAL, "0-\n", NULL, 8, 0},
532 time = ktime_get() - time; in test_bitmap_parselist()
569 memset(bmap, -1, PAGE_SIZE); in test_bitmap_printlist()
570 slen = snprintf(expected, 256, "0-%ld", PAGE_SIZE * 8 - 1); in test_bitmap_printlist()
576 time = ktime_get() - time; in test_bitmap_printlist()
627 {-EINVAL, "goodfood,deadbeef,1,0", NULL, 128, 0},
628 {-EOVERFLOW, "3,0", NULL, 33, 0},
629 {-EOVERFLOW, "123badf00d,deadbeef,1,0", NULL, 128, 0},
630 {-EOVERFLOW, "badf00d,deadbeef,1,0", NULL, 90, 0},
631 {-EOVERFLOW, "fbadf00d,deadbeef,1,0", NULL, 95, 0},
632 {-EOVERFLOW, "badf00d,deadbeef,1,0", NULL, 100, 0},
649 time = ktime_get() - time; in test_bitmap_parse()
695 if (nbits < EXP1_IN_BITS - 32) in test_bitmap_arr32()
723 (arr[(nbits - 1) / 64] & ~GENMASK_ULL((nbits - 1) % 64, 0))) { in test_bitmap_arr64()
725 nbits, arr[(nbits - 1) / 64], in test_bitmap_arr64()
726 GENMASK_ULL((nbits - 1) % 64, 0)); in test_bitmap_arr64()
730 if (nbits < EXP1_IN_BITS - 64) in test_bitmap_arr64()
742 for (nbits = 0; nbits < 1024 - start; nbits += 8) { in test_mem_optimisations()
774 0x02, /* non-edge 1 bit set */
776 0x38, /* 3 bits set across 4-bit boundary */
780 0x05, /* non-adjacent 2 bits set */
798 bitmap_set(bits, 56, 1); /* 0x05 - part 1 */ in test_for_each_set_clump8()
799 bitmap_set(bits, 58, 1); /* 0x05 - part 2 */ in test_for_each_set_clump8()
938 unsigned int s, e; in test_for_each_set_bitrange() local
950 for_each_set_bitrange(s, e, orig, 500) in test_for_each_set_bitrange()
951 bitmap_set(copy, s, e-s); in test_for_each_set_bitrange()
960 unsigned int s, e; in test_for_each_clear_bitrange() local
972 for_each_clear_bitrange(s, e, orig, 500) in test_for_each_clear_bitrange()
973 bitmap_clear(copy, s, e-s); in test_for_each_clear_bitrange()
982 unsigned int wr, s, e; in test_for_each_set_bitrange_from() local
999 for_each_set_bitrange_from(s, e, orig, 500) in test_for_each_set_bitrange_from()
1000 bitmap_set(copy, s, e - s); in test_for_each_set_bitrange_from()
1012 unsigned int wr, s, e; in test_for_each_clear_bitrange_from() local
1029 for_each_clear_bitrange_from(s, e, orig, 500) in test_for_each_clear_bitrange_from()
1030 bitmap_clear(copy, s, e - s); in test_for_each_clear_bitrange_from()
1064 { 1, BITS_PER_LONG - 1, BITS_PER_LONG,
1087 memcpy(in, t->in, sizeof(t->in)); in test_bitmap_cut()
1089 bitmap_cut(out, in, t->first, t->cut, t->nbits); in test_bitmap_cut()
1091 expect_eq_bitmap(t->expected, out, t->nbits); in test_bitmap_cut()
1107 …har small_list[] __initconst = "0,4,8,12,16,20,24,28,32-33,36-37,40-41,44-45,48-49,52-53,56-57,60-
1154 …"0,4,8,12,16,20,24,28,32-33,36-37,40-41,44-45,48-49,52-53,56-57,60-61,64,68,72,76,80,84,88,92,96-9…
1155 …"05,108-109,112-113,116-117,120-121,124-125,128,132,136,140,144,148,152,156,160-161,164-165,168-16…
1156 …"77,180-181,184-185,188-189,192,196,200,204,208,212,216,220,224-225,228-229,232-233,236-237,240-24…
1157 …"49,252-253,256,260,264,268,272,276,280,284,288-289,292-293,296-297,300-301,304-305,308-309,312-31…
1158 …"24,328,332,336,340,344,348,352-353,356-357,360-361,364-365,368-369,372-373,376-377,380-381,384,38…
1159 …"04,408,412,416-417,420-421,424-425,428-429,432-433,436-437,440-441,444-445,448,452,456,460,464,46…
1160 …"81,484-485,488-489,492-493,496-497,500-501,504-505,508-509,512,516,520,524,528,532,536,540,544-54…
1161 …"53,556-557,560-561,564-565,568-569,572-573,576,580,584,588,592,596,600,604,608-609,612-613,616-61…
1162 …"25,628-629,632-633,636-637,640,644,648,652,656,660,664,668,672-673,676-677,680-681,684-685,688-68…
1163 …"97,700-701,704,708,712,716,720,724,728,732,736-737,740-741,744-745,748-749,752-753,756-757,760-76…
1164 …"72,776,780,784,788,792,796,800-801,804-805,808-809,812-813,816-817,820-821,824-825,828-829,832,83…
1165 …"52,856,860,864-865,868-869,872-873,876-877,880-881,884-885,888-889,892-893,896,900,904,908,912,91…
1166 …"29,932-933,936-937,940-941,944-945,948-949,952-953,956-957,960,964,968,972,976,980,984,988,992-99…
1167 …"1001,1004-1005,1008-1009,1012-1013,1016-1017,1020-1021,1024,1028,1032,1036,1040,1044,1048,1052,10…
1168 …"61,1064-1065,1068-1069,1072-1073,1076-1077,1080-1081,1084-1085,1088,1092,1096,1100,1104,1108,1112…
1169 …",1124-1125,1128-1129,1132-1133,1136-1137,1140-1141,1144-1145,1148-1149,1152,1156,1160,1164,1168,1…
1170 …"184-1185,1188-1189,1192-1193,1196-1197,1200-1201,1204-1205,1208-1209,1212-1213,1216,1220,1224,122…
1171 …"0,1244,1248-1249,1252-1253,1256-1257,1260-1261,1264-1265,1268-1269,1272-1273,1276-1277,1280,1284,…
1172 …"1300,1304,1308,1312-1313,1316-1317,1320-1321,1324-1325,1328-1329,1332-1333,1336-1337,1340-1341,13…
1173 …"56,1360,1364,1368,1372,1376-1377,1380-1381,1384-1385,1388-1389,1392-1393,1396-1397,1400-1401,1404
1174 …",1416,1420,1424,1428,1432,1436,1440-1441,1444-1445,1448-1449,1452-1453,1456-1457,1460-1461,1464-1…
1175 …"472,1476,1480,1484,1488,1492,1496,1500,1504-1505,1508-1509,1512-1513,1516-1517,1520-1521,1524-152…
1176 …"2-1533,1536,1540,1544,1548,1552,1556,1560,1564,1568-1569,1572-1573,1576-1577,1580-1581,1584-1585,…
1177 …"1593,1596-1597,1600,1604,1608,1612,1616,1620,1624,1628,1632-1633,1636-1637,1640-1641,1644-1645,16…
1178 …"53,1656-1657,1660-1661,1664,1668,1672,1676,1680,1684,1688,1692,1696-1697,1700-1701,1704-1705,1708
1179 …",1716-1717,1720-1721,1724-1725,1728,1732,1736,1740,1744,1748,1752,1756,1760-1761,1764-1765,1768-1…
1180 …"776-1777,1780-1781,1784-1785,1788-1789,1792,1796,1800,1804,1808,1812,1816,1820,1824-1825,1828-182…
1181 …"6-1837,1840-1841,1844-1845,1848-1849,1852-1853,1856,1860,1864,1868,1872,1876,1880,1884,1888-1889,…
1182 …"1897,1900-1901,1904-1905,1908-1909,1912-1913,1916-1917,1920,1924,1928,1932,1936,1940,1944,1948,19…
1183 …"57,1960-1961,1964-1965,1968-1969,1972-1973,1976-1977,1980-1981,1984,1988,1992,1996,2000,2004,2008…
1184 …",2020-2021,2024-2025,2028-2029,2032-2033,2036-2037,2040-2041,2044-2045,2048,2052,2056,2060,2064,2…
1185 …"080-2081,2084-2085,2088-2089,2092-2093,2096-2097,2100-2101,2104-2105,2108-2109,2112,2116,2120,212…
1186 …"6,2140,2144-2145,2148-2149,2152-2153,2156-2157,2160-2161,2164-2165,2168-2169,2172-2173,2176,2180,…
1187 …"2196,2200,2204,2208-2209,2212-2213,2216-2217,2220-2221,2224-2225,2228-2229,2232-2233,2236-2237,22…
1188 …"52,2256,2260,2264,2268,2272-2273,2276-2277,2280-2281,2284-2285,2288-2289,2292-2293,2296-2297,2300
1189 …",2312,2316,2320,2324,2328,2332,2336-2337,2340-2341,2344-2345,2348-2349,2352-2353,2356-2357,2360-2…
1190 …"368,2372,2376,2380,2384,2388,2392,2396,2400-2401,2404-2405,2408-2409,2412-2413,2416-2417,2420-242…
1191 …"8-2429,2432,2436,2440,2444,2448,2452,2456,2460,2464-2465,2468-2469,2472-2473,2476-2477,2480-2481,…
1192 …"2489,2492-2493,2496,2500,2504,2508,2512,2516,2520,2524,2528-2529,2532-2533,2536-2537,2540-2541,25…
1193 "49,2552-2553,2556-2557\n";
1208 n = bitmap_print_bitmask_to_buf(print_buf, t->bitmap, t->nbits, in test_bitmap_print_buf()
1210 expect_eq_uint(strlen(t->mask) + 1, n); in test_bitmap_print_buf()
1211 expect_eq_str(t->mask, print_buf, n); in test_bitmap_print_buf()
1213 n = bitmap_print_list_to_buf(print_buf, t->bitmap, t->nbits, in test_bitmap_print_buf()
1215 expect_eq_uint(strlen(t->list) + 1, n); in test_bitmap_print_buf()
1216 expect_eq_str(t->list, print_buf, n); in test_bitmap_print_buf()
1218 /* test by non-zero offset */ in test_bitmap_print_buf()
1219 if (strlen(t->list) > PAGE_SIZE) { in test_bitmap_print_buf()
1220 n = bitmap_print_list_to_buf(print_buf, t->bitmap, t->nbits, in test_bitmap_print_buf()
1222 expect_eq_uint(strlen(t->list) + 1 - PAGE_SIZE, n); in test_bitmap_print_buf()
1223 expect_eq_str(t->list + PAGE_SIZE, print_buf, n); in test_bitmap_print_buf()
1229 * FIXME: Clang breaks compile-time evaluations when KASAN and GCOV are enabled.
1230 * To workaround it, GCOV is force-disabled in Makefile for this configuration.
1241 * Compilers must be able to optimize all of those to compile-time in test_bitmap_const_eval()
1242 * constants on any supported optimization level (-O2, -Os) and any in test_bitmap_const_eval()
1337 for (nbits = BITS_PER_LONG; nbits >= 1; nbits--) { in test_bitmap_write_helper()
1340 w >>= (BITS_PER_LONG - nbits); in test_bitmap_write_helper()
1341 for (i = 0; i <= TEST_BIT_LEN - nbits; i++) { in test_bitmap_write_helper()
1384 for (i = 0; i < TEST_BIT_LEN - 7; i++) { in test_bitmap_read_write()
1425 time = ktime_get() - time; in test_bitmap_read_perf()
1447 time = ktime_get() - time; in test_bitmap_write_perf()