From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.phytec.de ([217.6.246.34] helo=root.phytec.de) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bFjTU-0000SC-Tp for barebox@lists.infradead.org; Wed, 22 Jun 2016 14:49:54 +0000 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id 55772A00501 for ; Wed, 22 Jun 2016 16:50:11 +0200 (CEST) From: =?UTF-8?q?Stefan=20M=C3=BCller-Klieser?= Date: Wed, 22 Jun 2016 16:49:04 +0200 Message-Id: <1466606944-22735-2-git-send-email-s.mueller-klieser@phytec.de> In-Reply-To: <1466606944-22735-1-git-send-email-s.mueller-klieser@phytec.de> References: <1466606944-22735-1-git-send-email-s.mueller-klieser@phytec.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [RFC 1/1] ARM: bootm: recalculate decompression space To: barebox@lists.infradead.org QWNjb3JkaW5nIHRvIHRoZSBrZXJuZWwgZG9jdW1lbnRhdGlvbiBpdCBpcyByZWNvbW1lbmRlZCB0 byBwbGFjZSB0aGUKY29tcHJlc3NlZCBpbWFnZSBiZXR3ZWVuIDMyTWlCIGFuZCAxMjhNaUIuIFdl IHdpbGwgY29uZm9ybSB0byB0aGlzIGlmIHdlCmhhdmUgYXQgbGVhc3QgNjRNaUIgb2YgUkFNLiBJ ZiB0aGlzIGlzIG5vdCB0aGUgY2FzZSwgd2UgZmFsbCBiYWNrIHRvIHRoZQpvbGQgc2NoZW1lIGJ1 dCB0YWtlIHRoZSByZWxvY2F0ZWQgaW1hZ2UgaW50byBhY2NvdW50LgpUaGlzIGlzIHJlcXVpcmVk IGJlY2F1c2Ugb2YgdGhlIEFSTSBkZWZhdWx0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