aboutsummaryrefslogtreecommitdiff
path: root/hw/block/onenand.c
diff options
context:
space:
mode:
authorAlberto Faria <afaria@redhat.com>2022-07-05 17:15:10 +0100
committerHanna Reitz <hreitz@redhat.com>2022-07-12 12:14:56 +0200
commit3b35d4542c8537a9269f6372df531ced6c960084 (patch)
tree0a59e4957fa7193db852233956f77515e37a2c41 /hw/block/onenand.c
parentbf5b16fa401633475d21d69c66532f5b29e8433d (diff)
downloadqemu-3b35d4542c8537a9269f6372df531ced6c960084.zip
qemu-3b35d4542c8537a9269f6372df531ced6c960084.tar.gz
qemu-3b35d4542c8537a9269f6372df531ced6c960084.tar.bz2
block: Add a 'flags' param to blk_pread()
For consistency with other I/O functions, and in preparation to implement it using generated_co_wrapper. Callers were updated using this Coccinelle script: @@ expression blk, offset, buf, bytes; @@ - blk_pread(blk, offset, buf, bytes) + blk_pread(blk, offset, buf, bytes, 0) It had no effect on hw/block/nand.c, presumably due to the #if, so that file was updated manually. Overly-long lines were then fixed by hand. Signed-off-by: Alberto Faria <afaria@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Reviewed-by: Hanna Reitz <hreitz@redhat.com> Message-Id: <20220705161527.1054072-3-afaria@redhat.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Diffstat (limited to 'hw/block/onenand.c')
-rw-r--r--hw/block/onenand.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/block/onenand.c b/hw/block/onenand.c
index afc0cd3..1225ec8 100644
--- a/hw/block/onenand.c
+++ b/hw/block/onenand.c
@@ -230,7 +230,7 @@ static void onenand_reset(OneNANDState *s, int cold)
memset(s->blockwp, ONEN_LOCK_LOCKED, s->blocks);
if (s->blk_cur && blk_pread(s->blk_cur, 0, s->boot[0],
- 8 << BDRV_SECTOR_BITS) < 0) {
+ 8 << BDRV_SECTOR_BITS, 0) < 0) {
hw_error("%s: Loading the BootRAM failed.\n", __func__);
}
}
@@ -250,7 +250,7 @@ static inline int onenand_load_main(OneNANDState *s, int sec, int secn,
assert(UINT32_MAX >> BDRV_SECTOR_BITS > secn);
if (s->blk_cur) {
return blk_pread(s->blk_cur, sec << BDRV_SECTOR_BITS, dest,
- secn << BDRV_SECTOR_BITS) < 0;
+ secn << BDRV_SECTOR_BITS, 0) < 0;
} else if (sec + secn > s->secs_cur) {
return 1;
}
@@ -274,7 +274,7 @@ static inline int onenand_prog_main(OneNANDState *s, int sec, int secn,
uint8_t *dp = 0;
if (s->blk_cur) {
dp = g_malloc(size);
- if (!dp || blk_pread(s->blk_cur, offset, dp, size) < 0) {
+ if (!dp || blk_pread(s->blk_cur, offset, dp, size, 0) < 0) {
result = 1;
}
} else {
@@ -308,7 +308,7 @@ static inline int onenand_load_spare(OneNANDState *s, int sec, int secn,
if (s->blk_cur) {
uint32_t offset = (s->secs_cur + (sec >> 5)) << BDRV_SECTOR_BITS;
- if (blk_pread(s->blk_cur, offset, buf, BDRV_SECTOR_SIZE) < 0) {
+ if (blk_pread(s->blk_cur, offset, buf, BDRV_SECTOR_SIZE, 0) < 0) {
return 1;
}
memcpy(dest, buf + ((sec & 31) << 4), secn << 4);
@@ -333,7 +333,7 @@ static inline int onenand_prog_spare(OneNANDState *s, int sec, int secn,
if (s->blk_cur) {
dp = g_malloc(512);
if (!dp
- || blk_pread(s->blk_cur, offset, dp, BDRV_SECTOR_SIZE) < 0) {
+ || blk_pread(s->blk_cur, offset, dp, BDRV_SECTOR_SIZE, 0) < 0) {
result = 1;
} else {
dpp = dp + ((sec & 31) << 4);
@@ -375,7 +375,7 @@ static inline int onenand_erase(OneNANDState *s, int sec, int num)
goto fail;
}
if (blk_pread(s->blk_cur, erasesec << BDRV_SECTOR_BITS, tmpbuf,
- BDRV_SECTOR_SIZE) < 0) {
+ BDRV_SECTOR_SIZE, 0) < 0) {
goto fail;
}
memcpy(tmpbuf + ((sec & 31) << 4), blankbuf, 1 << 4);