rc4030: Fix compilation error in debug code
PATCH 1/1 rc4030: Fix compilation error in debug code
min was unknown here, so avoid it.
Cc Blue Swirl <[email protected]>
Signed-off-by Stefan Weil <[email protected]>
--- hw/rc4030.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
hw/rc4030.c +4 -1
@@ -749,7 +749,10 @@ static void rc4030_do_dma(void *opaque, int n, uint8_t *buf, int len, int is_wriprintf ("rc4030 dma: Copying %d bytes %s host %p\n" , len, is_write ?"from" :"to" , buf);for (i =0 ; i < len; i +=16 ) { -int n =min (16 , len - i); +int n =16 ; +if (n > len - i) { + n = len - i; + }for (j =0 ; j < n; j++)printf ("%02x " , buf[i + j]);while (j++ <16 )
Signature · 1 line
1.7.1
Blue Swirl
AppliedThanks, applied.
Quoted 28 lines · Stefan Weil
min was unknown here, so avoid it.
Cc Blue Swirl <[email protected]>Signed-off-by Stefan Weil <[email protected]>---
hw/rc4030.c | 5 ++++-1 files changed, 4 insertions(+), 1 deletions(-)hw/rc4030.c +4
-2@@ -749,7 +749,10 @@ static void rc4030_do_dma(void *opaque, int n, uint8_t *buf, int len, int is_wri printf("rc4030 dma: Copying %d bytes %s host %p\n", len, is_write ? "from" : "to", buf); for (i = 0; i < len; i += 16) { - int n = min(16, len - i); + int n = 16; + if (n > len - i) { + n = len - i; + } for (j = 0; j < n; j++) printf("%02x ", buf[i + j]); while (j++ < 16) --1.7.1