The do_div() macro now checks its arguments for the correct type,
and refuses anything other than u64, so we get a warning about
nbd_ioctl passing in an loff_t:
drivers/block/nbd.c: In function '__nbd_ioctl':
drivers/block/nbd.c:757:77: error: comparison of distinct pointer types lacks a cast [-Werror]
This changes the nbd code to use div_s64() instead, which takes
a signed argument.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes:
37091fdd831f ("nbd: Create size change events for userspace")
Signed-off-by: Jens Axboe <axboe@fb.com>
}
case NBD_SET_BLKSIZE: {
- loff_t bsize = nbd->bytesize;
- do_div(bsize, arg);
+ loff_t bsize = div_s64(nbd->bytesize, arg);
return nbd_size_set(nbd, bdev, arg, bsize);
}