summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorEli Billauer <eli.billauer@gmail.com>2026-10-09 09:45:53 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-10-13 16:31:16 +0200
commit9db7ade8f83bb6ad464e67d409048a31b0a0b596 (patch)
treec00a85a57da76ede38610db96736b09b49956ac2 /tools/lib/python
parentca263d97a83cd6e2e646197e46396519ac57dcb6 (diff)
char: xillybus: Avoid possible bandwidth inefficiency
The host flow controls the payload data flow from the FPGA by sending OPCODE_SET_CHECKPOINT messages. Fix the condition for sending such a message, to correctly handle the case where leap < 0. The previous expression leap > (fifo->size >> 3) was not intended to evaluate true when leap is negative. However, due to C's integer promotion rules, leap (of s32 type) is promoted to unsigned int when compared with the unsigned fifo->size >> 3 expression. As a result, negative leap values are interpreted as large positive numbers, causing the condition to evaluate true unintentionally. Consequently, the device receives correctly formed checkpoint messages that encourage it to send data, but too frequently. This may cause the device to send short data chunks, wasting USB bandwidth. Assisted-by: Deepseek:v4-pro Kimi:K2.6 ChatGPT:GPT-5.5 Claude:Sonnet-4.6 Signed-off-by: Eli Billauer <eli.billauer@gmail.com> Link: https://patch.msgid.link/20261009074557.19996-4-eli.billauer@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions