Home
last modified time | relevance | path

Searched hist:"32698 c95" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/scsi/libsas/
H A Dsas_port.c32698c95 Mon Feb 28 03:48:57 CST 2022 Damien Le Moal <damien.lemoal@opensource.wdc.com> scsi: libsas: Clean up sas_form_port()

Sparse throws a warning about context imbalance ("different lock contexts
for basic block") in sas_form_port() as it gets confused with the fact that
a port is locked within one of the two search loops and unlocked afterward
outside of the search loops once the phy is added to the port. Since this
code is not easy to follow, improve it by factoring out the code adding the
phy to the port once the port is locked into the helper function
sas_form_port_add_phy(). This helper can then be called directly within the
port search loops, avoiding confusion and clearing the sparse warning.

Link: https://lore.kernel.org/r/20220228094857.557329-1-damien.lemoal@opensource.wdc.com
Reviewed-by: John Garry <john.garry@huawei.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>