From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jo5vF-00047r-UO for barebox@lists.infradead.org; Wed, 24 Jun 2020 13:58:43 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 24 Jun 2020 15:58:36 +0200 Message-Id: <20200624135836.22154-1-u.kleine-koenig@pengutronix.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: [PATCH] treewide: make use of PTR_ERR_OR_ZERO To: barebox@lists.infradead.org UFRSX0VSUl9PUl9aRVJPIGlzIGRlc2lnbmVkIHRvIHJlcGxhY2UgYm9pbGVyIHBsYXRlIGxpa2U6 CgoJaWYgKElTX0VSUih4KSkKCQlyZXR1cm4gUFRSX0VSUih4KTsKCXJldHVybiAwOwoKU2lnbmVk LW9mZi1ieTogVXdlIEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRyb25peC5k ZT4KLS0tCiBhcmNoL2FybS9ib2FyZHMvZnJlZXNjYWxlLW14MjMtZXZrL214MjMtZXZrLmMgfCAg NCArLS0tCiBhcmNoL2FybS9ib2FyZHMva2Fyby10eDI4L3R4Mjgtc3RrNS5jICAgICAgICAgfCAg NCArLS0tCiBjb21tb24vZ2xvYmFsdmFyLmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAg NSArLS0tLQogY29tbW9uL3NlcmRldi5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwg IDUgKy0tLS0KIGRyaXZlcnMvbWZkL3JhdmUtc3AuYyAgICAgICAgICAgICAgICAgICAgICAgICB8 ICA1ICstLS0tCiB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