From patchwork Tue Jan 10 15:39:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9508035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3BF6A601EA for ; Tue, 10 Jan 2017 15:39:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F7D42858A for ; Tue, 10 Jan 2017 15:39:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 243F3285AC; Tue, 10 Jan 2017 15:39:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F04E2858A for ; Tue, 10 Jan 2017 15:39:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S939164AbdAJPjd (ORCPT ); Tue, 10 Jan 2017 10:39:33 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36827 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S939138AbdAJPjc (ORCPT ); Tue, 10 Jan 2017 10:39:32 -0500 Received: by mail-wm0-f68.google.com with SMTP id r126so10293145wmr.3 for ; Tue, 10 Jan 2017 07:39:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6b96dyOsu2K2uPaTGtByDzQ+OHi/J+XFHWDnRIjJ0io=; b=j9OKkpWK1hRaH53uOgn/cbou2DdF4bZ5ADBxOcYu09BKCdq40UH5O0seg86m+ZQK7o iAUei/TQTcB3RtrrY8pjd5H/RRDpjqg+tyl3ZP27zM4l87XxCHnnzRz1OnOWUd0cMuZW rhaMkuncJXrh6KbpdX7O/QzS4nFLjL3LefwlmYtX0nlscf9XOK2pXb/EpEBec1pf/dvT Q9Ytz1eUMp9QdNO6awHOCHe2CHf5BBQHGUWJc8cQMArMSkSPilyozWgmqKikFBbO3QpO bKrnEBUldtkXCvUig0xjMH4tXXjPDC4ZCToud8lp9L6QQYy8qj3YQsywBo3wS5xZLGFH rtoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6b96dyOsu2K2uPaTGtByDzQ+OHi/J+XFHWDnRIjJ0io=; b=PeB+xg+NW5D6DyfwFjWw9a/HQXwtH4ee+KoeVJkF4wlZdDhkNMsY+GElkMi/cojNbp R8J/f7Vkkz4mDr48PuhhaqCqHr1HD6TLpnBszqDRT6r9sSKLybqO/0nzcLFFgOqlIKN/ YOvnY6OCpuf1JFB3jYbxfJTwE7IgEh5AkNNsxTFew/oK/2UHVgvrqLsxdZ5/NW7sHAZe pVf/9o3JpcMz837jnyrhRamrqZAx5vGxrGM1rP2667Vmn5jqHWGIM/pe83wwWNLfJ7Ce UspxIyckCdMb34ReY5uryxQHVtPrKJCgHtASFX2CPM81sIYwiojTGez6mZqfjKAeiXOh XLcQ== X-Gm-Message-State: AIkVDXK8+BBD/xB0J5y6U0UH5AfTELdY65zvqO73UvbM9C5drhV7OEJIdWHVMR26M3KhpQ== X-Received: by 10.28.51.85 with SMTP id z82mr315670wmz.125.1484062771202; Tue, 10 Jan 2017 07:39:31 -0800 (PST) Received: from amir-VirtualBox.ctera.local (bzq-82-81-193-202.cablep.bezeqint.net. [82.81.193.202]) by smtp.gmail.com with ESMTPSA id cs4sm3792374wjd.42.2017.01.10.07.39.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Jan 2017 07:39:30 -0800 (PST) From: Amir Goldstein To: "Darrick J . Wong" Cc: Brian Foster , Christoph Hellwig , linux-xfs@vger.kernel.org Subject: [PATCH v7 1/6] xfs: make the ASSERT() condition likely Date: Tue, 10 Jan 2017 17:39:12 +0200 Message-Id: <1484062757-12433-2-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484062757-12433-1-git-send-email-amir73il@gmail.com> References: <1484062757-12433-1-git-send-email-amir73il@gmail.com> Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The ASSERT() condition is the normal case, not the exception, so testing the condition should be likely(), not unlikely(). Reviewed-by: Christoph Hellwig Signed-off-by: Amir Goldstein --- fs/xfs/xfs_linux.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h index e467218..7a989de 100644 --- a/fs/xfs/xfs_linux.h +++ b/fs/xfs/xfs_linux.h @@ -331,11 +331,11 @@ static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y) } #define ASSERT_ALWAYS(expr) \ - (unlikely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__)) + (likely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__)) #ifdef DEBUG #define ASSERT(expr) \ - (unlikely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__)) + (likely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__)) #ifndef STATIC # define STATIC noinline @@ -346,7 +346,7 @@ static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y) #ifdef XFS_WARN #define ASSERT(expr) \ - (unlikely(expr) ? (void)0 : asswarn(#expr, __FILE__, __LINE__)) + (likely(expr) ? (void)0 : asswarn(#expr, __FILE__, __LINE__)) #ifndef STATIC # define STATIC static noinline