From: Philipp Stanner <phasta@kernel.org>
To: Jens Axboe <axboe@kernel.dk>, Hannes Reinecke <hare@suse.de>,
Damien Le Moal <dlemoal@kernel.org>,
Philipp Stanner <phasta@kernel.org>,
John Garry <john.g.garry@oracle.com>,
Li Zetao <lizetao1@huawei.com>, Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] block: mtip32xx: Remove unnecessary function calls
Date: Mon, 20 Jan 2025 17:20:22 +0100 [thread overview]
Message-ID: <20250120162020.67024-3-phasta@kernel.org> (raw)
pcim_iounmap_regions() does not have to be called, because the regions
are automatically unmapped since they were mapped with managed
functions. Moreover, that function is deprecated anyways.
Furthermore, setting the drvdata to NULL is unnecessary in a driver
remove() function.
Remove the unnecessary calls.
Signed-off-by: Philipp Stanner <phasta@kernel.org>
---
This patch had been around before in a series [1], but I unfortunately
messed it up and caused a race [2], which is why this patch here exists.
It's independent and fixes the rest of the pcim_ API up in this driver
once and for all :)
P.
[1] https://lore.kernel.org/all/20241016094911.24818-6-pstanner@redhat.com/
[2] https://lore.kernel.org/all/20241107162459.71e0288a@canb.auug.org.au/
---
drivers/block/mtip32xx/mtip32xx.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index 43701b7b10a7..aa9badb9a51d 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -3718,7 +3718,7 @@ static int mtip_pci_probe(struct pci_dev *pdev,
rv = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (rv) {
dev_warn(&pdev->dev, "64-bit DMA enable failed\n");
- goto setmask_err;
+ goto iomap_err;
}
/* Copy the info we may need later into the private data structure. */
@@ -3734,7 +3734,7 @@ static int mtip_pci_probe(struct pci_dev *pdev,
if (!dd->isr_workq) {
dev_warn(&pdev->dev, "Can't create wq %d\n", dd->instance);
rv = -ENOMEM;
- goto setmask_err;
+ goto iomap_err;
}
memset(cpu_list, 0, sizeof(cpu_list));
@@ -3831,8 +3831,6 @@ static int mtip_pci_probe(struct pci_dev *pdev,
drop_cpu(dd->work[1].cpu_binding);
drop_cpu(dd->work[2].cpu_binding);
}
-setmask_err:
- pcim_iounmap_regions(pdev, 1 << MTIP_ABAR);
iomap_err:
kfree(dd);
@@ -3907,10 +3905,6 @@ static void mtip_pci_remove(struct pci_dev *pdev)
}
pci_disable_msi(pdev);
-
- pcim_iounmap_regions(pdev, 1 << MTIP_ABAR);
- pci_set_drvdata(pdev, NULL);
-
put_disk(dd->disk);
}
--
2.47.1
next reply other threads:[~2025-01-20 16:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-20 16:20 Philipp Stanner [this message]
2025-01-22 6:02 ` [PATCH] block: mtip32xx: Remove unnecessary function calls Damien Le Moal
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=20250120162020.67024-3-phasta@kernel.org \
--to=phasta@kernel.org \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=hare@suse.de \
--cc=john.g.garry@oracle.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizetao1@huawei.com \
--cc=viro@zeniv.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.