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.

dma-buf/dma-fence: Remove return code of signaling-functions

All functions used for signaling a fence return an error code whose sole
purpose is to tell whether a fence was already signaled.

This is racy and has been used by almost no party in the kernel, and the
few users have been removed in preceding cleanup commits.

Turn all signaling-functions into void-functions.

Suggested-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patch.msgid.link/20251201105011.19386-9-phasta@kernel.org

+14 -35
+10 -30
drivers/dma-buf/dma-fence.c
··· 358 358 * 359 359 * Unlike dma_fence_signal_timestamp(), this function must be called with 360 360 * &dma_fence.lock held. 361 - * 362 - * Returns 0 on success and a negative error value when @fence has been 363 - * signalled already. 364 361 */ 365 - int dma_fence_signal_timestamp_locked(struct dma_fence *fence, 362 + void dma_fence_signal_timestamp_locked(struct dma_fence *fence, 366 363 ktime_t timestamp) 367 364 { 368 365 struct dma_fence_cb *cur, *tmp; ··· 369 372 370 373 if (unlikely(test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, 371 374 &fence->flags))) 372 - return -EINVAL; 375 + return; 373 376 374 377 /* Stash the cb_list before replacing it with the timestamp */ 375 378 list_replace(&fence->cb_list, &cb_list); ··· 382 385 INIT_LIST_HEAD(&cur->node); 383 386 cur->func(fence, cur); 384 387 } 385 - 386 - return 0; 387 388 } 388 389 EXPORT_SYMBOL(dma_fence_signal_timestamp_locked); 389 390 ··· 396 401 * can only go from the unsignaled to the signaled state and not back, it will 397 402 * only be effective the first time. Set the timestamp provided as the fence 398 403 * signal timestamp. 399 - * 400 - * Returns 0 on success and a negative error value when @fence has been 401 - * signalled already. 402 404 */ 403 - int dma_fence_signal_timestamp(struct dma_fence *fence, ktime_t timestamp) 405 + void dma_fence_signal_timestamp(struct dma_fence *fence, ktime_t timestamp) 404 406 { 405 407 unsigned long flags; 406 - int ret; 407 408 408 409 if (WARN_ON(!fence)) 409 - return -EINVAL; 410 + return; 410 411 411 412 spin_lock_irqsave(fence->lock, flags); 412 - ret = dma_fence_signal_timestamp_locked(fence, timestamp); 413 + dma_fence_signal_timestamp_locked(fence, timestamp); 413 414 spin_unlock_irqrestore(fence->lock, flags); 414 - 415 - return ret; 416 415 } 417 416 EXPORT_SYMBOL(dma_fence_signal_timestamp); 418 417 ··· 422 433 * 423 434 * Unlike dma_fence_signal(), this function must be called with &dma_fence.lock 424 435 * held. 425 - * 426 - * Returns 0 on success and a negative error value when @fence has been 427 - * signalled already. 428 436 */ 429 - int dma_fence_signal_locked(struct dma_fence *fence) 437 + void dma_fence_signal_locked(struct dma_fence *fence) 430 438 { 431 - return dma_fence_signal_timestamp_locked(fence, ktime_get()); 439 + dma_fence_signal_timestamp_locked(fence, ktime_get()); 432 440 } 433 441 EXPORT_SYMBOL(dma_fence_signal_locked); 434 442 ··· 482 496 * dma_fence_add_callback(). Can be called multiple times, but since a fence 483 497 * can only go from the unsignaled to the signaled state and not back, it will 484 498 * only be effective the first time. 485 - * 486 - * Returns 0 on success and a negative error value when @fence has been 487 - * signalled already. 488 499 */ 489 - int dma_fence_signal(struct dma_fence *fence) 500 + void dma_fence_signal(struct dma_fence *fence) 490 501 { 491 502 unsigned long flags; 492 - int ret; 493 503 bool tmp; 494 504 495 505 if (WARN_ON(!fence)) 496 - return -EINVAL; 506 + return; 497 507 498 508 tmp = dma_fence_begin_signalling(); 499 509 500 510 spin_lock_irqsave(fence->lock, flags); 501 - ret = dma_fence_signal_timestamp_locked(fence, ktime_get()); 511 + dma_fence_signal_timestamp_locked(fence, ktime_get()); 502 512 spin_unlock_irqrestore(fence->lock, flags); 503 513 504 514 dma_fence_end_signalling(tmp); 505 - 506 - return ret; 507 515 } 508 516 EXPORT_SYMBOL(dma_fence_signal); 509 517
+4 -5
include/linux/dma-fence.h
··· 364 364 static inline void __dma_fence_might_wait(void) {} 365 365 #endif 366 366 367 - int dma_fence_signal(struct dma_fence *fence); 367 + void dma_fence_signal(struct dma_fence *fence); 368 368 bool dma_fence_check_and_signal(struct dma_fence *fence); 369 369 bool dma_fence_check_and_signal_locked(struct dma_fence *fence); 370 - int dma_fence_signal_locked(struct dma_fence *fence); 371 - int dma_fence_signal_timestamp(struct dma_fence *fence, ktime_t timestamp); 372 - int dma_fence_signal_timestamp_locked(struct dma_fence *fence, 373 - ktime_t timestamp); 370 + void dma_fence_signal_locked(struct dma_fence *fence); 371 + void dma_fence_signal_timestamp(struct dma_fence *fence, ktime_t timestamp); 372 + void dma_fence_signal_timestamp_locked(struct dma_fence *fence, ktime_t timestamp); 374 373 signed long dma_fence_default_wait(struct dma_fence *fence, 375 374 bool intr, signed long timeout); 376 375 int dma_fence_add_callback(struct dma_fence *fence,