From patchwork Wed Jan 10 01:45:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 123991 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4700265qgn; Tue, 9 Jan 2018 17:47:05 -0800 (PST) X-Google-Smtp-Source: ACJfBos6bdynld4+WNzVVjD40KNq71yOVnc1ENqoxFHrigaJOVvnfzjZvyDLjsZZU6k6hcmFjNtD X-Received: by 10.80.151.68 with SMTP id d4mr23256291edb.23.1515548825002; Tue, 09 Jan 2018 17:47:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515548824; cv=none; d=google.com; s=arc-20160816; b=OZ3u7VhYXslGlNPrKnikZNK0OonoMF6FRESSzJbadf9UC2J6TdiZ0COKiL3zmJw+Se 4Zs8lbL0wSEx6U6uy7WJMRi4JvJ6ozcKGREnWuzzufsmlPQl6cvJL7G1W6pJf6+HqBDi 1wOuk0Rc2bk/N1mllTMwZCjqhoRC25SG+DnSJ0ZYLfl9tQvYXaIB4Dsqetfin9g6WV+W Ct69aKVrTfX4rm473LUS4G8jT3UVWoKHBgNGGmpZi5kWR1Hgv66tg4D9DmMoEyy+O12h sh/bDFbmmVLdlyLc5NybaTy53vq/JGhxBhHe/X5rrC8Wwz968NHjrCPupI4KOB/+SSry tvAg== 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=Bfvg4JXqFOlTgMx8c4tU/zS3drrZ+lYDoE8bK/HOMu4=; b=CplfEc/D+qxluVG145YYk39mg+HVXPmErMkf2gGCsknfqxoJ5GqWv5OB8JVJaRsWKT vWEqQDIhVAIdw7cdwY2EJDvT7GrFdh3d9WBEUxPNlNgZ1IcNcQh2NQIdRuArVqF7rEFC CZ0o5TMTdOF5Wp0JnmThDVcKn+hNpRps/XZQTMvcNzyJFsfUNSYj3FU4MZUI6kIS1J5d SbaYQEF8Z2IklSxrxkDX9J8+bckK7yOeNj0gur1L6H1UG2lu8ijkfcflLU4+FRVjF4GV nJkkH74Sg46mSO2O/6xLjV0QIjwDqi7pE6XqTHoQ6+9ApdjFRmaKCyno60eN/e8PTvH5 mzew== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=QO+pSyGB; 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 z22si4755777edl.514.2018.01.09.17.47.04; Tue, 09 Jan 2018 17:47:04 -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=QO+pSyGB; 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 8B257C21FC7; Wed, 10 Jan 2018 01:46:34 +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 8740EC21FF3; Wed, 10 Jan 2018 01:45:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 93E31C21C59; Wed, 10 Jan 2018 01:45:56 +0000 (UTC) Received: from conuserg-11.nifty.com (conuserg-11.nifty.com [210.131.2.78]) by lists.denx.de (Postfix) with ESMTPS id 82F61C21D9F for ; Wed, 10 Jan 2018 01:45:55 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w0A1jUkY021339; Wed, 10 Jan 2018 10:45:36 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w0A1jUkY021339 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1515548736; bh=qpxJC9AwKo/fLUWKmB8D6v959x3PmaeEudKJ/RygIbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QO+pSyGBmN1jvBHalrFbAKGB5SR92YwMhm7e26idhalFFHYys9qjqBkYvA3urfq1L rGarLHGr4FnRpPRCQ4XFVZtfwUy+IYJIHNZ1XkJY2MklYu5udQs8ZVuxP+hPp6VlJv OW+0H+MTp0MoeJiAeiNVtIy9eKRIAah3DU68wc/chx6w5bv8+6fnxP/5d1RGnf84xS H6nXFrWCfoWuxZ9aIkcov96wcK7JEOT8nXfLKbh6ZeiAP0NgO1czQJYrSESYffsT3x Zs4a43geHEAdOTHFBjqgj8NJQN/U4zRb7p+zR3sgFrTMaw0qOj4Op8o/m/KkqCkvXN 1LBC06hc+HPRQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 10 Jan 2018 10:45:24 +0900 Message-Id: <1515548724-31869-7-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515548724-31869-1-git-send-email-yamada.masahiro@socionext.com> References: <1515548724-31869-1-git-send-email-yamada.masahiro@socionext.com> Cc: Tom Rini Subject: [U-Boot] [PATCH v3 6/6] 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 v3: - Rebase on v2017.01 Changes in v2: None include/log.h | 15 --------------- lib/tiny-printf.c | 9 --------- lib/vsprintf.c | 9 --------- 3 files changed, 33 deletions(-) diff --git a/include/log.h b/include/log.h index 8083b64..60a77c4 100644 --- a/include/log.h +++ b/include/log.h @@ -141,21 +141,6 @@ int _log(enum log_category_t cat, enum log_level_t level, const char *file, #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 int line, - const char *function); -#define assert(x) \ - ({ if (!(x) && _DEBUG) \ - __assert_fail(#x, __FILE__, __LINE__, __func__); }) - /** * struct log_rec - a single log record * 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 */