]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firewire: ohci: use MAX macro to guarantee minimum count of pages for AR contexts
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sat, 10 Jan 2026 01:39:09 +0000 (10:39 +0900)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 12 Jan 2026 02:49:38 +0000 (11:49 +0900)
The computation of page size for AR DMA context can be simplified by MAX
macro.

Link: https://lore.kernel.org/r/20260110013911.19160-7-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
drivers/firewire/ohci.c

index 68a336577d3692476e2770cb5e3975040bd9ee71..f6da4cd7d1233966b7e0d1f6212133bd9887502f 100644 (file)
@@ -86,7 +86,7 @@ struct descriptor {
 #define AR_BUFFER_SIZE (32*1024)
 #define AR_BUFFERS_MIN DIV_ROUND_UP(AR_BUFFER_SIZE, PAGE_SIZE)
 /* we need at least two pages for proper list management */
-#define AR_BUFFERS     (AR_BUFFERS_MIN >= 2 ? AR_BUFFERS_MIN : 2)
+#define AR_BUFFERS     MAX(2, AR_BUFFERS_MIN)
 
 #define MAX_ASYNC_PAYLOAD      4096
 #define MAX_AR_PACKET_SIZE     (16 + MAX_ASYNC_PAYLOAD + 4)