aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Van Assche <[email protected]>2024-05-10 13:23:10 -0700
committerJens Axboe <[email protected]>2024-05-14 07:22:35 -0600
commit40639e9a0f6e49edd4ef520e6c0e070e1a04a330 (patch)
tree7867db877167e1ac0dbe2fed5aefbafb4c6e49aa
parent08190cc4d8a62f2a07b4158751afd3a01638c4c5 (diff)
nbd: Remove superfluous casts
In Linux kernel code it is preferred not to use a cast when converting a void pointer to another pointer type. Cc: Christoph Hellwig <[email protected]> Cc: Josef Bacik <[email protected]> Cc: Yu Kuai <[email protected]> Cc: Markus Pargmann <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--drivers/block/nbd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 9d4ec9273bf9..90760f27824d 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -222,7 +222,7 @@ static ssize_t pid_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct gendisk *disk = dev_to_disk(dev);
- struct nbd_device *nbd = (struct nbd_device *)disk->private_data;
+ struct nbd_device *nbd = disk->private_data;
return sprintf(buf, "%d\n", nbd->pid);
}
@@ -236,7 +236,7 @@ static ssize_t backend_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct gendisk *disk = dev_to_disk(dev);
- struct nbd_device *nbd = (struct nbd_device *)disk->private_data;
+ struct nbd_device *nbd = disk->private_data;
return sprintf(buf, "%s\n", nbd->backend ?: "");
}