Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 14d72d4

Browse files
mrutland-armPeter Zijlstra
authored andcommitted
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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent dda5f31 commit 14d72d4

File tree

8 files changed

+1
-223
lines changed

8 files changed

+1
-223
lines changed

include/linux/atomic/atomic-arch-fallback.h

Lines changed: 1 addition & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,15 +1272,6 @@ arch_atomic_try_cmpxchg(atomic_t *v, int *old, int new)
12721272
#endif /* arch_atomic_try_cmpxchg_relaxed */
12731273

12741274
#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-
*/
12841275
static __always_inline bool
12851276
arch_atomic_sub_and_test(int i, atomic_t *v)
12861277
{
@@ -1290,14 +1281,6 @@ arch_atomic_sub_and_test(int i, atomic_t *v)
12901281
#endif
12911282

12921283
#ifndef arch_atomic_dec_and_test
1293-
/**
1294-
* arch_atomic_dec_and_test - decrement and test
1295-
* @v: pointer of type atomic_t
1296-
*
1297-
* Atomically decrements @v by 1 and
1298-
* returns true if the result is 0, or false for all other
1299-
* cases.
1300-
*/
13011284
static __always_inline bool
13021285
arch_atomic_dec_and_test(atomic_t *v)
13031286
{
@@ -1307,14 +1290,6 @@ arch_atomic_dec_and_test(atomic_t *v)
13071290
#endif
13081291

13091292
#ifndef arch_atomic_inc_and_test
1310-
/**
1311-
* arch_atomic_inc_and_test - increment and test
1312-
* @v: pointer of type atomic_t
1313-
*
1314-
* Atomically increments @v by 1
1315-
* and returns true if the result is zero, or false for all
1316-
* other cases.
1317-
*/
13181293
static __always_inline bool
13191294
arch_atomic_inc_and_test(atomic_t *v)
13201295
{
@@ -1331,14 +1306,6 @@ arch_atomic_inc_and_test(atomic_t *v)
13311306
#endif /* arch_atomic_add_negative */
13321307

13331308
#ifndef arch_atomic_add_negative
1334-
/**
1335-
* arch_atomic_add_negative - Add and test if negative
1336-
* @i: integer value to add
1337-
* @v: pointer of type atomic_t
1338-
*
1339-
* Atomically adds @i to @v and returns true if the result is negative,
1340-
* or false when the result is greater than or equal to zero.
1341-
*/
13421309
static __always_inline bool
13431310
arch_atomic_add_negative(int i, atomic_t *v)
13441311
{
@@ -1348,14 +1315,6 @@ arch_atomic_add_negative(int i, atomic_t *v)
13481315
#endif
13491316

13501317
#ifndef arch_atomic_add_negative_acquire
1351-
/**
1352-
* arch_atomic_add_negative_acquire - Add and test if negative
1353-
* @i: integer value to add
1354-
* @v: pointer of type atomic_t
1355-
*
1356-
* Atomically adds @i to @v and returns true if the result is negative,
1357-
* or false when the result is greater than or equal to zero.
1358-
*/
13591318
static __always_inline bool
13601319
arch_atomic_add_negative_acquire(int i, atomic_t *v)
13611320
{
@@ -1365,14 +1324,6 @@ arch_atomic_add_negative_acquire(int i, atomic_t *v)
13651324
#endif
13661325

13671326
#ifndef arch_atomic_add_negative_release
1368-
/**
1369-
* arch_atomic_add_negative_release - Add and test if negative
1370-
* @i: integer value to add
1371-
* @v: pointer of type atomic_t
1372-
*
1373-
* Atomically adds @i to @v and returns true if the result is negative,
1374-
* or false when the result is greater than or equal to zero.
1375-
*/
13761327
static __always_inline bool
13771328
arch_atomic_add_negative_release(int i, atomic_t *v)
13781329
{
@@ -1382,14 +1333,6 @@ arch_atomic_add_negative_release(int i, atomic_t *v)
13821333
#endif
13831334

13841335
#ifndef arch_atomic_add_negative_relaxed
1385-
/**
1386-
* arch_atomic_add_negative_relaxed - Add and test if negative
1387-
* @i: integer value to add
1388-
* @v: pointer of type atomic_t
1389-
*
1390-
* Atomically adds @i to @v and returns true if the result is negative,
1391-
* or false when the result is greater than or equal to zero.
1392-
*/
13931336
static __always_inline bool
13941337
arch_atomic_add_negative_relaxed(int i, atomic_t *v)
13951338
{
@@ -1437,15 +1380,6 @@ arch_atomic_add_negative(int i, atomic_t *v)
14371380
#endif /* arch_atomic_add_negative_relaxed */
14381381

14391382
#ifndef arch_atomic_fetch_add_unless
1440-
/**
1441-
* arch_atomic_fetch_add_unless - add unless the number is already a given value
1442-
* @v: pointer of type atomic_t
1443-
* @a: the amount to add to v...
1444-
* @u: ...unless v is equal to u.
1445-
*
1446-
* Atomically adds @a to @v, so long as @v was not already @u.
1447-
* Returns original value of @v
1448-
*/
14491383
static __always_inline int
14501384
arch_atomic_fetch_add_unless(atomic_t *v, int a, int u)
14511385
{
@@ -1462,15 +1396,6 @@ arch_atomic_fetch_add_unless(atomic_t *v, int a, int u)
14621396
#endif
14631397

14641398
#ifndef arch_atomic_add_unless
1465-
/**
1466-
* arch_atomic_add_unless - add unless the number is already a given value
1467-
* @v: pointer of type atomic_t
1468-
* @a: the amount to add to v...
1469-
* @u: ...unless v is equal to u.
1470-
*
1471-
* Atomically adds @a to @v, if @v was not already @u.
1472-
* Returns true if the addition was done.
1473-
*/
14741399
static __always_inline bool
14751400
arch_atomic_add_unless(atomic_t *v, int a, int u)
14761401
{
@@ -1480,13 +1405,6 @@ arch_atomic_add_unless(atomic_t *v, int a, int u)
14801405
#endif
14811406

14821407
#ifndef arch_atomic_inc_not_zero
1483-
/**
1484-
* arch_atomic_inc_not_zero - increment unless the number is zero
1485-
* @v: pointer of type atomic_t
1486-
*
1487-
* Atomically increments @v by 1, if @v is non-zero.
1488-
* Returns true if the increment was done.
1489-
*/
14901408
static __always_inline bool
14911409
arch_atomic_inc_not_zero(atomic_t *v)
14921410
{
@@ -2488,15 +2406,6 @@ arch_atomic64_try_cmpxchg(atomic64_t *v, s64 *old, s64 new)
24882406
#endif /* arch_atomic64_try_cmpxchg_relaxed */
24892407

24902408
#ifndef arch_atomic64_sub_and_test
2491-
/**
2492-
* arch_atomic64_sub_and_test - subtract value from variable and test result
2493-
* @i: integer value to subtract
2494-
* @v: pointer of type atomic64_t
2495-
*
2496-
* Atomically subtracts @i from @v and returns
2497-
* true if the result is zero, or false for all
2498-
* other cases.
2499-
*/
25002409
static __always_inline bool
25012410
arch_atomic64_sub_and_test(s64 i, atomic64_t *v)
25022411
{
@@ -2506,14 +2415,6 @@ arch_atomic64_sub_and_test(s64 i, atomic64_t *v)
25062415
#endif
25072416

25082417
#ifndef arch_atomic64_dec_and_test
2509-
/**
2510-
* arch_atomic64_dec_and_test - decrement and test
2511-
* @v: pointer of type atomic64_t
2512-
*
2513-
* Atomically decrements @v by 1 and
2514-
* returns true if the result is 0, or false for all other
2515-
* cases.
2516-
*/
25172418
static __always_inline bool
25182419
arch_atomic64_dec_and_test(atomic64_t *v)
25192420
{
@@ -2523,14 +2424,6 @@ arch_atomic64_dec_and_test(atomic64_t *v)
25232424
#endif
25242425

25252426
#ifndef arch_atomic64_inc_and_test
2526-
/**
2527-
* arch_atomic64_inc_and_test - increment and test
2528-
* @v: pointer of type atomic64_t
2529-
*
2530-
* Atomically increments @v by 1
2531-
* and returns true if the result is zero, or false for all
2532-
* other cases.
2533-
*/
25342427
static __always_inline bool
25352428
arch_atomic64_inc_and_test(atomic64_t *v)
25362429
{
@@ -2547,14 +2440,6 @@ arch_atomic64_inc_and_test(atomic64_t *v)
25472440
#endif /* arch_atomic64_add_negative */
25482441

25492442
#ifndef arch_atomic64_add_negative
2550-
/**
2551-
* arch_atomic64_add_negative - Add and test if negative
2552-
* @i: integer value to add
2553-
* @v: pointer of type atomic64_t
2554-
*
2555-
* Atomically adds @i to @v and returns true if the result is negative,
2556-
* or false when the result is greater than or equal to zero.
2557-
*/
25582443
static __always_inline bool
25592444
arch_atomic64_add_negative(s64 i, atomic64_t *v)
25602445
{
@@ -2564,14 +2449,6 @@ arch_atomic64_add_negative(s64 i, atomic64_t *v)
25642449
#endif
25652450

25662451
#ifndef arch_atomic64_add_negative_acquire
2567-
/**
2568-
* arch_atomic64_add_negative_acquire - Add and test if negative
2569-
* @i: integer value to add
2570-
* @v: pointer of type atomic64_t
2571-
*
2572-
* Atomically adds @i to @v and returns true if the result is negative,
2573-
* or false when the result is greater than or equal to zero.
2574-
*/
25752452
static __always_inline bool
25762453
arch_atomic64_add_negative_acquire(s64 i, atomic64_t *v)
25772454
{
@@ -2581,14 +2458,6 @@ arch_atomic64_add_negative_acquire(s64 i, atomic64_t *v)
25812458
#endif
25822459

25832460
#ifndef arch_atomic64_add_negative_release
2584-
/**
2585-
* arch_atomic64_add_negative_release - Add and test if negative
2586-
* @i: integer value to add
2587-
* @v: pointer of type atomic64_t
2588-
*
2589-
* Atomically adds @i to @v and returns true if the result is negative,
2590-
* or false when the result is greater than or equal to zero.
2591-
*/
25922461
static __always_inline bool
25932462
arch_atomic64_add_negative_release(s64 i, atomic64_t *v)
25942463
{
@@ -2598,14 +2467,6 @@ arch_atomic64_add_negative_release(s64 i, atomic64_t *v)
25982467
#endif
25992468

26002469
#ifndef arch_atomic64_add_negative_relaxed
2601-
/**
2602-
* arch_atomic64_add_negative_relaxed - Add and test if negative
2603-
* @i: integer value to add
2604-
* @v: pointer of type atomic64_t
2605-
*
2606-
* Atomically adds @i to @v and returns true if the result is negative,
2607-
* or false when the result is greater than or equal to zero.
2608-
*/
26092470
static __always_inline bool
26102471
arch_atomic64_add_negative_relaxed(s64 i, atomic64_t *v)
26112472
{
@@ -2653,15 +2514,6 @@ arch_atomic64_add_negative(s64 i, atomic64_t *v)
26532514
#endif /* arch_atomic64_add_negative_relaxed */
26542515

26552516
#ifndef arch_atomic64_fetch_add_unless
2656-
/**
2657-
* arch_atomic64_fetch_add_unless - add unless the number is already a given value
2658-
* @v: pointer of type atomic64_t
2659-
* @a: the amount to add to v...
2660-
* @u: ...unless v is equal to u.
2661-
*
2662-
* Atomically adds @a to @v, so long as @v was not already @u.
2663-
* Returns original value of @v
2664-
*/
26652517
static __always_inline s64
26662518
arch_atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 u)
26672519
{
@@ -2678,15 +2530,6 @@ arch_atomic64_fetch_add_unless(atomic64_t *v, s64 a, s64 u)
26782530
#endif
26792531

26802532
#ifndef arch_atomic64_add_unless
2681-
/**
2682-
* arch_atomic64_add_unless - add unless the number is already a given value
2683-
* @v: pointer of type atomic64_t
2684-
* @a: the amount to add to v...
2685-
* @u: ...unless v is equal to u.
2686-
*
2687-
* Atomically adds @a to @v, if @v was not already @u.
2688-
* Returns true if the addition was done.
2689-
*/
26902533
static __always_inline bool
26912534
arch_atomic64_add_unless(atomic64_t *v, s64 a, s64 u)
26922535
{
@@ -2696,13 +2539,6 @@ arch_atomic64_add_unless(atomic64_t *v, s64 a, s64 u)
26962539
#endif
26972540

26982541
#ifndef arch_atomic64_inc_not_zero
2699-
/**
2700-
* arch_atomic64_inc_not_zero - increment unless the number is zero
2701-
* @v: pointer of type atomic64_t
2702-
*
2703-
* Atomically increments @v by 1, if @v is non-zero.
2704-
* Returns true if the increment was done.
2705-
*/
27062542
static __always_inline bool
27072543
arch_atomic64_inc_not_zero(atomic64_t *v)
27082544
{
@@ -2761,4 +2597,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v)
27612597
#endif
27622598

27632599
#endif /* _LINUX_ATOMIC_FALLBACK_H */
2764-
// 52dfc6fe4a2e7234bbd2aa3e16a377c1db793a53
2600+
// 9f0fd6ed53267c6ec64e36cd18e6fd8df57ea277

scripts/atomic/fallbacks/add_negative

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
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-
*/
102
static __always_inline bool
113
arch_${atomic}_add_negative${order}(${int} i, ${atomic}_t *v)
124
{

scripts/atomic/fallbacks/add_unless

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
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-
*/
112
static __always_inline bool
123
arch_${atomic}_add_unless(${atomic}_t *v, ${int} a, ${int} u)
134
{

scripts/atomic/fallbacks/dec_and_test

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
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-
*/
102
static __always_inline bool
113
arch_${atomic}_dec_and_test(${atomic}_t *v)
124
{

scripts/atomic/fallbacks/fetch_add_unless

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
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-
*/
112
static __always_inline ${int}
123
arch_${atomic}_fetch_add_unless(${atomic}_t *v, ${int} a, ${int} u)
134
{

scripts/atomic/fallbacks/inc_and_test

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
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-
*/
102
static __always_inline bool
113
arch_${atomic}_inc_and_test(${atomic}_t *v)
124
{

scripts/atomic/fallbacks/inc_not_zero

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
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-
*/
92
static __always_inline bool
103
arch_${atomic}_inc_not_zero(${atomic}_t *v)
114
{

0 commit comments

Comments
 (0)