From patchwork Tue Jan 30 09:49:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 193970 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1119543dyb; Tue, 30 Jan 2024 02:24:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHwRT1Cz7J3iD4jaN3Tg310xoOz6rrAlO5BzweZAaqteUiZhSXTFh0NQfGMVhsm0VZTtvIx X-Received: by 2002:a17:902:eb91:b0:1d7:41b7:332b with SMTP id q17-20020a170902eb9100b001d741b7332bmr9029282plg.14.1706610276033; Tue, 30 Jan 2024 02:24:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706610276; cv=pass; d=google.com; s=arc-20160816; b=z3rNXQ3q5E+6YUxCCKIb0glmuR2A32iFaRTd1fUZuArIIJMJ4/Ikuy5SiccSR9iTgE tG0soYxCvHll/vUPc78SP2iayDfzVXC2SLVOr5oN21lA0hIrHNOklqb7Y/2nlqKkebAL ik633FeLFJ4rZwZfdJMOHR0cqnIwchLINW6+9q6quTtW9QsQCDmaNyQDYgVb01bCXJvd nv6vfsHXne9FW83kGtVCAnVczWYD3WHFlHlzANB5Mqoj6ycdCW3sv1iDrFjt/XK/Jz3L GzFGdmZ0MzVOl8Hknr4INLBw+ZR61y/6Jtr2FaKeFwj64udEtwBtCEIogNbGSPnnLjbH S8GQ== ARC-Message-Signature: i=2; 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:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=rH9cozVr92s6dsaGqRSsupXe8vdit9l8VVLc6Q0nkH4=; fh=n5BdL0bf9gAg+lJbD9hdO95/5FlrOLRCMPX4XUPPjVI=; b=DR4Xh79/QIb+hhSmJo29zy5uhuSYIgTE6EtKaLwIE0zXlkbpnNFt+SqCPOJXlgQf+3 uXMeZKxHFsn/CXBraFdLUE7+ohBer1n6tdiYdmuAE6em8f/hcwPwWeHWBuZttV4ZkEjw CoPjvJXaeMeIu/KCyGKDcSddXHBNgh15By2/SspS7dI8HyLjLDgwroSQ766vav8WokuG ynC4jE/0KQ6bOpAIPOSubnfo3sliWthT/0hj21OTgiqb1//giUSgtfAwdvQavvhFI8dM eCu7XGgRRNNu0lby+dgNTHZWyZIzqId/Dkt26U3uObiDQwhVyv+m7+tdvgBz0mmQzJz+ PCPA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="LAo3fr/H"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="LAo3fr/H"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-44309-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44309-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c12-20020a170903234c00b001d917fa8be8si235060plh.257.2024.01.30.02.24.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 02:24:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44309-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="LAo3fr/H"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="LAo3fr/H"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-44309-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44309-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D1B03B283EB for ; Tue, 30 Jan 2024 09:54:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 933CD6BB29; Tue, 30 Jan 2024 09:49:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="LAo3fr/H"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="SsY7mb+x"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="LAo3fr/H"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="SsY7mb+x" 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 2E2666773A for ; Tue, 30 Jan 2024 09:49:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608195; cv=none; b=C+nLmI/mA3cJWrxxRbYZtL6qDwMbEGgwTYjzdBhKHSaMeXDaYsWhGmzNZwcFIf6eOSw9wW8/aaJpV9+ucpPe6ehg686iM/wTiPQaUAEUHC9kmN8Q8ggBxDHdbK9fWhxogG/KI17+rn2k2fTJVkAlfF3MThwCyetEiR1LDaE2ypY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706608195; c=relaxed/simple; bh=KnGHv6BGSSns72ZX170xf4lIjWhBNOj4vGR9qmL7ZWo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HFAOfRNO54Nnx4hxj7MCJMw21HSCzepuamRftzuhb4AQerLT6hIJ6MtWyt7eGsbTAJiH40Wahj5k9c+NqbI/HgW5fkxv+nQMMJod5HMtFyRUl5M1Lv5vmRzk35pk+vMeE15ThS031+03mQkUOU+PUfxqjis2n8B2SfB5w5UdcuI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=LAo3fr/H; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=SsY7mb+x; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=LAo3fr/H; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=SsY7mb+x; arc=none smtp.client-ip=195.135.223.130 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 [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 5DBE221225; Tue, 30 Jan 2024 09:49:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706608192; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rH9cozVr92s6dsaGqRSsupXe8vdit9l8VVLc6Q0nkH4=; b=LAo3fr/HTB2gReRrea2ZyOe4LrT4H0zR1D2aPV9QIWnyHBMUEJimdxJRmN0D/4Z0HtQf1g yuGLO8ackrSjxYvP/NOjv/JqQv+X941W70b+WYCJl7WAtgukL1IvrUa4nWuFB/ZzPsYsh8 yq5BhFf/FHP2p4Vqs/19HrYJ46hcS3c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706608192; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rH9cozVr92s6dsaGqRSsupXe8vdit9l8VVLc6Q0nkH4=; b=SsY7mb+x5pooMLDbVHFZDSD3jJL5vRnbWxHfTlo/WFfbi0TxJwEXkP+qp0RNgQtFu/mkAC dabT71Gxu3m3zvBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706608192; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rH9cozVr92s6dsaGqRSsupXe8vdit9l8VVLc6Q0nkH4=; b=LAo3fr/HTB2gReRrea2ZyOe4LrT4H0zR1D2aPV9QIWnyHBMUEJimdxJRmN0D/4Z0HtQf1g yuGLO8ackrSjxYvP/NOjv/JqQv+X941W70b+WYCJl7WAtgukL1IvrUa4nWuFB/ZzPsYsh8 yq5BhFf/FHP2p4Vqs/19HrYJ46hcS3c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706608192; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rH9cozVr92s6dsaGqRSsupXe8vdit9l8VVLc6Q0nkH4=; b=SsY7mb+x5pooMLDbVHFZDSD3jJL5vRnbWxHfTlo/WFfbi0TxJwEXkP+qp0RNgQtFu/mkAC dabT71Gxu3m3zvBg== 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 4B00513462; Tue, 30 Jan 2024 09:49:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id z3HfEEDGuGWUbwAAn2gu4w (envelope-from ); Tue, 30 Jan 2024 09:49:52 +0000 From: Daniel Wagner To: James Smart Cc: Keith Busch , Christoph Hellwig , Hannes Reinecke , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Daniel Wagner Subject: [PATCH v4 07/12] nvmet-fc: remove null hostport pointer check Date: Tue, 30 Jan 2024 10:49:33 +0100 Message-ID: <20240130094938.1575-8-dwagner@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240130094938.1575-1-dwagner@suse.de> References: <20240130094938.1575-1-dwagner@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: -0.34 X-Spamd-Result: default: False [-0.34 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLY(-4.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_RATELIMIT(0.00)[to_ip_from(RL7u6ok1g4a6hhe6aduz96x8er)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_SEVEN(0.00)[7]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.04)[58.94%] X-Spam-Flag: NO X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789510576880048936 X-GMAIL-MSGID: 1789510576880048936 An association has always a valid hostport pointer. Remove useless null pointer check. Reviewed-by: Hannes Reinecke Signed-off-by: Daniel Wagner Reviewed-by: Christoph Hellwig --- drivers/nvme/target/fc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index 205a12b1e841..849d9b17c60a 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -488,8 +488,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) + @@ -1524,8 +1523,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;