mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-14 08:59:05 +00:00
hw/onenand: Minor spacing fixes
Minor whitespace-only cleanup (separated out from the qdevifying patch for clarity). Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> [Riku Voipio: Fixes and restructuring patchset] Signed-off-by: Riku Voipio <riku.voipio@iki.fi> [Peter Maydell: More fixes and cleanups for upstream submission] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
500954e35c
commit
7c00b9de8b
14
hw/onenand.c
14
hw/onenand.c
@ -245,8 +245,8 @@ static inline int onenand_prog_main(OneNANDState *s, int sec, int secn,
|
|||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
if (secn > 0) {
|
if (secn > 0) {
|
||||||
uint32_t size = (uint32_t) secn * 512;
|
uint32_t size = (uint32_t)secn * 512;
|
||||||
const uint8_t *sp = (const uint8_t *) src;
|
const uint8_t *sp = (const uint8_t *)src;
|
||||||
uint8_t *dp = 0;
|
uint8_t *dp = 0;
|
||||||
if (s->bdrv_cur) {
|
if (s->bdrv_cur) {
|
||||||
dp = g_malloc(size);
|
dp = g_malloc(size);
|
||||||
@ -257,7 +257,7 @@ static inline int onenand_prog_main(OneNANDState *s, int sec, int secn,
|
|||||||
if (sec + secn > s->secs_cur) {
|
if (sec + secn > s->secs_cur) {
|
||||||
result = 1;
|
result = 1;
|
||||||
} else {
|
} else {
|
||||||
dp = (uint8_t *) s->current + (sec << 9);
|
dp = (uint8_t *)s->current + (sec << 9);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!result) {
|
if (!result) {
|
||||||
@ -299,13 +299,13 @@ static inline int onenand_prog_spare(OneNANDState *s, int sec, int secn,
|
|||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
if (secn > 0) {
|
if (secn > 0) {
|
||||||
const uint8_t *sp = (const uint8_t *) src;
|
const uint8_t *sp = (const uint8_t *)src;
|
||||||
uint8_t *dp = 0, *dpp = 0;
|
uint8_t *dp = 0, *dpp = 0;
|
||||||
if (s->bdrv_cur) {
|
if (s->bdrv_cur) {
|
||||||
dp = g_malloc(512);
|
dp = g_malloc(512);
|
||||||
if (!dp || bdrv_read(s->bdrv_cur,
|
if (!dp || bdrv_read(s->bdrv_cur,
|
||||||
s->secs_cur + (sec >> 5),
|
s->secs_cur + (sec >> 5),
|
||||||
dp, 1) < 0) {
|
dp, 1) < 0) {
|
||||||
result = 1;
|
result = 1;
|
||||||
} else {
|
} else {
|
||||||
dpp = dp + ((sec & 31) << 4);
|
dpp = dp + ((sec & 31) << 4);
|
||||||
@ -324,7 +324,7 @@ static inline int onenand_prog_spare(OneNANDState *s, int sec, int secn,
|
|||||||
}
|
}
|
||||||
if (s->bdrv_cur) {
|
if (s->bdrv_cur) {
|
||||||
result = bdrv_write(s->bdrv_cur, s->secs_cur + (sec >> 5),
|
result = bdrv_write(s->bdrv_cur, s->secs_cur + (sec >> 5),
|
||||||
dp, 1) < 0;
|
dp, 1) < 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dp) {
|
if (dp) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user