scsi: fusion: mptctl: Use min() macro
authorYan Zhen <yanzhen@vivo.com>
Mon, 2 Sep 2024 01:33:03 +0000 (09:33 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 13 Sep 2024 00:23:03 +0000 (20:23 -0400)
Using the real macro is usually more intuitive and readable when the
original file is guaranteed to contain the minmax.h header file and compile
correctly.

Signed-off-by: Yan Zhen <yanzhen@vivo.com>
Link: https://lore.kernel.org/r/20240902013303.909316-1-yanzhen@vivo.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/message/fusion/mptctl.c

index 9f39997..087397c 100644 (file)
@@ -1609,7 +1609,7 @@ mptctl_eventreport (MPT_ADAPTER *ioc, unsigned long arg)
        maxEvents = numBytes/sizeof(MPT_IOCTL_EVENTS);
 
 
-       max = MPTCTL_EVENT_LOG_SIZE < maxEvents ? MPTCTL_EVENT_LOG_SIZE : maxEvents;
+       max = min(maxEvents, MPTCTL_EVENT_LOG_SIZE);
 
        /* If fewer than 1 event is requested, there must have
         * been some type of error.