lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240902013303.909316-1-yanzhen@vivo.com>
Date: Mon,  2 Sep 2024 09:33:03 +0800
From: Yan Zhen <yanzhen@...o.com>
To: sathya.prakash@...adcom.com,
	sreekanth.reddy@...adcom.com,
	suganath-prabu.subramani@...adcom.com
Cc: MPT-FusionLinux.pdl@...adcom.com,
	linux-scsi@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	opensource.kernel@...o.com,
	Yan Zhen <yanzhen@...o.com>
Subject: [PATCH v2] 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.

Signed-off-by: Yan Zhen <yanzhen@...o.com>
---

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

 drivers/message/fusion/mptctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
index 9f3999750..17798edf7 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -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.
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ