Message ID | 20190221062851.21958-3-andrew@aj.id.au |
---|---|
State | Accepted |
Headers | show
Return-Path: <skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l2X2D14z9sBF for <incoming@patchwork.ozlabs.org>; Thu, 21 Feb 2019 17:30:12 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="g99WOZXO"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="NUuGu2Z1"; 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 444l2X0t1pzDqN6 for <incoming@patchwork.ozlabs.org>; Thu, 21 Feb 2019 17:30:12 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=<UNKNOWN>) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="g99WOZXO"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="NUuGu2Z1"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l1Q3H86zDqN8 for <skiboot@lists.ozlabs.org>; Thu, 21 Feb 2019 17:29:14 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 138BF22167; Thu, 21 Feb 2019 01:29:12 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=fm2; bh= N04OJY6AvmyFcyihP92bjaLq+68e8rOJ0BwEBYvxK/k=; b=g99WOZXOMiGjbSFa kL7PJDX2ZFKfIpFJV1MKidwVmZZnUSxNU3Oap7/GBURYrtV01JsPm3zDmhbmxOCl czJEpnUHsO57nUNVK86n6/vhLxZpaWHnlMdB5OHvJnkOGpU7Ij9vktz98Oj8tVS6 yIYj7l77xpPFjl0ORSzmBr6q8WgmWWZraiBNg0HmLIHr4DAwFvyXTJVhKrkRUDTz EBmi2erA8pM/YkuzIogEQfGzikq717Sx70eZH9nM9HF+mxiL9MHzzgTiJpTxghL9 S8nTI1GsSZW7riSumFv3T/yYOAWMY3R6vUu5DVjrjTFtvgqgpYhuj6vdsMhaRw63 kkdPYA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=N04OJY6AvmyFcyihP92bjaLq+68e8rOJ0BwEBYvxK /k=; b=NUuGu2Z1lrU02FDdna166tg/kwIYNuo1FSyo8rIys/u3SLDZpWaDgBg8D UPPp4J2GFY6mJ5/JAJI8KrC8eQlwR1Aeixh0IBaEkrzrXDxpRGJ9sLFyU8IQ+Np5 cJ9czVDFDbYPDCBzS2LXf2hI3CbsmY1s8ZI9yt3gCI+PMQeJkbVtYUlWMsJareyv Pd9Kz9v4Dh9+vn0NISt9sj8SOfdcAkuWCzAXNxE1pD5ReH86bCF5CypYA09H7utw 7A2NfcHhNRZl7Vw8hEzDVMdt03UG+JT8DugdAbc69hRtYvT6cgKl27LrvRD/xoIy DZgtawGpTiA0jLV0UYhcYZAibyCYQ== X-ME-Sender: <xms:N0VuXDKqMPbzd0xzNiJnMEd3FnSucJ4qWs0qqBGKdjmTTWz8QFSBWA> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhggtgfgsehtke ertdertdejnecuhfhrohhmpeetnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfies rghjrdhiugdrrghuqeenucfkphepvddtvddrkedurddukedrvdeknecurfgrrhgrmhepmh grihhlfhhrohhmpegrnhgurhgvfiesrghjrdhiugdrrghunecuvehluhhsthgvrhfuihii vgeptd X-ME-Proxy: <xmx:N0VuXJtDbQC2HLFa-Z1lJl9hGTBG73blnGI-okU653dy1jdu8X2ABQ> <xmx:N0VuXPXfRJ3ei2c2NcLZVUMUjh79fWrI6I2dM563pEhO5_7RUOFIew> <xmx:N0VuXMgu8tCYxyWEGBBIUmkM3tveFiX0cv6Am_8bN65y6LWx-MwSMQ> <xmx:OEVuXH_UcaSp-hsFxiX2lNpJEvm6HmxMoMhQcuUaQFYJ1kaFzTrrRQ> Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 52F44E4210; Thu, 21 Feb 2019 01:29:09 -0500 (EST) From: Andrew Jeffery <andrew@aj.id.au> To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:01 +1030 Message-Id: <20190221062851.21958-3-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 02/52] ffspart, libflash: Fix stack size warnings X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development <skiboot.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/skiboot>, <mailto:skiboot-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/skiboot/> List-Post: <mailto:skiboot@lists.ozlabs.org> List-Help: <mailto:skiboot-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/skiboot>, <mailto:skiboot-request@lists.ozlabs.org?subject=subscribe> Cc: Andrew Jeffery <andrew@aj.id.au> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" <skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> |
Series |
ipmi-hiomap: Tests and fixes for event handling
|
expand
|
diff --git a/external/ffspart/ffspart.c b/external/ffspart/ffspart.c index bb46a9eaf311..9fc015cf872b 100644 --- a/external/ffspart/ffspart.c +++ b/external/ffspart/ffspart.c @@ -350,7 +350,9 @@ static void print_help(const char *pname) int main(int argc, char *argv[]) { - char *pnor = NULL, *input = NULL, line[MAX_LINE]; + static char line[MAX_LINE]; + + char *pnor = NULL, *input = NULL; bool toc_created = false, bad_input = false, allow_empty = false; uint32_t block_size = 0, block_count = 0; struct ffs_hdr *tocs[MAX_TOCS] = { 0 }; diff --git a/libflash/file.c b/libflash/file.c index 72765b5777f9..d790e29df103 100644 --- a/libflash/file.c +++ b/libflash/file.c @@ -117,7 +117,7 @@ static int file_write(struct blocklevel_device *bl, uint64_t dst, const void *sr */ static int file_erase(struct blocklevel_device *bl, uint64_t dst, uint64_t len) { - char buf[4096]; + static char buf[4096]; int i = 0; int rc;
libflash/file.c: In function 'file_erase': libflash/file.c:134:1: error: the frame size of 4128 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] } ^ and ffspart.c: In function ‘main’: ffspart.c:529:1: error: the frame size of 4864 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] } ^ In both cases, mark the local variables as static to avoid the stack. The static approach is valid for file.c as the buffer is always filled with `~0`. Given it's now going to be in .bss due to static we have to still perform the memset(), but racing memset()s in this fashion won't be harmful, just wasteful. For ffspart.c's main(), there are bigger problems if that needs to be re-entrant. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> --- external/ffspart/ffspart.c | 4 +++- libflash/file.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-)