From: Markus Elfring <Markus.Elfring@web.de>
To: linux-scsi@vger.kernel.org, MPT-FusionLinux.pdl@broadcom.com,
kernel-janitors@vger.kernel.org,
Sathya Prakash <sathya.prakash@broadcom.com>,
Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
Cc: LKML <linux-kernel@vger.kernel.org>, cocci@inria.fr
Subject: [PATCH 2/2] scsi: message: fusion: Move an assignment for the variable “phy_info” in mptsas_find_phyinfo_by_phys_disk_num()
Date: Wed, 27 Dec 2023 11:06:49 +0100 [thread overview]
Message-ID: <3c6ebb2b-b3d5-4698-aa89-9960872cbb4c@web.de> (raw)
In-Reply-To: <c8b0d40c-2f48-46fa-8311-258985e9eee3@web.de>
From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
drivers/message/fusion/mptsas.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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 */
--
2.43.0
prev parent reply other threads:[~2023-12-27 10:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-27 10:02 [PATCH 0/2] scsi: message: fusion: Adjustments for mptsas_find_phyinfo_by_phys_disk_num() Markus Elfring
2023-12-27 10:04 ` [PATCH 1/2] scsi: message: fusion: Improve data processing in mptsas_find_phyinfo_by_phys_disk_num() Markus Elfring
2023-12-27 10:06 ` Markus Elfring [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3c6ebb2b-b3d5-4698-aa89-9960872cbb4c@web.de \
--to=markus.elfring@web.de \
--cc=MPT-FusionLinux.pdl@broadcom.com \
--cc=cocci@inria.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=sathya.prakash@broadcom.com \
--cc=sreekanth.reddy@broadcom.com \
--cc=suganath-prabu.subramani@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox