|
|
26ba25 |
From 0384fba1d0550f0bb2a6cfeb24b13d8c8186524d Mon Sep 17 00:00:00 2001
|
|
|
26ba25 |
From: Thomas Huth <thuth@redhat.com>
|
|
|
26ba25 |
Date: Tue, 8 May 2018 09:01:12 +0000
|
|
|
26ba25 |
Subject: pc-bios/s390-ccw: size_t should be unsigned
|
|
|
26ba25 |
|
|
|
26ba25 |
"size_t" should be an unsigned type according to the C standard.
|
|
|
26ba25 |
Thus we should also use this convention in the s390-ccw firmware to avoid
|
|
|
26ba25 |
confusion. I checked the sources, and apart from one spot in libc.c, the
|
|
|
26ba25 |
code should all be fine with this change.
|
|
|
26ba25 |
|
|
|
26ba25 |
Buglink: https://bugs.launchpad.net/qemu/+bug/1753437
|
|
|
26ba25 |
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
|
|
|
26ba25 |
Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com>
|
|
|
26ba25 |
Reviewed-by: Collin Walling <walling@linux.ibm.com>
|
|
|
26ba25 |
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
|
|
26ba25 |
(cherry picked from commit e4f869621203955761cf274c87d5595e9facd319)
|
|
|
26ba25 |
---
|
|
|
26ba25 |
pc-bios/s390-ccw/libc.c | 2 +-
|
|
|
26ba25 |
pc-bios/s390-ccw/libc.h | 2 +-
|
|
|
26ba25 |
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
26ba25 |
|
|
|
26ba25 |
diff --git a/pc-bios/s390-ccw/libc.c b/pc-bios/s390-ccw/libc.c
|
|
|
26ba25 |
index 38ea77d..a786566 100644
|
|
|
26ba25 |
--- a/pc-bios/s390-ccw/libc.c
|
|
|
26ba25 |
+++ b/pc-bios/s390-ccw/libc.c
|
|
|
26ba25 |
@@ -63,7 +63,7 @@ uint64_t atoui(const char *str)
|
|
|
26ba25 |
*/
|
|
|
26ba25 |
char *uitoa(uint64_t num, char *str, size_t len)
|
|
|
26ba25 |
{
|
|
|
26ba25 |
- size_t num_idx = 1; /* account for NUL */
|
|
|
26ba25 |
+ long num_idx = 1; /* account for NUL */
|
|
|
26ba25 |
uint64_t tmp = num;
|
|
|
26ba25 |
|
|
|
26ba25 |
IPL_assert(str != NULL, "uitoa: no space allocated to store string");
|
|
|
26ba25 |
diff --git a/pc-bios/s390-ccw/libc.h b/pc-bios/s390-ccw/libc.h
|
|
|
26ba25 |
index 63ece70..818517f 100644
|
|
|
26ba25 |
--- a/pc-bios/s390-ccw/libc.h
|
|
|
26ba25 |
+++ b/pc-bios/s390-ccw/libc.h
|
|
|
26ba25 |
@@ -12,7 +12,7 @@
|
|
|
26ba25 |
#ifndef S390_CCW_LIBC_H
|
|
|
26ba25 |
#define S390_CCW_LIBC_H
|
|
|
26ba25 |
|
|
|
26ba25 |
-typedef long size_t;
|
|
|
26ba25 |
+typedef unsigned long size_t;
|
|
|
26ba25 |
typedef int bool;
|
|
|
26ba25 |
typedef unsigned char uint8_t;
|
|
|
26ba25 |
typedef unsigned short uint16_t;
|
|
|
26ba25 |
--
|
|
|
26ba25 |
1.8.3.1
|
|
|
26ba25 |
|