Skip to contentSkip to conversation

nvme: remove redundant bdev local variable

PATCH Applied Israel Rukshin 5 participants 5 messages Jul 11, 2024 – Jul 15, 2024 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: remove redundant bdev local variable

Use disk directly instead of getting it from bdev->bd_disk.

---
 drivers/nvme/host/sysfs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/nvme/host/sysfs.c +2 -3
index 3c55f7edd181..ba05faaac562 100644
@@ -233,13 +233,12 @@ static ssize_t nuse_show(struct device *dev, struct device_attribute *attr,
 {
 	struct nvme_ns_head *head = dev_to_ns_head(dev);
 	struct gendisk *disk = dev_to_disk(dev);
-	struct block_device *bdev = disk->part0;
 	int ret;
 
-	if (nvme_disk_is_ns_head(bdev->bd_disk))
+	if (nvme_disk_is_ns_head(disk))
 		ret = ns_head_update_nuse(head);
 	else
-		ret = ns_update_nuse(bdev->bd_disk->private_data);
+		ret = ns_update_nuse(disk->private_data);
 	if (ret)
 		return ret;
 
Signature · 1 line
2.18.2