Skip to content

Commit

Permalink
fsp: Fix msg vaargs usage
Browse files Browse the repository at this point in the history
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@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
shenki authored and stewartsmith committed May 4, 2018
1 parent cd2c3b0 commit 854bf69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hw/fsp/fsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions include/fsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit 854bf69

Please sign in to comment.