Skip to content

Commit 40639e9

Browse files
bvanasscheaxboe
authored andcommitted
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]>
1 parent 08190cc commit 40639e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/block/nbd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static ssize_t pid_show(struct device *dev,
222222
struct device_attribute *attr, char *buf)
223223
{
224224
struct gendisk *disk = dev_to_disk(dev);
225-
struct nbd_device *nbd = (struct nbd_device *)disk->private_data;
225+
struct nbd_device *nbd = disk->private_data;
226226

227227
return sprintf(buf, "%d\n", nbd->pid);
228228
}
@@ -236,7 +236,7 @@ static ssize_t backend_show(struct device *dev,
236236
struct device_attribute *attr, char *buf)
237237
{
238238
struct gendisk *disk = dev_to_disk(dev);
239-
struct nbd_device *nbd = (struct nbd_device *)disk->private_data;
239+
struct nbd_device *nbd = disk->private_data;
240240

241241
return sprintf(buf, "%s\n", nbd->backend ?: "");
242242
}

0 commit comments

Comments
 (0)