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