From patchwork Mon Dec 4 03:37:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 120487 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3947279qgn; Sun, 3 Dec 2017 19:38:54 -0800 (PST) X-Google-Smtp-Source: AGs4zMYpSpu2olBaZku1frUcvkWmUCD7Dc6qAGsE3HhQwiJCxmHfaUDenlFX7HqQFwWD5Mw6Wa0u X-Received: by 10.80.186.193 with SMTP id x59mr29015628ede.256.1512358734449; Sun, 03 Dec 2017 19:38:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512358734; cv=none; d=google.com; s=arc-20160816; b=ZpQvdI+41MPBe5PMuvvlYINAERgIOOBCpYqm8DT+gYvRsH6GEp8Y+XdgKMdpCq7yqa pN6JUT3C4RNLTagfVelzWb25Zc6FoN2lZ4oQopSvdWzFVUWs5DBzTH9RONF9TSh6nBl6 a6pnrRdGxdPSeCuh9LeIiVaZoOLnvLHfgvXr48TtK9osEJNi9j7VLRSaY6TdR3evnTZj NBbZ4pVowQn5Egbjh0Wb6UgUC7IxTbUstF5oqDziD73bgEnJJR+hNOZm8vhG04UBYs6y uafj0XCoW+d/odYccYKhSBGT7jZwCzdT3ydH8EcryzQxk+z8ssY00JstB869bZmkznGG 2RTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=nWdDy0TVw95Fyyp+CdZ0yLo/Y+cnWMgod2nsGFs6JGc=; b=UUkqSz5DYfA1T85thNpU54u4ycIePXIwAE6LunA0eFijpkFzSzS7HVL2Wm25rfofUR 79qNf1HrxAhme5YpajSq47NfMFHw4PDDVhZNZvbc0L0e1x/+7wanX4V2U4ArS/XzEUyB jU+y15EsHp8IXodLDbFHzxuM0M3jRbuuF4G7KOAtE63y0GLCnWpuVarOAmv0WoVudcAv 6YThWfJPsPxDNfQPtvAsNpYUwPsaQ1TWO3knbTuxnot5FmJpC6V5gq5i6hj3ndZfE1Pq UUQarmNMQyo6ielXIWAFgEwAob6GpaYQPExgR362B9Ed5QknMHyQ0uNP1Va+hz2uxSir Tm+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=p/cslfs4; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id x91si1276159edc.408.2017.12.03.19.38.54; Sun, 03 Dec 2017 19:38:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=p/cslfs4; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 06B50C22051; Mon, 4 Dec 2017 03:38:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 035B8C22035; Mon, 4 Dec 2017 03:38:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5D2BAC21D75; Mon, 4 Dec 2017 03:37:59 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id 45609C21D75 for ; Mon, 4 Dec 2017 03:37:58 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id vB43bE4t022247; Mon, 4 Dec 2017 12:37:21 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com vB43bE4t022247 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1512358641; bh=5YPf8fjbrUVNMbFgu/QnMPDmZXgtRJvOtID7owtuccY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p/cslfs4kxrpuJoEudWhwN0wlwihrtsZyIBquR1oUv+9nQ+sIHZaq8Ud5lpwQJ92Q eyIcJQy8qFv2s2l96liN3E4ORHKB7+wBkc0S4tNQ42xEyi3tGG6Vi8MM+9DYJ8X1Nn 5keSFXkdJkA+MuxwHHER7X8k8gnwSg9CjWJ5BncFdFMyX7sOTOq5A/n5ftaZoZc9v3 PEnOIswtvVk68RKygEMJnpT6YiP6f6ox4XFwBzACg6LG5EnWuUJFqrRwPcKs7aRKOc fE6gF0uMCyQ2ndjnI/EMzm196mGpVSnAx+ogvqkhh6NNIRgtqxhCUhPRjXGVdKf3WT ef6iR9TFcLEVg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 4 Dec 2017 12:37:04 +0900 Message-Id: <1512358624-6309-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512358624-6309-1-git-send-email-yamada.masahiro@socionext.com> References: <1512358624-6309-1-git-send-email-yamada.masahiro@socionext.com> Cc: Marek Vasut , Tom Rini Subject: [U-Boot] [PATCH v2 5/5] Remove assert() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" No more users of assert() except host tools. Remove. Signed-off-by: Masahiro Yamada Reviewed-by: Simon Glass --- Changes in v2: None include/common.h | 15 --------------- lib/tiny-printf.c | 9 --------- lib/vsprintf.c | 9 --------- 3 files changed, 33 deletions(-) diff --git a/include/common.h b/include/common.h index 6e24545..f035f76 100644 --- a/include/common.h +++ b/include/common.h @@ -76,21 +76,6 @@ typedef volatile unsigned char vu_char; #define warn_non_spl(fmt, args...) \ debug_cond(!_SPL_BUILD, fmt, ##args) -/* - * An assertion is run-time check done in debug mode only. If DEBUG is not - * defined then it is skipped. If DEBUG is defined and the assertion fails, - * then it calls panic*( which may or may not reset/halt U-Boot (see - * CONFIG_PANIC_HANG), It is hoped that all failing assertions are found - * before release, and after release it is hoped that they don't matter. But - * in any case these failing assertions cannot be fixed with a reset (which - * may just do the same assertion again). - */ -void __assert_fail(const char *assertion, const char *file, unsigned line, - const char *function); -#define assert(x) \ - ({ if (!(x) && _DEBUG) \ - __assert_fail(#x, __FILE__, __LINE__, __func__); }) - typedef void (interrupt_handler_t)(void *); #include /* boot information for Linux kernel */ diff --git a/lib/tiny-printf.c b/lib/tiny-printf.c index 0b04813..d5b6d69 100644 --- a/lib/tiny-printf.c +++ b/lib/tiny-printf.c @@ -381,12 +381,3 @@ int snprintf(char *buf, size_t size, const char *fmt, ...) return ret; } - -void __assert_fail(const char *assertion, const char *file, unsigned line, - const char *function) -{ - /* This will not return */ - printf("%s:%u: %s: Assertion `%s' failed.", file, line, function, - assertion); - hang(); -} diff --git a/lib/vsprintf.c b/lib/vsprintf.c index dd572d2..4208239 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -789,15 +789,6 @@ int vprintf(const char *fmt, va_list args) return i; } - -void __assert_fail(const char *assertion, const char *file, unsigned line, - const char *function) -{ - /* This will not return */ - panic("%s:%u: %s: Assertion `%s' failed.", file, line, function, - assertion); -} - char *simple_itoa(ulong i) { /* 21 digits plus null terminator, good for 64-bit or smaller ints */