[PATCH] scsi: mpt3sas: remove useless comparisons in _base_get_chain_buffer_dma_to_chain_buffer(), _base_release_memory_pools()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Local variable 'ct' is initialized by an address
of field of MPT3SAS_ADAPTER structure, so it does
not make sense to compare 'ct' with NULL.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Andrey Strachuk <strochuk@xxxxxxxxx>
Fixes: 93204b782a88 ("scsi: mpt3sas: Lockless access for chain buffers.")
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 9a1ae52bb621..dead0f7d4d9e 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -396,7 +396,7 @@ _base_get_chain_buffer_dma_to_chain_buffer(struct MPT3SAS_ADAPTER *ioc,
 	for (index = 0; index < ioc->scsiio_depth; index++) {
 		for (j = 0; j < ioc->chains_needed_per_io; j++) {
 			ct = &ioc->chain_lookup[index].chains_per_smid[j];
-			if (ct && ct->chain_buffer_dma == chain_buffer_dma)
+			if (ct->chain_buffer_dma == chain_buffer_dma)
 				return ct->chain_buffer;
 		}
 	}
@@ -5699,7 +5699,7 @@ _base_release_memory_pools(struct MPT3SAS_ADAPTER *ioc)
 			for (j = ioc->chains_per_prp_buffer;
 			    j < ioc->chains_needed_per_io; j++) {
 				ct = &ioc->chain_lookup[i].chains_per_smid[j];
-				if (ct && ct->chain_buffer)
+				if (ct->chain_buffer)
 					dma_pool_free(ioc->chain_dma_pool,
 						ct->chain_buffer,
 						ct->chain_buffer_dma);
-- 
2.25.1




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux