Message ID | 20231218153105.12717-12-dwagner@suse.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-3999-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1341420dyi; Mon, 18 Dec 2023 08:01:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQQnsfeMKlCwXVJ5nV6V79hcxGtL58E/qTuPVNKrs6wLJGemk0CA27gS4d1omh41FduokZ X-Received: by 2002:a50:8add:0:b0:553:5357:96ee with SMTP id k29-20020a508add000000b00553535796eemr894279edk.45.1702915268807; Mon, 18 Dec 2023 08:01:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702915268; cv=none; d=google.com; s=arc-20160816; b=zEfO7niLEYiciIJcAFXFG6ww129pKcOWQ3WWefR5pFv1WTeXQ+2QmuGVy2X/jtqQNj 5ZkBAflP3gcdCLdF2ub1RnheeN39MwKVa3KOLYpxS5xWAO1IGlbyoFAJzJk4dpLhVfKb rHG0lPMh4wmBHDD806N2pYIglOV87RRx0FfVjQVRZ2Je9GIK8wNmP5+Fu+m92faHQwD9 h5cjZ7aXW54TAgw9rMy8A8Ip/nkA0Cp1FcOWJs82iSOm6vg5Jxd8gwkBr7WeyrwejDIq tJQUHGlabWUe8Xf2XPS4BrUBbRQVHt4htn/2cGdJft39YRCLw3k5KktnZh7AfClXE1IB 154A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=QJDvPsNpDSFcwlZxk9YgfJH4JSGSTnY9Rh1/tTKUSxI=; fh=3QIVKsEmsld8rvcEkMSr/XDw53o2lrGJeYcvS7FhzFk=; b=lMxFd1owXsG9FKgaVBQh3NifJ/QNiGT4MtcI684GYQERKCbXePwmy+yHHaVxXgg1zR aFiG1psCk4qpUL1IUiQHD348PiFhrVfLypY4jbAWjS8VVxhqWdoV7aBqGMfLoKs1v+K1 t1HpFGcrU/jLjCptTPnIREGT2qR5PJpIKype1d7KK7WbyCqfYeVP3kEBnup8ztueZ9Gs w6sVlH+XBnowSce3LHQvlGf3gTiA51iBVNfaFckrEqOc0dciGiH4SdFYAKmKkWH6+3xz ui38gq3k488TfIHLhTMWe6ZOgQfqSEe8w/yLZDQj70X0AHHAQkZM7T17aFOLu+qkmPsm +lEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-3999-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3999-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u4-20020a50a404000000b0054c54fb37ddsi9759550edb.188.2023.12.18.08.01.08 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 08:01:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3999-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-3999-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3999-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7218B1F25A22 for <ouuuleilei@gmail.com>; Mon, 18 Dec 2023 15:59:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC3AF498B9; Mon, 18 Dec 2023 15:58:25 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97FE549897 for <linux-kernel@vger.kernel.org>; Mon, 18 Dec 2023 15:58:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id DFFD321FA4; Mon, 18 Dec 2023 15:58:20 +0000 (UTC) Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id CD8EE13BD5; Mon, 18 Dec 2023 15:58:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id KWP4MBxsgGX5AgAAn2gu4w (envelope-from <dwagner@suse.de>); Mon, 18 Dec 2023 15:58:20 +0000 From: Daniel Wagner <dwagner@suse.de> To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>, Keith Busch <kbusch@kernel.org>, James Smart <james.smart@broadcom.com>, Hannes Reinecke <hare@suse.de>, Daniel Wagner <dwagner@suse.de> Subject: [PATCH v3 11/16] nvmet-fc: remove null hostport pointer check Date: Mon, 18 Dec 2023 16:30:59 +0100 Message-ID: <20231218153105.12717-12-dwagner@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218153105.12717-1-dwagner@suse.de> References: <20231218153105.12717-1-dwagner@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Level: X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Level: X-Spam-Flag: NO X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] Authentication-Results: smtp-out1.suse.de; none X-Spam-Score: -4.00 X-Rspamd-Queue-Id: DFFD321FA4 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785636080895318738 X-GMAIL-MSGID: 1785636080895318738 |
Series |
enable nvmet-fc for blktests
|
|
Commit Message
Daniel Wagner
Dec. 18, 2023, 3:30 p.m. UTC
An association has always a valid hostport pointer. Remove useless
null pointer check.
Signed-off-by: Daniel Wagner <dwagner@suse.de>
---
drivers/nvme/target/fc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Comments
On 12/18/23 16:30, Daniel Wagner wrote: > An association has always a valid hostport pointer. Remove useless > null pointer check. > > Signed-off-by: Daniel Wagner <dwagner@suse.de> > --- > drivers/nvme/target/fc.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > Reviewed-by: Hannes Reinecke <hare@suse.de> Cheers, Hannes
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index fa7a6d2edd88..c243085d6f42 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -489,8 +489,7 @@ nvmet_fc_xmt_disconnect_assoc(struct nvmet_fc_tgt_assoc *assoc) * message is normal. Otherwise, send unless the hostport has * already been invalidated by the lldd. */ - if (!tgtport->ops->ls_req || !assoc->hostport || - assoc->hostport->invalid) + if (!tgtport->ops->ls_req || assoc->hostport->invalid) return; lsop = kzalloc((sizeof(*lsop) + @@ -1530,8 +1529,7 @@ nvmet_fc_invalidate_host(struct nvmet_fc_target_port *target_port, spin_lock_irqsave(&tgtport->lock, flags); list_for_each_entry_safe(assoc, next, &tgtport->assoc_list, a_list) { - if (!assoc->hostport || - assoc->hostport->hosthandle != hosthandle) + if (assoc->hostport->hosthandle != hosthandle) continue; if (!nvmet_fc_tgt_a_get(assoc)) continue;