From patchwork Fri May 4 02:10:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 908441 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40cbDb7272z9s0q for ; Fri, 4 May 2018 12:14:23 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qjYxdX5v"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40cbDb5D30zF1QZ for ; Fri, 4 May 2018 12:14:23 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qjYxdX5v"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c05::244; helo=mail-pg0-x244.google.com; envelope-from=joel.stan@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qjYxdX5v"; dkim-atps=neutral Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40cb9m3d5gzF1PT for ; Fri, 4 May 2018 12:11:56 +1000 (AEST) Received: by mail-pg0-x244.google.com with SMTP id i194-v6so14428109pgd.0 for ; Thu, 03 May 2018 19:11:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=EuUOWvF8LgWztPqddIIz18W33QPS0XsRu2OlJWQokO4=; b=qjYxdX5vkCkGZmssr7Hkv2wG91lC0KvpCCT1foxuKT1mdS/sXzQHPTg+9cocub8LIS jAqDM0cmDTE8Jb+TvBQFrZisnRKSYoTwyclLaRCQYMTl3Aydh6GQjMKvYxuT9EvEnxiL mPHp2PYerntA82oCWgR4reL+xJunjuHf34sPf5JEaILHs3fRKOSVMQhiV6CoMJQMTjZA DLc5KejwRZsLWqWrIgVkesh5GBGOi6vdX/sQ5PsNgLf4zmAH7NwkAazhiuZ/+rHTiPO9 GA9YueE8Aiw8l1/4gNf3bbHoTeIPw/m+YgI/NJGq7UpzF43SxrGE1r6aiRRQDanpdVzP XVJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=EuUOWvF8LgWztPqddIIz18W33QPS0XsRu2OlJWQokO4=; b=L/37yPZRqV70Q7Ri3+fgyMdcngX3anGgPqF7Sv4U+dtMNepcjmga9OvhT+YpzH4k9N 1e4YVT3RrAIvvLo2v7ASkb4X7EjlIEyZL/c1DvcOtOZWHCXFCISW9tF1U8TPE+/hf4z6 ZhRSSWd4CwO3tl/kLNLB/5NjayYmSHCTrc8KNni+NJHf2Rg/MblONZLamJpI+XZKklWO 2NVD2rL7hJ/8vjZnZAek6u8kYCKmYkwqaxtoY6LJxoGQdezXHv3cn5ogI7I729hs32QY DipILulu591/V8El7g25pEShTSu8465JNX+BJbPtfFAqY4WWnGzxGK6QsqOmv5hRLKzt QV2w== X-Gm-Message-State: ALQs6tD3CjEFtGTJTbzmLoiAKrscO7T3T7i5HLlh6QCwb6ZjAMEmMbPE bFs3fnCG4YyY8Ykbge+bKukqQQNN X-Google-Smtp-Source: AB8JxZrDZwVcy5fQ+pCeX7/X6sJVHiSzVaAmyiRPKg6gTAIBZgd+U4x8BsdWhNaAxDLErCCJlFS+xA== X-Received: by 2002:a63:7253:: with SMTP id c19-v6mr20982813pgn.425.1525399914365; Thu, 03 May 2018 19:11:54 -0700 (PDT) Received: from aurora.jms.id.au ([45.124.203.19]) by smtp.gmail.com with ESMTPSA id 185sm30686706pfu.13.2018.05.03.19.11.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 May 2018 19:11:53 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Fri, 04 May 2018 11:41:48 +0930 From: Joel Stanley To: skiboot@lists.ozlabs.org Date: Fri, 4 May 2018 11:40:36 +0930 Message-Id: <20180504021036.17027-12-joel@jms.id.au> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180504021036.17027-1-joel@jms.id.au> References: <20180504021036.17027-1-joel@jms.id.au> Subject: [Skiboot] [PATCH v2 11/11] fsp: Fix msg vaargs usage X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 --- 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 *