Skip to content

Commit 88c918d

Browse files
israelrukeithbusch
authored andcommitted
nvme: remove redundant bdev local variable
Use disk directly instead of getting it from bdev->bd_disk. Signed-off-by: Israel Rukshin <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 1a7812b commit 88c918d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/nvme/host/sysfs.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,12 @@ static ssize_t nuse_show(struct device *dev, struct device_attribute *attr,
233233
{
234234
struct nvme_ns_head *head = dev_to_ns_head(dev);
235235
struct gendisk *disk = dev_to_disk(dev);
236-
struct block_device *bdev = disk->part0;
237236
int ret;
238237

239-
if (nvme_disk_is_ns_head(bdev->bd_disk))
238+
if (nvme_disk_is_ns_head(disk))
240239
ret = ns_head_update_nuse(head);
241240
else
242-
ret = ns_update_nuse(bdev->bd_disk->private_data);
241+
ret = ns_update_nuse(disk->private_data);
243242
if (ret)
244243
return ret;
245244

0 commit comments

Comments
 (0)