Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

locking/atomic: remove fallback comments

Currently a subset of the fallback templates have kerneldoc comments,
resulting in a haphazard set of generated kerneldoc comments as only
some operations have fallback templates to begin with.

We'd like to generate more consistent kerneldoc comments, and to do so
we'll need to restructure the way the fallback code is generated.

To minimize churn and to make it easier to restructure the fallback
code, this patch removes the existing kerneldoc comments from the
fallback templates. We can add new kerneldoc comments in subsequent
patches.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230605070124.3741859-3-mark.rutland@arm.com

authored by

Mark Rutland and committed by
Peter Zijlstra
14d72d4b dda5f312

+1 -223
+1 -165
include/linux/atomic/atomic-arch-fallback.h
··· 1272 1272 #endif /* arch_atomic_try_cmpxchg_relaxed */ 1273 1273 1274 1274 #ifndef arch_atomic_sub_and_test 1275 - /** 1276 - * arch_atomic_sub_and_test - subtract value from variable and test result 1277 - * @i: integer value to subtract 1278 - * @v: pointer of type atomic_t 1279 - * 1280 - * Atomically subtracts @i from @v and returns 1281 - * true if the result is zero, or false for all 1282 - * other cases. 1283 - */ 1284 1275 static __always_inline bool 1285 1276 arch_atomic_sub_and_test(int i, atomic_t *v) 1286 1277 { ··· 1281 1290 #endif 1282 1291 1283 1292 #ifndef arch_atomic_dec_and_test 1284 - /** 1285 - * arch_atomic_dec_and_test - decrement and test 1286 - * @v: pointer of type atomic_t 1287 - * 1288 - * Atomically decrements @v by 1 and 1289 - * returns true if the result is 0, or false for all other 1290 - * cases. 1291 - */ 1292 1293 static __always_inline bool 1293 1294 arch_atomic_dec_and_test(atomic_t *v) 1294 1295 { ··· 1290 1307 #endif 1291 1308 1292 1309 #ifndef arch_atomic_inc_and_test 1293 - /** 1294 - * arch_atomic_inc_and_test - increment and test 1295 - * @v: pointer of type atomic_t 1296 - * 1297 - * Atomically increments @v by 1 1298 - * and returns true if the result is zero, or false for all 1299 - * other cases. 1300 - */ 1301 1310 static __always_inline bool 1302 1311 arch_atomic_inc_and_test(atomic_t *v) 1303 1312 { ··· 1306 1331 #endif /* arch_atomic_add_negative */ 1307 1332 1308 1333 #ifndef arch_atomic_add_negative 1309 - /** 1310 - * arch_atomic_add_negative - Add and test if negative 1311 - * @i: integer value to add 1312 - * @v: pointer of type atomic_t 1313 - * 1314 - * Atomically adds @i to @v and returns true if the result is negative, 1315 - * or false when the result is greater than or equal to zero. 1316 - */ 1317 1334 static __always_inline bool 1318 1335 arch_atomic_add_negative(int i, atomic_t *v) 1319 1336 { ··· 1315 1348 #endif 1316 1349 1317 1350 #ifndef arch_atomic_add_negative_acquire 1318 - /** 1319 - * arch_atomic_add_negative_acquire - Add and test if negative 1320 - * @i: integer value to add 1321 - * @v: pointer of type atomic_t 1322 - * 1323 - * Atomically adds @i to @v and returns true if the result is negative, 1324 - * or false when the result is greater than or equal to zero. 1325 - */ 1326 1351 static __always_inline bool 1327 1352 arch_atomic_add_negative_acquire(int i, atomic_t *v) 1328 1353 { ··· 1324 1365 #endif 1325 1366 1326 1367 #ifndef arch_atomic_add_negative_release 1327 - /** 1328 - * arch_atomic_add_negative_release - Add and test if negative 1329 - * @i: integer value to add 1330 - * @v: pointer of type atomic_t 1331 - * 1332 - * Atomically adds @i to @v and returns true if the result is negative, 1333 - * or false when the result is greater than or equal to zero. 1334 - */ 1335 1368 static __always_inline bool 1336 1369 arch_atomic_add_negative_release(int i, atomic_t *v) 1337 1370 { ··· 1333 1382 #endif 1334 1383 1335 1384 #ifndef arch_atomic_add_negative_relaxed 1336 - /** 1337 - * arch_atomic_add_negative_relaxed - Add and test if negative 1338 - * @i: integer value to add 1339 - * @v: pointer of type atomic_t 1340 - * 1341 - * Atomically adds @i to @v and returns true if the result is negative, 1342 - * or false when the result is greater than or equal to zero. 1343 - */ 1344 1385 static __always_inline bool 1345 1386 arch_atomic_add_negative_relaxed(int i, atomic_t *v) 1346 1387 { ··· 1380 1437 #endif /* arch_atomic_add_negative_relaxed */ 1381 1438 1382 1439 #ifndef arch_atomic_fetch_add_unless 1383 - /** 1384 - * arch_atomic_fetch_add_unless - add unless the number is already a given value 1385 - * @v: pointer of type atomic_t 1386 - * @a: the amount to add to v... 1387 - * @u: ...unless v is equal to u. 1388 - * 1389 - * Atomically adds @a to @v, so long as @v was not already @u. 1390 - * Returns original value of @v 1391 - */ 1392 1440 static __always_inline int 1393 1441 arch_atomic_fetch_add_unless(atomic_t *v, int a, int u) 1394 1442 { ··· 1396 1462 #endif 1397 1463 1398 1464 #ifndef arch_atomic_add_unless 1399 - /** 1400 - * arch_atomic_add_unless - add unless the number is already a given value 1401 - * @v: pointer of type atomic_t 1402 - * @a: the amount to add to v... 1403 - * @u: ...unless v is equal to u. 1404 - * 1405 - * Atomically adds @a to @v, if @v was not already @u. 1406 - * Returns true if the addition was done. 1407 - */ 1408 1465 static __always_inline bool 1409 1466 arch_atomic_add_unless(atomic_t *v, int a, int u) 1410 1467 { ··· 1405 1480 #endif 1406 1481 1407 1482 #ifndef arch_atomic_inc_not_zero 1408 - /** 1409 - * arch_atomic_inc_not_zero - increment unless the number is zero 1410 - * @v: pointer of type atomic_t 1411 - * 1412 - * Atomically increments @v by 1, if @v is non-zero. 1413 - * Returns true if the increment was done. 1414 - */ 1415 1483 static __always_inline bool 1416 1484 arch_atomic_inc_not_zero(atomic_t *v) 1417 1485 { ··· 2406 2488 #endif /* arch_atomic64_try_cmpxchg_relaxed */ 2407 2489 2408 2490 #ifndef arch_atomic64_sub_and_test 2409 - /** 2410 - * arch_atomic64_sub_and_test - subtract value from variable and test result 2411 - * @i: integer value to subtract 2412 - * @v: pointer of type atomic64_t 2413 - * 2414 - * Atomically subtracts @i from @v and returns 2415 - * true if the result is zero, or false for all 2416 - * other cases. 2417 - */ 2418 2491 static __always_inline bool 2419 2492 arch_atomic64_sub_and_test(s64 i, atomic64_t *v) 2420 2493 { ··· 2415 2506 #endif 2416 2507 2417 2508 #ifndef arch_atomic64_dec_and_test 2418 - /** 2419 - * arch_atomic64_dec_and_test - decrement and test 2420 - * @v: pointer of type atomic64_t 2421 - * 2422 - * Atomically decrements @v by 1 and 2423 - * returns true if the result is 0, or false for all other 2424 - * cases. 2425 - */ 2426 2509 static __always_inline bool 2427 2510 arch_atomic64_dec_and_test(atomic64_t *v) 2428 2511 { ··· 2424 2523 #endif 2425 2524 2426 2525 #ifndef arch_atomic64_inc_and_test 2427 - /** 2428 - * arch_atomic64_inc_and_test - increment and test 2429 - * @v: pointer of type atomic64_t 2430 - * 2431 - * Atomically increments @v by 1 2432 - * and returns true if the result is zero, or false for all 2433 - * other cases. 2434 - */ 2435 2526 static __always_inline bool 2436 2527 arch_atomic64_inc_and_test(atomic64_t *v) 2437 2528 { ··· 2440 2547 #endif /* arch_atomic64_add_negative */ 2441 2548 2442 2549 #ifndef arch_atomic64_add_negative 2443 - /** 2444 - * arch_atomic64_add_negative - Add and test if negative 2445 - * @i: integer value to add 2446 - * @v: pointer of type atomic64_t 2447 - * 2448 - * Atomically adds @i to @v and returns true if the result is negative, 2449 - * or false when the result is greater than or equal to zero. 2450 - */ 2451 2550 static __always_inline bool 2452 2551 arch_atomic64_add_negative(s64 i, atomic64_t *v) 2453 2552 { ··· 2449 2564 #endif 2450 2565 2451 2566 #ifndef arch_atomic64_add_negative_acquire 2452 - /** 2453 - * arch_atomic64_add_negative_acquire - Add and test if negative 2454 - * @i: integer value to add 2455 - * @v: pointer of type atomic64_t 2456 - * 2457 - * Atomically adds @i to @v and returns true if the result is negative, 2458 - * or false when the result is greater than or equal to zero. 2459 - */ 2460 2567 static __always_inline bool 2461 2568 arch_atomic64_add_negative_acquire(s64 i, atomic64_t *v) 2462 2569 { ··· 2458 2581 #endif 2459 2582 2460 2583 #ifndef arch_atomic64_add_negative_release 2461 - /** 2462 - * arch_atomic64_add_negative_release - Add and test if negative 2463 - * @i: integer value to add 2464 - * @v: pointer of type atomic64_t 2465 - * 2466 - * Atomically adds @i to @v and returns true if the result is negative, 2467 - * or false when the result is greater than or equal to zero. 2468 - */ 2469 2584 static __always_inline bool 2470 2585 arch_atomic64_add_negative_release(s64 i, atomic64_t *v) 2471 2586 { ··· 2467 2598 #endif 2468 2599 2469 2600 #ifndef arch_atomic64_add_negative_relaxed 2470 - /** 2471 - * arch_atomic64_add_negative_relaxed - Add and test if negative 2472 - * @i: integer value to add 2473 - * @v: pointer of type atomic64_t 2474 - * 2475 - * Atomically adds @i to @v and returns true if the result is negative, 2476 - * or false when the result is greater than or equal to zero. 2477 - */ 2478 2601 static __always_inline bool 2479 2602 arch_atomic64_add_negative_relaxed(s64 i, atomic64_t *v) 2480 2603 { ··· 2514 2653 #endif /* arch_atomic64_add_negative_relaxed */ 2515 2654 2516 2655 #ifndef arch_atomic64_fetch_add_unless 2517 - /** 2518 - * arch_atomic64_fetch_add_unless - add unless the number is already a given value 2519 - * @v: pointer of type atomic64_t 2520 - * @a: the amount to add to v... 2521 - * @u: ...unless v is equal to u. 2522 - * 2523 - * Atomically adds @a to @v, so long as @v was not already @u. 2524 - * Returns original value of @v 2525 - */ 2526 2656 static __always_inline s64 2527 2657 arch_atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 u) 2528 2658 { ··· 2530 2678 #endif 2531 2679 2532 2680 #ifndef arch_atomic64_add_unless 2533 - /** 2534 - * arch_atomic64_add_unless - add unless the number is already a given value 2535 - * @v: pointer of type atomic64_t 2536 - * @a: the amount to add to v... 2537 - * @u: ...unless v is equal to u. 2538 - * 2539 - * Atomically adds @a to @v, if @v was not already @u. 2540 - * Returns true if the addition was done. 2541 - */ 2542 2681 static __always_inline bool 2543 2682 arch_atomic64_add_unless(atomic64_t *v, s64 a, s64 u) 2544 2683 { ··· 2539 2696 #endif 2540 2697 2541 2698 #ifndef arch_atomic64_inc_not_zero 2542 - /** 2543 - * arch_atomic64_inc_not_zero - increment unless the number is zero 2544 - * @v: pointer of type atomic64_t 2545 - * 2546 - * Atomically increments @v by 1, if @v is non-zero. 2547 - * Returns true if the increment was done. 2548 - */ 2549 2699 static __always_inline bool 2550 2700 arch_atomic64_inc_not_zero(atomic64_t *v) 2551 2701 { ··· 2597 2761 #endif 2598 2762 2599 2763 #endif /* _LINUX_ATOMIC_FALLBACK_H */ 2600 - // 52dfc6fe4a2e7234bbd2aa3e16a377c1db793a53 2764 + // 9f0fd6ed53267c6ec64e36cd18e6fd8df57ea277
-8
scripts/atomic/fallbacks/add_negative
··· 1 1 cat <<EOF 2 - /** 3 - * arch_${atomic}_add_negative${order} - Add and test if negative 4 - * @i: integer value to add 5 - * @v: pointer of type ${atomic}_t 6 - * 7 - * Atomically adds @i to @v and returns true if the result is negative, 8 - * or false when the result is greater than or equal to zero. 9 - */ 10 2 static __always_inline bool 11 3 arch_${atomic}_add_negative${order}(${int} i, ${atomic}_t *v) 12 4 {
-9
scripts/atomic/fallbacks/add_unless
··· 1 1 cat << EOF 2 - /** 3 - * arch_${atomic}_add_unless - add unless the number is already a given value 4 - * @v: pointer of type ${atomic}_t 5 - * @a: the amount to add to v... 6 - * @u: ...unless v is equal to u. 7 - * 8 - * Atomically adds @a to @v, if @v was not already @u. 9 - * Returns true if the addition was done. 10 - */ 11 2 static __always_inline bool 12 3 arch_${atomic}_add_unless(${atomic}_t *v, ${int} a, ${int} u) 13 4 {
-8
scripts/atomic/fallbacks/dec_and_test
··· 1 1 cat <<EOF 2 - /** 3 - * arch_${atomic}_dec_and_test - decrement and test 4 - * @v: pointer of type ${atomic}_t 5 - * 6 - * Atomically decrements @v by 1 and 7 - * returns true if the result is 0, or false for all other 8 - * cases. 9 - */ 10 2 static __always_inline bool 11 3 arch_${atomic}_dec_and_test(${atomic}_t *v) 12 4 {
-9
scripts/atomic/fallbacks/fetch_add_unless
··· 1 1 cat << EOF 2 - /** 3 - * arch_${atomic}_fetch_add_unless - add unless the number is already a given value 4 - * @v: pointer of type ${atomic}_t 5 - * @a: the amount to add to v... 6 - * @u: ...unless v is equal to u. 7 - * 8 - * Atomically adds @a to @v, so long as @v was not already @u. 9 - * Returns original value of @v 10 - */ 11 2 static __always_inline ${int} 12 3 arch_${atomic}_fetch_add_unless(${atomic}_t *v, ${int} a, ${int} u) 13 4 {
-8
scripts/atomic/fallbacks/inc_and_test
··· 1 1 cat <<EOF 2 - /** 3 - * arch_${atomic}_inc_and_test - increment and test 4 - * @v: pointer of type ${atomic}_t 5 - * 6 - * Atomically increments @v by 1 7 - * and returns true if the result is zero, or false for all 8 - * other cases. 9 - */ 10 2 static __always_inline bool 11 3 arch_${atomic}_inc_and_test(${atomic}_t *v) 12 4 {
-7
scripts/atomic/fallbacks/inc_not_zero
··· 1 1 cat <<EOF 2 - /** 3 - * arch_${atomic}_inc_not_zero - increment unless the number is zero 4 - * @v: pointer of type ${atomic}_t 5 - * 6 - * Atomically increments @v by 1, if @v is non-zero. 7 - * Returns true if the increment was done. 8 - */ 9 2 static __always_inline bool 10 3 arch_${atomic}_inc_not_zero(${atomic}_t *v) 11 4 {
-9
scripts/atomic/fallbacks/sub_and_test
··· 1 1 cat <<EOF 2 - /** 3 - * arch_${atomic}_sub_and_test - subtract value from variable and test result 4 - * @i: integer value to subtract 5 - * @v: pointer of type ${atomic}_t 6 - * 7 - * Atomically subtracts @i from @v and returns 8 - * true if the result is zero, or false for all 9 - * other cases. 10 - */ 11 2 static __always_inline bool 12 3 arch_${atomic}_sub_and_test(${int} i, ${atomic}_t *v) 13 4 {