diff options
| author | Alberto Faria <afaria@redhat.com> | 2022-07-05 17:15:09 +0100 |
|---|---|---|
| committer | Hanna Reitz <hreitz@redhat.com> | 2022-07-12 12:14:56 +0200 |
| commit | bf5b16fa401633475d21d69c66532f5b29e8433d (patch) | |
| tree | 60779d913b400906135b6bbce90d6128a52ac3ef /hw/misc/sifive_u_otp.c | |
| parent | 92529251d2333ea07176cdbd7273483064ba5a7b (diff) | |
| download | focaccia-qemu-bf5b16fa401633475d21d69c66532f5b29e8433d.tar.gz focaccia-qemu-bf5b16fa401633475d21d69c66532f5b29e8433d.zip | |
block: Make blk_{pread,pwrite}() return 0 on success
They currently return the value of their 'bytes' parameter on success. Make them return 0 instead, for consistency with other I/O functions and in preparation to implement them using generated_co_wrapper. This also makes it clear that short reads/writes are not possible. Signed-off-by: Alberto Faria <afaria@redhat.com> Message-Id: <20220705161527.1054072-2-afaria@redhat.com> Reviewed-by: Hanna Reitz <hreitz@redhat.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Diffstat (limited to 'hw/misc/sifive_u_otp.c')
| -rw-r--r-- | hw/misc/sifive_u_otp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/misc/sifive_u_otp.c b/hw/misc/sifive_u_otp.c index 6d5f84e6c2..535acde08b 100644 --- a/hw/misc/sifive_u_otp.c +++ b/hw/misc/sifive_u_otp.c @@ -240,7 +240,7 @@ static void sifive_u_otp_realize(DeviceState *dev, Error **errp) return; } - if (blk_pread(s->blk, 0, s->fuse, filesize) != filesize) { + if (blk_pread(s->blk, 0, s->fuse, filesize) < 0) { error_setg(errp, "failed to read the initial flash content"); return; } |