From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C93EAC43334 for ; Sun, 10 Jul 2022 11:39:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4D36C845EB; Sun, 10 Jul 2022 13:39:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="Pcx+kRg+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D0CC2845F3; Sun, 10 Jul 2022 13:39:09 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2FA57845EB for ; Sun, 10 Jul 2022 13:39:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9E80E611E4; Sun, 10 Jul 2022 11:39:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8F0FC341C6; Sun, 10 Jul 2022 11:39:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657453142; bh=cgCb19LjUZUOgY0dHSBG3frcaEAx3SCYg4+s+ZydsyA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pcx+kRg+IcEn8C2GkS78EU8WrLOJ40in68PT1uuphqY8z+ukeepkomE11+ECwwB6M uUjL+prGx5qjw5lCrsgE2POZVOEpJEBo1QG9LVJ+l2t+UlQsBlOoeotRrds2L/Tb9Y YmUyRIxJsp+iVTBrTf754UY2GehN5do+l1o+4CO1cIOQ7l3ffCfJAsc3irDuzOde/b WQV0pQPrrtu0MUDBsXU31XqBBho3hfjIlySssh8v+yJLFsONpDyo4sDZ2igjeDx3bd xK8FszRYhZW7CN2WRi7lUx2NFknj4WQQDlyl2XQ/spQfdgVBwUX7X2JGEo0komw08F uIW11pRkLlAvw== Received: by pali.im (Postfix) id 136AD792; Sun, 10 Jul 2022 13:38:59 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Kyungmin Park , Heiko Schocher Cc: u-boot@lists.denx.de Subject: [PATCH 2/2] ubifs: Use U-Boot assert() from in UBI/UBIFS code Date: Sun, 10 Jul 2022 13:38:07 +0200 Message-Id: <20220710113807.20942-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220710113807.20942-1-pali@kernel.org> References: <20220710113807.20942-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean U-Boot already provides assert function, so it use also in ubi and ubifs code. Signed-off-by: Pali Rohár --- drivers/mtd/ubi/debug.h | 9 ++------- fs/ubifs/debug.h | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h index 2c2faaf1b4dc..9c8ce51636b1 100644 --- a/drivers/mtd/ubi/debug.h +++ b/drivers/mtd/ubi/debug.h @@ -27,13 +27,8 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); } \ } while (0) #else -#define ubi_assert(expr) do { \ - if (unlikely(!(expr))) { \ - pr_debug("UBI assert failed in %s at %u\n", \ - __func__, __LINE__); \ - dump_stack(); \ - } \ -} while (0) +#include +#define ubi_assert(expr) assert(expr) #endif #define ubi_dbg_print_hex_dump(ps, pt, r, g, b, len, a) \ diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h index d69f1e6ac70b..0ecc2e0c8e98 100644 --- a/fs/ubifs/debug.h +++ b/fs/ubifs/debug.h @@ -165,14 +165,9 @@ struct ubifs_global_debug_info { dbg_snprintf_key(c, key, __tmp_key_buf, DBG_KEY_BUF_LEN)); \ } while (0) #else -#define ubifs_assert(expr) do { \ - if (unlikely(!(expr))) { \ - pr_debug("UBIFS assert failed in %s at %u\n", \ - __func__, __LINE__); \ - dump_stack(); \ - } \ -} while (0) +#include +#define ubifs_assert(expr) assert(expr) #define ubifs_assert_cmt_locked(c) do { } while (0) #define ubifs_dbg_msg(type, fmt, ...) \ -- 2.20.1