From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from pig2.dooz.org ([88.191.118.219]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RETQb-0003Q8-Qg for barebox@lists.infradead.org; Thu, 13 Oct 2011 22:07:02 +0000 From: =?UTF-8?q?Lo=C3=AFc=20Minier?= Date: Fri, 14 Oct 2011 00:06:41 +0200 Message-Id: <1318543601-20819-6-git-send-email-loic.minier@linaro.org> In-Reply-To: <1318543601-20819-1-git-send-email-loic.minier@linaro.org> References: <1318543601-20819-1-git-send-email-loic.minier@linaro.org> 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-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 5/5] Use size_t for memory offsets To: barebox@lists.infradead.org bWVtX3JlYWQoKSBhbmQgbWVtX3dyaXRlKCkgZGlkIGFyaXRobWV0aWMgd2l0aCBhIGxvY2FsIHVs b25nIHNpemUKdmFyaWFibGUsIGEgc2l6ZV90IGNvdW50IGFuZCBhbiB1bG9uZyBvZmZzZXQgdG8g cmV0dXJuIGEgc3NpemVfdCByZXN1bHQuCkNoYW5nZSB0aGVtIHRvIHVzZSBzaXplX3QgZm9yIHNp emUgYW5kIG9mZnNldCBhbmQgc3RvcCBjYXN0aW5nIGNvdW50IHRvCnVsb25nLgoKVGhpcyBmaXhl cyBhIHdhcm5pbmcgd2hlbiBidWlsZGluZyBmb3IgNjQtYml0cy4KClRoaXMgY2hhbmdlIG1pZ2h0 IGhhdmUgaW1wYWN0IG9uIHRoZSBleHBvcnRlZCBzeW1ib2xzLgoKU2lnbmVkLW9mZi1ieTogTG/D r2MgTWluaWVyIDxsb2ljLm1pbmllckBsaW5hcm8ub3JnPgotLS0KIGZzL2ZzLmMgfCAgIDEyICsr KysrKy0tLS0tLQogMSBm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