]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scsi: lpfc: Use min_t() instead of min() in lpfc_sli4_driver_resource_setup
authorJustin Tee <justin.tee@broadcom.com>
Thu, 12 Feb 2026 21:29:59 +0000 (13:29 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 24 Feb 2026 18:06:51 +0000 (13:06 -0500)
The member called cfg_sg_dma_buf_size is declared as a u32, while the
min comparator's second argument called SLI4_PAGE_SIZE is a #define.
Proper comparison should be using the same type, therefore change to use
min_t.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://patch.msgid.link/20260212213008.149873-5-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_init.c

index 94ad253d65a04339efe3dbb6879398cf65776fd9..be65496fc1c7b4764b220a8ed84e732cf0d42344 100644 (file)
@@ -1,7 +1,7 @@
 /*******************************************************************
  * This file is part of the Emulex Linux Device Driver for         *
  * Fibre Channel Host Bus Adapters.                                *
- * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term *
+ * Copyright (C) 2017-2026 Broadcom. All Rights Reserved. The term *
  * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.  *
  * Copyright (C) 2004-2016 Emulex.  All rights reserved.           *
  * EMULEX and SLI are trademarks of Emulex.                        *
@@ -8283,7 +8283,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
                        phba->cfg_total_seg_cnt,  phba->cfg_scsi_seg_cnt,
                        phba->cfg_nvme_seg_cnt);
 
-       i = min(phba->cfg_sg_dma_buf_size, SLI4_PAGE_SIZE);
+       i = min_t(u32, phba->cfg_sg_dma_buf_size, SLI4_PAGE_SIZE);
 
        phba->lpfc_sg_dma_buf_pool =
                        dma_pool_create("lpfc_sg_dma_buf_pool",