Skip to contentSkip to conversation

fusion: mptctl: Use min macro

PATCH Applied Yan Zhen 2 participants 3 messages Sep 2, 2024 – Sep 19, 2024

Subsystems (2)
lore
Share & tools
lore

Yan Zhen

author
#0 lore raw

PATCH v2 1/1 fusion: mptctl: Use min macro

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.

---

Changes in v2:
- Use min(variable, CONSTANT).

 drivers/message/fusion/mptctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/message/fusion/mptctl.c +1 -1
index 9f3999750..17798edf7 100644
@@ -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.
Signature · 1 line
2.34.1
#1 lore raw

Yan,

Quoted 3 lines

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.

Applied to 6.12/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering