Skip to contentSkip to conversation

smbios: changed for "smbios_build_type_17_table()" to take 'uint64_t'

PATCH In review SeokYeon Hwang 2 participants 3 messages Nov 4, 2014 – Nov 5, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 smbios: changed for "smbios_build_type_17_table()" to take 'uint64_t'

"smbios_build_type_17_table()" should take 'uint64_t' instead of 'ram_addr_t' because it should be able to handle (16ll * GiB). Otherwise, clang (>= 3.4) produces compilation warning in "smbios_get_tables()".

---
 hw/i386/smbios.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/smbios.c +1 -1
index 8a7ad48..4ad42ae 100644
@@ -669,7 +669,7 @@ static void smbios_build_type_16_table(unsigned dimm_cnt)
 #define MAX_T17_STD_SZ 0x7FFF /* (32G - 1M), in Megabytes */
 #define MAX_T17_EXT_SZ 0x80000000 /* 2P, in Megabytes */
 
-static void smbios_build_type_17_table(unsigned instance, ram_addr_t size)
+static void smbios_build_type_17_table(unsigned instance, uint64_t size)
 {
     char loc_str[128];
     ram_addr_t size_mb;
Signature · 1 line
2.1.0
#1 lore raw
Quoted 14 lines · SeokYeon Hwang

"smbios_build_type_17_table()" should take 'uint64_t' instead of 'ram_addr_t' because it should be able to handle (16ll * GiB). Otherwise, clang (>= 3.4) produces compilation warning in "smbios_get_tables()".

---
 hw/i386/smbios.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/smbios.c +0 -0
index 8a7ad48..4ad42ae 100644

hw/i386/smbios.c static void smbios_build_type_16_table(unsigned dimm_cnt) · line 675

Quoted 8 lines
hw/i386/smbios.c +1 -1
@@ -669,7 +669,7 @@ static void smbios_build_type_16_table(unsigned dimm_cnt)
 #define MAX_T17_STD_SZ 0x7FFF /* (32G - 1M), in Megabytes */
 #define MAX_T17_EXT_SZ 0x80000000 /* 2P, in Megabytes */
 
-static void smbios_build_type_17_table(unsigned instance, ram_addr_t size)
+static void smbios_build_type_17_table(unsigned instance, uint64_t size)
 {
     char loc_str[128];
     ram_addr_t size_mb;

Can you make a patch that replaces _all_ occurrences in hw/i386/smbios.c instead?

Thanks,

Paolo

#2 lore raw
Quoted 42 lines

-----Original Message-----
From: Paolo Bonzini [mailto:[email protected]] On Behalf Of Paolo Bonzini
Sent: Tuesday, November 04, 2014 5:42 PM
To: SeokYeon Hwang; [email protected]
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH v2] smbios: changed for "smbios_build_type_17_table()" to take 'uint64_t'

Quoted 1 line · SeokYeon Hwang

"smbios_build_type_17_table()" should take 'uint64_t' instead of

'ram_addr_t' because it should be able to handle (16ll * GiB).

Quoted 1 line

Otherwise, clang (>= 3.4) produces compilation warning in

"smbios_get_tables()".

Quoted 17 lines
---
 hw/i386/smbios.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/smbios.c index renamed from hw/i386/smbios.c +0 -0

8a7ad48..4ad42ae 100644

hw/i386/smbios.c +0 -0
@@ -669,7 +669,7 @@ static void smbios_build_type_16_table(unsigned

dimm_cnt) #define MAX_T17_STD_SZ 0x7FFF /* (32G - 1M), in Megabytes */ #define MAX_T17_EXT_SZ 0x80000000 /* 2P, in Megabytes */

-static void smbios_build_type_17_table(unsigned instance, ram_addr_t size)

hw/i386/smbios.c static void smbios_build_type_16_table(unsigned dimm_cnt) · line 675

Quoted 5 lines
hw/i386/smbios.c +2 -0
+static void smbios_build_type_17_table(unsigned instance, uint64_t
+size)
 {
     char loc_str[128];
     ram_addr_t size_mb;

Can you make a patch that replaces _all_ occurrences in hw/i386/smbios.c instead?

Quoted 3 lines

Thanks,

Paolo

I just posted patch v3 that is applied your suggestion. Thank you for your advice.