mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] fusion: mptctl: Use min macro
@ 2024-09-02  1:33 Yan Zhen
  2024-09-13  0:23 ` Martin K. Petersen
  2024-09-19 15:53 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Yan Zhen @ 2024-09-02  1:33 UTC (permalink / raw)
  To: sathya.prakash, sreekanth.reddy, suganath-prabu.subramani
  Cc: MPT-FusionLinux.pdl, linux-scsi, linux-kernel, opensource.kernel,
	Yan Zhen

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>
---

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] fusion: mptctl: Use min macro
  2024-09-02  1:33 [PATCH v2] fusion: mptctl: Use min macro Yan Zhen
@ 2024-09-13  0:23 ` Martin K. Petersen
  2024-09-19 15:53 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2024-09-13  0:23 UTC (permalink / raw)
  To: Yan Zhen
  Cc: sathya.prakash, sreekanth.reddy, suganath-prabu.subramani,
	MPT-FusionLinux.pdl, linux-scsi, linux-kernel, opensource.kernel


Yan,

> 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!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] fusion: mptctl: Use min macro
  2024-09-02  1:33 [PATCH v2] fusion: mptctl: Use min macro Yan Zhen
  2024-09-13  0:23 ` Martin K. Petersen
@ 2024-09-19 15:53 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2024-09-19 15:53 UTC (permalink / raw)
  To: sathya.prakash, sreekanth.reddy, suganath-prabu.subramani, Yan Zhen
  Cc: Martin K . Petersen, MPT-FusionLinux.pdl, linux-scsi,
	linux-kernel, opensource.kernel

On Mon, 02 Sep 2024 09:33:03 +0800, Yan Zhen wrote:

> 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-queue, thanks!

[1/1] fusion: mptctl: Use min macro
      https://git.kernel.org/mkp/scsi/c/e88ed5943289

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-19 15:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-02  1:33 [PATCH v2] fusion: mptctl: Use min macro Yan Zhen
2024-09-13  0:23 ` Martin K. Petersen
2024-09-19 15:53 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®