Commit 40639e9a authored by Bart Van Assche's avatar Bart Van Assche Committed by Jens Axboe

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 <hch@lst.de>
Cc: Josef Bacik <jbacik@fb.com>
Cc: Yu Kuai <yukuai3@huawei.com>
Cc: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240510202313.25209-3-bvanassche@acm.orgSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 08190cc4
...@@ -222,7 +222,7 @@ static ssize_t pid_show(struct device *dev, ...@@ -222,7 +222,7 @@ static ssize_t pid_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct gendisk *disk = dev_to_disk(dev); 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); return sprintf(buf, "%d\n", nbd->pid);
} }
...@@ -236,7 +236,7 @@ static ssize_t backend_show(struct device *dev, ...@@ -236,7 +236,7 @@ static ssize_t backend_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct gendisk *disk = dev_to_disk(dev); 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 ?: ""); return sprintf(buf, "%s\n", nbd->backend ?: "");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment