Attempt uniformity and brevity.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -247,9 +247,9 @@ SEQCOUNT_LOCKTYPE(struct ww_mutex, ww_mutex, true, &s->lock->base) · 246 unmodified lines | ||
| 247 | 247 | __seqprop_case((s), mutex, prop), \ |
| 248 | 248 | __seqprop_case((s), ww_mutex, prop)) |
| 249 | 249 | |
| 250 | −#define __to_seqcount_t(s) __seqprop(s, ptr) | |
| 251 | −#define __associated_lock_exists_and_is_preemptible(s) __seqprop(s, preemptible) | |
| 252 | −#define __assert_write_section_is_protected(s) __seqprop(s, assert) | |
| 250 | +#define __seqcount_ptr(s) __seqprop(s, ptr) | |
| 251 | +#define __seqcount_lock_preemptible(s) __seqprop(s, preemptible) | |
| 252 | +#define __seqcount_assert_lock_held(s) __seqprop(s, assert) | |
| 253 | 253 | |
| 254 | 254 | /** |
| 255 | 255 | * __read_seqcount_begin() - begin a seqcount_t read section w/o barrier |
| @@ -266,7 +266,7 @@ SEQCOUNT_LOCKTYPE(struct ww_mutex, ww_mutex, true, &s->lock->base) · 10 unmodified lines | ||
| 266 | 266 | * Return: count to be passed to read_seqcount_retry() |
| 267 | 267 | */ |
| 268 | 268 | #define __read_seqcount_begin(s) \ |
| 269 | − __read_seqcount_t_begin(__to_seqcount_t(s)) | |
| 269 | + __read_seqcount_t_begin(__seqcount_ptr(s)) | |
| 270 | 270 | |
| 271 | 271 | static inline unsigned __read_seqcount_t_begin(const seqcount_t *s) |
| 272 | 272 | { |
| @@ -289,7 +289,7 @@ repeat: · 16 unmodified lines | ||
| 289 | 289 | * Return: count to be passed to read_seqcount_retry() |
| 290 | 290 | */ |
| 291 | 291 | #define raw_read_seqcount_begin(s) \ |
| 292 | − raw_read_seqcount_t_begin(__to_seqcount_t(s)) | |
| 292 | + raw_read_seqcount_t_begin(__seqcount_ptr(s)) | |
| 293 | 293 | |
| 294 | 294 | static inline unsigned raw_read_seqcount_t_begin(const seqcount_t *s) |
| 295 | 295 | { |
| @@ -305,7 +305,7 @@ static inline unsigned raw_read_seqcount_t_begin(const seqcount_t *s) · 9 unmodified lines | ||
| 305 | 305 | * Return: count to be passed to read_seqcount_retry() |
| 306 | 306 | */ |
| 307 | 307 | #define read_seqcount_begin(s) \ |
| 308 | − read_seqcount_t_begin(__to_seqcount_t(s)) | |
| 308 | + read_seqcount_t_begin(__seqcount_ptr(s)) | |
| 309 | 309 | |
| 310 | 310 | static inline unsigned read_seqcount_t_begin(const seqcount_t *s) |
| 311 | 311 | { |
| @@ -325,7 +325,7 @@ static inline unsigned read_seqcount_t_begin(const seqcount_t *s) · 13 unmodified lines | ||
| 325 | 325 | * Return: count to be passed to read_seqcount_retry() |
| 326 | 326 | */ |
| 327 | 327 | #define raw_read_seqcount(s) \ |
| 328 | − raw_read_seqcount_t(__to_seqcount_t(s)) | |
| 328 | + raw_read_seqcount_t(__seqcount_ptr(s)) | |
| 329 | 329 | |
| 330 | 330 | static inline unsigned raw_read_seqcount_t(const seqcount_t *s) |
| 331 | 331 | { |
| @@ -353,7 +353,7 @@ static inline unsigned raw_read_seqcount_t(const seqcount_t *s) · 21 unmodified lines | ||
| 353 | 353 | * Return: count to be passed to read_seqcount_retry() |
| 354 | 354 | */ |
| 355 | 355 | #define raw_seqcount_begin(s) \ |
| 356 | − raw_seqcount_t_begin(__to_seqcount_t(s)) | |
| 356 | + raw_seqcount_t_begin(__seqcount_ptr(s)) | |
| 357 | 357 | |
| 358 | 358 | static inline unsigned raw_seqcount_t_begin(const seqcount_t *s) |
| 359 | 359 | { |
| @@ -380,7 +380,7 @@ static inline unsigned raw_seqcount_t_begin(const seqcount_t *s) · 20 unmodified lines | ||
| 380 | 380 | * Return: true if a read section retry is required, else false |
| 381 | 381 | */ |
| 382 | 382 | #define __read_seqcount_retry(s, start) \ |
| 383 | − __read_seqcount_t_retry(__to_seqcount_t(s), start) | |
| 383 | + __read_seqcount_t_retry(__seqcount_ptr(s), start) | |
| 384 | 384 | |
| 385 | 385 | static inline int __read_seqcount_t_retry(const seqcount_t *s, unsigned start) |
| 386 | 386 | { |
| @@ -400,7 +400,7 @@ static inline int __read_seqcount_t_retry(const seqcount_t *s, unsigned start) · 13 unmodified lines | ||
| 400 | 400 | * Return: true if a read section retry is required, else false |
| 401 | 401 | */ |
| 402 | 402 | #define read_seqcount_retry(s, start) \ |
| 403 | − read_seqcount_t_retry(__to_seqcount_t(s), start) | |
| 403 | + read_seqcount_t_retry(__seqcount_ptr(s), start) | |
| 404 | 404 | |
| 405 | 405 | static inline int read_seqcount_t_retry(const seqcount_t *s, unsigned start) |
| 406 | 406 | { |
| @@ -414,10 +414,10 @@ static inline int read_seqcount_t_retry(const seqcount_t *s, unsigned start) · 7 unmodified lines | ||
| 414 | 414 | */ |
| 415 | 415 | #define raw_write_seqcount_begin(s) \ |
| 416 | 416 | do { \ |
| 417 | − if (__associated_lock_exists_and_is_preemptible(s)) \ | |
| 417 | + if (__seqcount_lock_preemptible(s)) \ | |
| 418 | 418 | preempt_disable(); \ |
| 419 | 419 | \ |
| 420 | − raw_write_seqcount_t_begin(__to_seqcount_t(s)); \ | |
| 420 | + raw_write_seqcount_t_begin(__seqcount_ptr(s)); \ | |
| 421 | 421 | } while (0) |
| 422 | 422 | |
| 423 | 423 | static inline void raw_write_seqcount_t_begin(seqcount_t *s) |
| @@ -433,9 +433,9 @@ static inline void raw_write_seqcount_t_begin(seqcount_t *s) · 9 unmodified lines | ||
| 433 | 433 | */ |
| 434 | 434 | #define raw_write_seqcount_end(s) \ |
| 435 | 435 | do { \ |
| 436 | − raw_write_seqcount_t_end(__to_seqcount_t(s)); \ | |
| 436 | + raw_write_seqcount_t_end(__seqcount_ptr(s)); \ | |
| 437 | 437 | \ |
| 438 | − if (__associated_lock_exists_and_is_preemptible(s)) \ | |
| 438 | + if (__seqcount_lock_preemptible(s)) \ | |
| 439 | 439 | preempt_enable(); \ |
| 440 | 440 | } while (0) |
| 441 | 441 | |
| @@ -456,12 +456,12 @@ static inline void raw_write_seqcount_t_end(seqcount_t *s) · 14 unmodified lines | ||
| 456 | 456 | */ |
| 457 | 457 | #define write_seqcount_begin_nested(s, subclass) \ |
| 458 | 458 | do { \ |
| 459 | − __assert_write_section_is_protected(s); \ | |
| 459 | + __seqcount_assert_lock_held(s); \ | |
| 460 | 460 | \ |
| 461 | − if (__associated_lock_exists_and_is_preemptible(s)) \ | |
| 461 | + if (__seqcount_lock_preemptible(s)) \ | |
| 462 | 462 | preempt_disable(); \ |
| 463 | 463 | \ |
| 464 | − write_seqcount_t_begin_nested(__to_seqcount_t(s), subclass); \ | |
| 464 | + write_seqcount_t_begin_nested(__seqcount_ptr(s), subclass); \ | |
| 465 | 465 | } while (0) |
| 466 | 466 | |
| 467 | 467 | static inline void write_seqcount_t_begin_nested(seqcount_t *s, int subclass) |
| @@ -483,12 +483,12 @@ static inline void write_seqcount_t_begin_nested(seqcount_t *s, int subclass) · 15 unmodified lines | ||
| 483 | 483 | */ |
| 484 | 484 | #define write_seqcount_begin(s) \ |
| 485 | 485 | do { \ |
| 486 | − __assert_write_section_is_protected(s); \ | |
| 486 | + __seqcount_assert_lock_held(s); \ | |
| 487 | 487 | \ |
| 488 | − if (__associated_lock_exists_and_is_preemptible(s)) \ | |
| 488 | + if (__seqcount_lock_preemptible(s)) \ | |
| 489 | 489 | preempt_disable(); \ |
| 490 | 490 | \ |
| 491 | − write_seqcount_t_begin(__to_seqcount_t(s)); \ | |
| 491 | + write_seqcount_t_begin(__seqcount_ptr(s)); \ | |
| 492 | 492 | } while (0) |
| 493 | 493 | |
| 494 | 494 | static inline void write_seqcount_t_begin(seqcount_t *s) |
| @@ -504,9 +504,9 @@ static inline void write_seqcount_t_begin(seqcount_t *s) · 9 unmodified lines | ||
| 504 | 504 | */ |
| 505 | 505 | #define write_seqcount_end(s) \ |
| 506 | 506 | do { \ |
| 507 | − write_seqcount_t_end(__to_seqcount_t(s)); \ | |
| 507 | + write_seqcount_t_end(__seqcount_ptr(s)); \ | |
| 508 | 508 | \ |
| 509 | − if (__associated_lock_exists_and_is_preemptible(s)) \ | |
| 509 | + if (__seqcount_lock_preemptible(s)) \ | |
| 510 | 510 | preempt_enable(); \ |
| 511 | 511 | } while (0) |
| 512 | 512 | |
| @@ -558,7 +558,7 @@ static inline void write_seqcount_t_end(seqcount_t *s) · 45 unmodified lines | ||
| 558 | 558 | * } |
| 559 | 559 | */ |
| 560 | 560 | #define raw_write_seqcount_barrier(s) \ |
| 561 | − raw_write_seqcount_t_barrier(__to_seqcount_t(s)) | |
| 561 | + raw_write_seqcount_t_barrier(__seqcount_ptr(s)) | |
| 562 | 562 | |
| 563 | 563 | static inline void raw_write_seqcount_t_barrier(seqcount_t *s) |
| 564 | 564 | { |
| @@ -578,7 +578,7 @@ static inline void raw_write_seqcount_t_barrier(seqcount_t *s) · 13 unmodified lines | ||
| 578 | 578 | * will complete successfully and see data older than this. |
| 579 | 579 | */ |
| 580 | 580 | #define write_seqcount_invalidate(s) \ |
| 581 | − write_seqcount_t_invalidate(__to_seqcount_t(s)) | |
| 581 | + write_seqcount_t_invalidate(__seqcount_ptr(s)) | |
| 582 | 582 | |
| 583 | 583 | static inline void write_seqcount_t_invalidate(seqcount_t *s) |
| 584 | 584 | { |
| @@ -604,7 +604,7 @@ static inline void write_seqcount_t_invalidate(seqcount_t *s) · 19 unmodified lines | ||
| 604 | 604 | * checked with read_seqcount_retry(). |
| 605 | 605 | */ |
| 606 | 606 | #define raw_read_seqcount_latch(s) \ |
| 607 | − raw_read_seqcount_t_latch(__to_seqcount_t(s)) | |
| 607 | + raw_read_seqcount_t_latch(__seqcount_ptr(s)) | |
| 608 | 608 | |
| 609 | 609 | static inline int raw_read_seqcount_t_latch(seqcount_t *s) |
| 610 | 610 | { |
| @@ -695,7 +695,7 @@ static inline int raw_read_seqcount_t_latch(seqcount_t *s) · 84 unmodified lines | ||
| 695 | 695 | * patterns to manage the lifetimes of the objects within. |
| 696 | 696 | */ |
| 697 | 697 | #define raw_write_seqcount_latch(s) \ |
| 698 | − raw_write_seqcount_t_latch(__to_seqcount_t(s)) | |
| 698 | + raw_write_seqcount_t_latch(__seqcount_ptr(s)) | |
| 699 | 699 | |
| 700 | 700 | static inline void raw_write_seqcount_t_latch(seqcount_t *s) |
| 701 | 701 | { |