[Skiboot] [PATCH v2 11/11] fsp: Fix msg vaargs usage
Joel Stanley
joel at jms.id.au
Fri May 4 12:10:36 AEST 2018
hw/fsp/fsp.c:1011:17: warning: passing an object that undergoes default argument promotion to
'va_start' has undefined behavior [-Wvarargs]
va_start(list, add_words);
^
hw/fsp/fsp.c:1007:59: note: parameter of type 'u8' (aka 'unsigned char') is declared here
void fsp_fillmsg(struct fsp_msg *msg, u32 cmd_sub_mod, u8 add_words, ...)
^
[CC] platforms/ibm-fsp/apollo-pci.o
hw/fsp/fsp.c:1026:17: warning: passing an object that undergoes default argument promotion to
'va_start' has undefined behavior [-Wvarargs]
va_start(list, add_words);
^
hw/fsp/fsp.c:1016:47: note: parameter of type 'u8' (aka 'unsigned char') is declared here
struct fsp_msg *fsp_mkmsg(u32 cmd_sub_mod, u8 add_words, ...)
Signed-off-by: Joel Stanley <joel at jms.id.au>
---
hw/fsp/fsp.c | 4 ++--
include/fsp.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c
index 4a04d00391d0..4beb33053e20 100644
--- a/hw/fsp/fsp.c
+++ b/hw/fsp/fsp.c
@@ -1004,7 +1004,7 @@ static void __fsp_fillmsg(struct fsp_msg *msg, u32 cmd_sub_mod,
va_end(list);
}
-void fsp_fillmsg(struct fsp_msg *msg, u32 cmd_sub_mod, u8 add_words, ...)
+void fsp_fillmsg(struct fsp_msg *msg, u32 cmd_sub_mod, u32 add_words, ...)
{
va_list list;
@@ -1013,7 +1013,7 @@ void fsp_fillmsg(struct fsp_msg *msg, u32 cmd_sub_mod, u8 add_words, ...)
va_end(list);
}
-struct fsp_msg *fsp_mkmsg(u32 cmd_sub_mod, u8 add_words, ...)
+struct fsp_msg *fsp_mkmsg(u32 cmd_sub_mod, u32 add_words, ...)
{
struct fsp_msg *msg = fsp_allocmsg(!!(cmd_sub_mod & 0x1000000));
va_list list;
diff --git a/include/fsp.h b/include/fsp.h
index 9b96d5d5fbb5..ee851ecedd85 100644
--- a/include/fsp.h
+++ b/include/fsp.h
@@ -671,10 +671,10 @@ extern bool fsp_present(void);
* instead as we will eventually use pre-allocated message pools
*/
extern struct fsp_msg *fsp_allocmsg(bool alloc_response) __warn_unused_result;
-extern struct fsp_msg *fsp_mkmsg(u32 cmd_sub_mod, u8 add_words, ...) __warn_unused_result;
+extern struct fsp_msg *fsp_mkmsg(u32 cmd_sub_mod, u32 add_words, ...) __warn_unused_result;
/* Populate a pre-allocated msg */
-extern void fsp_fillmsg(struct fsp_msg *msg, u32 cmd_sub_mod, u8 add_words, ...);
+extern void fsp_fillmsg(struct fsp_msg *msg, u32 cmd_sub_mod, u32 add_words, ...);
/* Free a message
*
--
2.17.0
More information about the Skiboot
mailing list