[PATCH] scsi: megaraid: use max() to make code cleaner

From: cgel . zte
Date: Tue Jan 11 2022 - 04:11:55 EST


From: Changcheng Deng <deng.changcheng@xxxxxxxxxx>

Use max() in order to make code cleaner.

Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
Signed-off-by: Changcheng Deng <deng.changcheng@xxxxxxxxxx>
---
drivers/scsi/megaraid.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index bf987f3a7f3f..17e8a9aeedc4 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -3475,8 +3475,7 @@ mega_m_to_n(void __user *arg, nitioctl_t *uioc)
/*
* Choose the xferlen bigger of input and output data
*/
- uioc->xferlen = uioc_mimd.outlen > uioc_mimd.inlen ?
- uioc_mimd.outlen : uioc_mimd.inlen;
+ uioc->xferlen = max(uioc_mimd.outlen, uioc_mimd.inlen);

if( uioc_mimd.outlen ) uioc->flags = UIOC_RD;
if( uioc_mimd.inlen ) uioc->flags |= UIOC_WR;
--
2.25.1