Changeset View
Changeset View
Standalone View
Standalone View
sys/boot/uboot/lib/disk.c
Show All 31 Lines | |||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/disk.h> | #include <sys/disk.h> | ||||
#include <machine/stdarg.h> | #include <machine/stdarg.h> | ||||
#include <inttypes.h> | |||||
#include <stand.h> | #include <stand.h> | ||||
#include "api_public.h" | #include "api_public.h" | ||||
#include "bootstrap.h" | #include "bootstrap.h" | ||||
#include "disk.h" | #include "disk.h" | ||||
#include "glue.h" | #include "glue.h" | ||||
#include "libuboot.h" | #include "libuboot.h" | ||||
▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | stor_strategy(void *devdata, int rw, daddr_t blk, size_t size, char *buf, | ||||
int err; | int err; | ||||
if (rw != F_READ) { | if (rw != F_READ) { | ||||
stor_printf("write attempt, operation not supported!\n"); | stor_printf("write attempt, operation not supported!\n"); | ||||
return (EROFS); | return (EROFS); | ||||
} | } | ||||
if (size % SI(dev).bsize) { | if (size % SI(dev).bsize) { | ||||
stor_printf("size=%d not multiple of device block size=%d\n", | stor_printf("size=%" PRIuPTR " not multiple of device " | ||||
andrew: Should be `%zu` as `size` is a `size_t` | |||||
"block size=%d\n", | |||||
size, SI(dev).bsize); | size, SI(dev).bsize); | ||||
return (EIO); | return (EIO); | ||||
} | } | ||||
bcount = size / SI(dev).bsize; | bcount = size / SI(dev).bsize; | ||||
if (rsize) | if (rsize) | ||||
*rsize = 0; | *rsize = 0; | ||||
err = stor_readdev(dev, blk + dev->d_offset, bcount, buf); | err = stor_readdev(dev, blk + dev->d_offset, bcount, buf); | ||||
▲ Show 20 Lines • Show All 136 Lines • Show Last 20 Lines |
Should be %zu as size is a size_t