From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from eddie.linux-mips.org ([148.251.95.138] helo=cvs.linux-mips.org) by metis.ext.pengutronix.de with esmtp (Exim 4.89) (envelope-from ) id 1hP29T-0004z3-MH for rauc@pengutronix.de; Fri, 10 May 2019 11:49:16 +0200 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23991965AbfEJJtPbxIFN (ORCPT ); Fri, 10 May 2019 11:49:15 +0200 Date: Fri, 10 May 2019 11:49:14 +0200 From: Ladislav Michl Message-ID: <20190510094914.GC29451@lenoch> References: <20190510094803.GA29451@lenoch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190510094803.GA29451@lenoch> Subject: [RAUC] [PATCH 2/3] Try harder to determine slot state (preview) List-Id: RAUC Project - Discussion List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: rauc-bounces@pengutronix.de Sender: "RAUC" To: rauc@pengutronix.de Cc: Trent Piepho T25seSB1Ymkgdm9sdW1lIGJ5IG5hbWUgaXMgc3VwcG9ydGVkIGZvciBub3cuLi4KLS0tCiBNYWtl ZmlsZS5hbSAgICAgICB8ICAyICsrCiBpbmNsdWRlL210ZC5oICAgICB8ICAzICsrCiBzcmMvY29u ZmlnX2ZpbGUuYyB8IDc5ICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr Kwogc3JjL2luc3RhbGwuYyAgICAgfCAzNyArKy0tLS0tLS0tLS0tLS0tLS0tLQogc3JjL210ZC5j ICAgICAgICAgfCA4OCArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKwogNSBmaWxlcyBjaGFuZ2VkLCAxNzQgaW5zZXJ0aW9ucygrKSwgMzUgZGVsZXRpb25zKC0p CiBjcmVhdGUgbW9kZSAxMDA2NDQgaW5jbHVkZS9tdGQuaAog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