mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
thunderbolt: Use min() for the DMA path credit cap
tb_dma_reserve_credits() caps the request against what the adapter has left by decrementing one credit at a time. The other arm of the same if() already caps with min(port->total_credits, credits); use min() here too. No functional change: the object code is unchanged. Assisted-by: Claude:claude-opus-5 Signed-off-by: Fan Ye <fy15309206903@gmail.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
This commit is contained in:
parent
f7c0e02eb6
commit
e8158c8a6a
|
|
@ -1778,8 +1778,7 @@ static int tb_dma_reserve_credits(struct tb_path_hop *hop, unsigned int credits)
|
|||
if (available < TB_MIN_DMA_CREDITS)
|
||||
return -ENOSPC;
|
||||
|
||||
while (credits > available)
|
||||
credits--;
|
||||
credits = min(credits, available);
|
||||
|
||||
tb_port_dbg(port, "reserving %u credits for DMA path\n",
|
||||
credits);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user