From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.phycard.de ([217.6.246.34] helo=root.phytec.de) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cGjpO-0003Yw-3U for barebox@lists.infradead.org; Tue, 13 Dec 2016 09:56:55 +0000 Date: Tue, 13 Dec 2016 10:56:21 +0100 From: Stefan Lengfeld Message-ID: <20161213095621.GC3694@lws-christ> References: <1481565788-9115-1-git-send-email-andrew.smirnov@gmail.com> <1481565788-9115-5-git-send-email-andrew.smirnov@gmail.com> MIME-Version: 1.0 In-Reply-To: <1481565788-9115-5-git-send-email-andrew.smirnov@gmail.com> 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 v2 04/21] i.MX: ocotp: Add provisions for storing multiple MAC addresses To: Andrey Smirnov Cc: barebox@lists.infradead.org SGkgQW5kcmV5LAoKT24gTW9uLCBEZWMgMTIsIDIwMTYgYXQgMTA6MDI6NTFBTSAtMDgwMCwgQW5k cmV5IFNtaXJub3Ygd3JvdGU6Cj4gaS5NWCBTb0MgdmFyaWFudHMgbGlrZSBWeWJyaWQgaGF2ZSBt b3JlIHRoYW4gb25lIGJ1aWx0LWluIEV0aGVybmV0Cj4gaW50ZXJmYWNlIGFuZCBhcyBhIGNvbnNl cXVlbmNlIHN1cHBvcnQgc3RvcmluZyBtb3JlIHRoYW4gb25lIE1BQyBhZGRyZXNzCj4gaW4gT0NP VFAgbW9kdWxlLiBBZGQgY29kZSB0byBjcmVhdGUgbXVsdGlwbGUgJ21hY19hZGRyPG4+JyBwYXJh bWV0ZXJzIGFzCj4gd2VsbCBhcyAnbWFjX2FkZHInIGFzIGFuICJhbGlhcyIgdG8gJ21hY19hZGRy MCcgZm9yIGJhY2t3YXJkcwo+IGN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