From patchwork Wed Dec 27 10:06:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 183451 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1342559dyb; Wed, 27 Dec 2023 02:07:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlTGP5T+exXzhgUI/aHkdSAQ7rnOUm38hNOEe6jW0pgdGC43O2bmOIEfb6gp3lU8Ao32eZ X-Received: by 2002:a05:6402:1643:b0:553:53da:b3d8 with SMTP id s3-20020a056402164300b0055353dab3d8mr3606327edx.94.1703671642793; Wed, 27 Dec 2023 02:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703671642; cv=none; d=google.com; s=arc-20160816; b=HNYRrtD7RmbK/X8ZXDHu3405YoOoE2K24xO1KMl9GMiG8OR9EqBAGNKRes/7Uf+Jtz IGg2oyO7bRtnS0xS1jTAYkc1mWR/YG87eD05vf5B3khrFAKzBZsWAzV8vg72KXFGOeXj 2yj+cJ+WBf2PE6wMjm3BH6Pn3FK6l98dYfGr9FSr5w0dMd/kt914uoPIHoxUkhvmYUDf 8JK0BRtad/LrpmeNx/50+5BwYpoWcrh3aVhPRg8Bx0LO+v8sB/t6t50zubxClYNEUGxQ NZIW6mzDP/3tfWwnFkUclE90JseTiVeZ6qbTb2c9eJxWFPGxx8uvT8nztNKVtYkVYQ5H IzUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=pGonUuDy3CER2wOZ3Gd4BwadmayPF5lAcvNKP95kDqg=; fh=fgNpwVGVDV8+nk8OJoLm8kAEBgDDV7g5rvrkJCfxJpI=; b=M0cXFPPZlZnQeQPLsobdy7n9leSawr8huDtQs4Ib7ywKapYA07ANOLiDz3nOMqTtqj frgySWEGTuqP+KbS7tVk4ybUUnzn3gsk5HplbiSOzTPsGhtdSa5Un6595gSzh0IBfHMi DcnDuTYZrph5Duw7QPXRgh4TUwmnJf/gYJAwyroIja3hBPxjtaimizDOX2RBfqc17bXr RrKdD2jICJLHaU+jsEiL+vilwlnsViCfZ5EbXzJW5ukgKmj3NOPP30csNgOvzEGJg35f gtVQo0XQ1QhyXISwrqObDo3wyNMvVgYv9akGSYX/qn6G+LADX/D2IUdj9xwBkmN5k0C7 IBXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=nzD+b5Td; spf=pass (google.com: domain of linux-kernel+bounces-11946-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11946-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n5-20020a509345000000b0055446bfa4bcsi5388103eda.346.2023.12.27.02.07.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 02:07:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11946-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; dkim=pass header.i=@web.de header.s=s29768273 header.b=nzD+b5Td; spf=pass (google.com: domain of linux-kernel+bounces-11946-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11946-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.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 6B6711F21D96 for ; Wed, 27 Dec 2023 10:07:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F0D72D61C; Wed, 27 Dec 2023 10:07:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="nzD+b5Td" X-Original-To: linux-kernel@vger.kernel.org Received: from mout.web.de (mout.web.de [212.227.15.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 904A32D787; Wed, 27 Dec 2023 10:07:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1703671610; x=1704276410; i=markus.elfring@web.de; bh=jn1IbyEVOZrfvN7XBCt9j+uuHZsv/fW9fsgamye8t/8=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=nzD+b5TdpN+n+8NxtQNY4AU5fCw+GUxGO+l30gVKS2BB8EQS/oIGaanY0qd1le67 z5ONw168vZxrvn5SQUI6/jy4XFBEECPLA8z7KB4J193PprPn8nDnKlMhPyBqskpaH e9UFE4MD16FpGve+SIHiCYc4j+USRnTTPRHijmRnAtVf12cI7EfnxPNqFIL6ag8O0 U88kXehW0ybP7ZZGpJ1Xkg2c83OhMvMIPmvhCRHQK2DP2JKOqJT2QlREWVnIwjaib Bj/rSJ7HVtJ8cOJXihsZQSe8DPFDGogQL6jsb89dI37j8lpHv2ElejRJXi8y6tdSs c1xaKXfPTidhkNd19g== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M2Phi-1rGmeK2Ir0-004HkY; Wed, 27 Dec 2023 11:06:50 +0100 Message-ID: <3c6ebb2b-b3d5-4698-aa89-9960872cbb4c@web.de> Date: Wed, 27 Dec 2023 11:06:49 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: =?utf-8?q?=5BPATCH_2/2=5D_scsi=3A_message=3A_fusion=3A_Move_an_assi?= =?utf-8?q?gnment_for_the_variable_=E2=80=9Cphy=5Finfo=E2=80=9D_in_mptsas=5F?= =?utf-8?q?find=5Fphyinfo=5Fby=5Fphys=5Fdisk=5Fnum=28=29?= Content-Language: en-GB From: Markus Elfring To: linux-scsi@vger.kernel.org, MPT-FusionLinux.pdl@broadcom.com, kernel-janitors@vger.kernel.org, Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani Cc: LKML , cocci@inria.fr References: In-Reply-To: X-Provags-ID: V03:K1:gkazMb/O4l2GzERn48IcvpwT5y8HvZR1g45mK2lRunaPBwbiMdd TRJ8HoTpw/tsxHi5+rASq8Op6y7D41VS3CrLChjltMjsYIdfY6ToXfF/i6HBQJIDjWI1QOm nk/r6J69+UBrf8TjzIotfhmZXVBDkUhT1qrJg825ztHtHcjo+22VfAY/w9w3cYl0qu8Ppf9 VnDUk9T3JCK+TeziBuCTg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:xMCx7VgZ08M=;IAkFRS512RJ3iuU4GJ7SK9fOEKu Gqy65n38ZJpJYi7mBsUhtWPhM1vMlT4lg9/7Bp0uOp7L1AiDvG9j7aS5UWbEWuSKlVrNTyegO lq+T3Wjul3GOBU2d0zJZaob9emJIfVEuvmJbU03JHlJG4ILhiSrZr7YCvpvaiINtbLktpOLOh ujB9RXqwLmda1sQ6cAWJYpWRL7n3R4y1pcnBd0SO7lqydhngJv2K8E09gndhxFfT1GqA+wWWu V1gzqW52bxzYykEaIb3kMpXpzz6Lm4oslsGpxBWD2JotW9FI29Vkt3x09PvVTaNgb9e3E7lTS bpDr5bZlWRCqi94mqGR6vY3P4ARWPtWh2xQpbTiVNxFl/mEavOU+Egg7spifMEPhSLUpFiwZX xg+YJvVb5yEQI8N05KE/y7syNkvXrqvNWqFmpID466PrsCz3Vmt1xHLE6B4IHMGyx5cP04E1h NcOdSNOhsCnbpiOJNJOdN/vJdACLZXenyZrtmMLabYisyl9blyCb1KB3z3SPuxJ//RNFCKgQK WzvVtHuKtStfguYEV5rETXTXDO+o8QfbpnxDz6elU9OEV1J+bdSUdjdh+0COSPQQ58sFow+4E OuPU5E4QWmBXReDnJsjQKwxpMSEm9WjA74T3bgZIHqdTyOazFUFmzgZVtIL+/T9M9+qnrgaQL x0TTwLD8BNVRMx3I1ysaWy6WkwreHuKegXI4tVjU5Ar0Qb0bn1G1sZIWlnrvRIBBtgsMkDKde ehn5uCf2E+R0QRBNNPc9Z/uhwFkc9F5yjmguiwXTqSGnFOHc4riSIN0M5EN/Z8odwOeLhLwCJ wGHtQmJOqPFIvpXpxx6aawibzxXg0JVqs/A6UMRAuFz7xF0dbfxpyCZWi8YWouMeh3DfbYV4w 8hKAAKcW1NdDth4mthohG30ypbyeCQLEYWh9RABBpfpYJKTSLtegW+conJQy1Vdk185yY751Z ifBF9Jttev8m7ncWCL47erxIwR8= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786429196831850292 X-GMAIL-MSGID: 1786429196831850292 From: Markus Elfring Date: Wed, 27 Dec 2023 10:42:03 +0100 Move one assignment for the variable “phy_info” closer to the place where this pointer is used. Signed-off-by: Markus Elfring --- drivers/message/fusion/mptsas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.43.0 diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 452635a50c4c..02f7d11fd828 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -4169,14 +4169,13 @@ static struct mptsas_phyinfo * mptsas_find_phyinfo_by_phys_disk_num(MPT_ADAPTER *ioc, u8 phys_disk_num, u8 channel, u8 id) { - struct mptsas_phyinfo *phy_info = NULL; + struct mptsas_phyinfo *phy_info; struct mptsas_portinfo *port_info; RaidPhysDiskPage1_t *phys_disk; int num_paths; u64 sas_address = 0; int i; - phy_info = NULL; if (!ioc->raid_data.pIocPg3) return NULL; /* dual port support */ @@ -4190,6 +4189,7 @@ mptsas_find_phyinfo_by_phys_disk_num(MPT_ADAPTER *ioc, u8 phys_disk_num, goto lock_mutex; mpt_raid_phys_disk_pg1(ioc, phys_disk_num, phys_disk); + phy_info = NULL; for (i = 0; i < num_paths; i++) { if ((phys_disk->Path[i].Flags & 1) != 0) /* entry no longer valid */