[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251209094333.116276-1-buaajxlj@163.com>
Date: Tue, 9 Dec 2025 17:43:32 +0800
From: Liang Jie <buaajxlj@....com>
To: "James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Liang Jie <liangjie@...iang.com>,
linux-scsi@...r.kernel.org (open list:SCSI SUBSYSTEM),
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH] scsi: cxgbi: simplify cxgbi_sock_free_cpl_skbs()
From: Liang Jie <liangjie@...iang.com>
kfree_skb(NULL) is a no-op, so the explicit NULL checks before
kfree_skb() are redundant. Drop the checks and keep the NULL
assignments to simplify the code.
No functional change intended.
Signed-off-by: Liang Jie <liangjie@...iang.com>
---
drivers/scsi/cxgbi/libcxgbi.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index bf75940f2be1..ce4351232a5d 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -539,18 +539,14 @@ static void sock_put_port(struct cxgbi_sock *csk)
*/
void cxgbi_sock_free_cpl_skbs(struct cxgbi_sock *csk)
{
- if (csk->cpl_close) {
- kfree_skb(csk->cpl_close);
- csk->cpl_close = NULL;
- }
- if (csk->cpl_abort_req) {
- kfree_skb(csk->cpl_abort_req);
- csk->cpl_abort_req = NULL;
- }
- if (csk->cpl_abort_rpl) {
- kfree_skb(csk->cpl_abort_rpl);
- csk->cpl_abort_rpl = NULL;
- }
+ kfree_skb(csk->cpl_close);
+ csk->cpl_close = NULL;
+
+ kfree_skb(csk->cpl_abort_req);
+ csk->cpl_abort_req = NULL;
+
+ kfree_skb(csk->cpl_abort_rpl);
+ csk->cpl_abort_rpl = NULL;
}
EXPORT_SYMBOL_GPL(cxgbi_sock_free_cpl_skbs);
--
2.25.1
Powered by blists - more mailing lists