From patchwork Wed Jan 11 08:24:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9509465 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 E541D60762 for ; Wed, 11 Jan 2017 08:24:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4F9E285E5 for ; Wed, 11 Jan 2017 08:24:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA0BA285EE; Wed, 11 Jan 2017 08:24:33 +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 5293F285E5 for ; Wed, 11 Jan 2017 08:24:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933782AbdAKIYc (ORCPT ); Wed, 11 Jan 2017 03:24:32 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33649 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933704AbdAKIYc (ORCPT ); Wed, 11 Jan 2017 03:24:32 -0500 Received: by mail-wm0-f66.google.com with SMTP id r144so26433976wme.0 for ; Wed, 11 Jan 2017 00:24:31 -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=PQwYYfuIUjolern7ePdT/cW44BWX3wMfSCiJxxwGpy6dk9gi+9V7hVSos+on9SHBUd Hjdx1fvGBZQoEJkB2qH6a8KnERh5idpp73F4v7+yMgUbsj7onJAsLBLUJ1UsGUqqV5KR 8d7lXPFHIhy+IxqE2J41xWvz8Iq9HmXoTWePLAbMtpBCLQ3WO0FgBcPKha7pAFG5d0dr YvzKnUNTaskZj6TnD5jxMuJ3Uo4Iuvfa+DtDFgPB4/bRPGpsJjOVeLOAcgVAN+bQLhBz utm9qnoFlaZChS1v7L9FVYytwn2g7M1Sp9zyHe1FoGqvE72G35geut8oyMFEh2kpWDhC Us2Q== 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=suTU+JHQAr5SgjPN+3/IrODCQC65JxwCSX9QoSvxJz9v25cWZ2wKuCUEiJmW4IP+3E 4ummiv7wu2Nf3Dg73Ki6EHJA3kOaprOhb/xgcVShaL/3Mdu/d3Oul1Jb5umfyiVkTJhm oyX/QLvpET2ERyNzCYGNny2FMQKg3MeSwVdQtcfqaQ58cGVHbKNtksmK/qT7H3GouPy5 bgQotK4uBBghvInMIxx7mT4BEBi7ywf/vczQ/0NpltA2Fdnv6dDaacMr2QoJVhW6JxjQ L44rlEEjI47eMkbtX9AubcUH+2WjyXdMP2U/dZw7eJuvB8NGDEX/mKM9W3gwFR8tzOEF mN0g== X-Gm-Message-State: AIkVDXKqZKtofYNTk4KCYyoBbCLblt1xysPyHMNdQkjWNEtsjBMgkpXumT64yHsD6GRNsA== X-Received: by 10.28.155.202 with SMTP id d193mr2381914wme.38.1484123070718; Wed, 11 Jan 2017 00:24:30 -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 l187sm7704670wml.6.2017.01.11.00.24.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Jan 2017 00:24:30 -0800 (PST) From: Amir Goldstein To: "Darrick J . Wong" Cc: Brian Foster , Christoph Hellwig , linux-xfs@vger.kernel.org Subject: [PATCH v8 1/6] xfs: make the ASSERT() condition likely Date: Wed, 11 Jan 2017 10:24:05 +0200 Message-Id: <1484123050-11064-2-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484123050-11064-1-git-send-email-amir73il@gmail.com> References: <1484123050-11064-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