From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.phycore.de ([217.6.246.34] helo=root.phytec.de) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1akpye-0004Pw-25 for barebox@lists.infradead.org; Tue, 29 Mar 2016 09:30:24 +0000 Date: Tue, 29 Mar 2016 11:29:45 +0200 From: Stefan Christ Message-ID: <20160329092945.GF2371@lws-christ> References: <1459241454-21155-1-git-send-email-s.hauer@pengutronix.de> <1459241454-21155-7-git-send-email-s.hauer@pengutronix.de> MIME-Version: 1.0 In-Reply-To: <1459241454-21155-7-git-send-email-s.hauer@pengutronix.de> Content-Disposition: inline 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: Re: [PATCH 7/7] bbu: print and evaluate image Metadata To: Sascha Hauer Cc: Barebox List SGkgU2FzY2hhLAoKPiBAQCAtMTQ3LDYgKzIxOCw4IEBAIGludCBiYXJlYm94X3VwZGF0ZShzdHJ1 Y3QgYmJ1X2RhdGEgKmRhdGEpCj4gIAlpZiAoIWRhdGEtPmRldmljZWZpbGUpCj4gIAkJZGF0YS0+ ZGV2aWNlZmlsZSA9IGhhbmRsZXItPmRldmljZWZpbGU7Cj4gIAo+ICsJYmJ1X2NoZWNrX21ldGFk YXRhKGRhdGEpOwo+ICsKPiAgCXJldCA9IGhhbmRsZXItPmhhbmRsZXIoaGFuZGxlciwgZGF0YSk7 Cj4gIAlpZiAocmV0ID09IC1FSU5UUikKPiAgCQlwcmludGYoInVwZGF0ZSBhYm9ydGVkXG4iKTsK CmhtbS4gSSB0aGluayB0aGUgY29kZSBzaG91bGQgYmUgCgogICAgIHJldCA9IGJidV9jaGVja19t ZXRhZGF0YShkYXRhKTsKICAgICBpZiAocmV0KQogICAgICAgICAgcmV0dXJuIHJldDsKCm9yI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