From patchwork Wed Oct 3 21:25:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 10625329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77C12174A for ; Wed, 3 Oct 2018 21:25:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6793729080 for ; Wed, 3 Oct 2018 21:25:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BB0C29087; Wed, 3 Oct 2018 21:25:57 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 0B0F52908A for ; Wed, 3 Oct 2018 21:25:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726587AbeJDEQC (ORCPT ); Thu, 4 Oct 2018 00:16:02 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:35256 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbeJDEQB (ORCPT ); Thu, 4 Oct 2018 00:16:01 -0400 Received: by mail-wr1-f65.google.com with SMTP id w5-v6so7694112wrt.2 for ; Wed, 03 Oct 2018 14:25:54 -0700 (PDT) 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=YonemN/ftK59afoDWH4/F3Cc455oNw6EYOsiL2eZ7gY=; b=YWFzKuOTR2rYuQDYZFCsREM0bubczQEduteJKAfMtf9loI7vRXbzAGqBQTHCnwO//8 ITCWyrLmL+dfcFLc9dUSh+BX/XAFjeHzq53ujf3/rK0KwxTtdVztlmGfLdHNEdPrVU37 SPdzIb1PaWqPhCGk1+vduINBMI7Ulhyh/pO4oRXU/hRDtVV2Wlz1hT2WsgUmdkuPO2ex GFML88Yrmlb7VSCRs8lrCvrcxuCNvWsUaMfVauU5ih+IEaxjd+nkZJLOew6pG3aS3Wcz Si2s29sBQahAthSmxU2PzY32gFiVV+3K7EQVNqFKn40lLDwkZ1lqDB3x9a6BVqjT8tTI 835Q== 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=YonemN/ftK59afoDWH4/F3Cc455oNw6EYOsiL2eZ7gY=; b=TPDO/X7J40YNV5XreEoMFfOW0R+TGIQi7TR2DIeEENXMh/ITVc1nNUzVtY3lEmUZWu h33IUVF7PqI/eWIrwWkqfUhg+hcW0ANekBjShs2Epa74/iA/K0n1LZK1qKhFH9p8ck9S /Ifu3gx0rScAPfj6I6btPRaWHGBau19bBX6Om6O663IxdZyHrdWO0ILQGCUkISPc6rXw q3s9qQUVzewrcwB9uY72coHt9qiVZvW9APjuZCSv3dXxxB2mDZrBTd+iCDk8MJ3SnFQz wBD+nNPpSz6cQazh2De5QgCCtoVZ+4FZtpqQ0BZv8oWtko+haAUJuJPwtaRflAJIkAJe rODA== X-Gm-Message-State: ABuFfoggekd4OQOUGWuYwbSsmaiuz4vjBgiWO48gl3pQHwoiqAeW2jql mn7Cy7UxNKwdf5bfPl0gQpIBLQjZ X-Google-Smtp-Source: ACcGV61gwNfkuLZ0QB/0JZtDpitCZWWssV1LKb82zZEmO9kTC4pHEAods9aRAdiq7Y5AeMJbg1vyWA== X-Received: by 2002:adf:df8b:: with SMTP id z11-v6mr2545937wrl.113.1538601954186; Wed, 03 Oct 2018 14:25:54 -0700 (PDT) Received: from localhost.localdomain ([141.226.14.107]) by smtp.gmail.com with ESMTPSA id 193-v6sm4073866wmj.21.2018.10.03.14.25.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Oct 2018 14:25:53 -0700 (PDT) From: Amir Goldstein To: Jan Kara Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH v3 5/8] fsnotify: convert runtime BUG_ON() to BUILD_BUG_ON() Date: Thu, 4 Oct 2018 00:25:36 +0300 Message-Id: <20181003212539.2384-6-amir73il@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181003212539.2384-1-amir73il@gmail.com> References: <20181003212539.2384-1-amir73il@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The BUG_ON() statements to verify number of bits in ALL_FSNOTIFY_BITS and ALL_INOTIFY_BITS are converted to build time check of the constant. Signed-off-by: Amir Goldstein --- fs/notify/fsnotify.c | 2 +- fs/notify/inotify/inotify_user.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c index 7391a02bf723..875975504409 100644 --- a/fs/notify/fsnotify.c +++ b/fs/notify/fsnotify.c @@ -395,7 +395,7 @@ static __init int fsnotify_init(void) { int ret; - BUG_ON(hweight32(ALL_FSNOTIFY_BITS) != 23); + BUILD_BUG_ON(HWEIGHT32(ALL_FSNOTIFY_BITS) != 23); ret = init_srcu_struct(&fsnotify_mark_srcu); if (ret) diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index ac6978d3208c..105576daca4a 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c @@ -815,7 +815,7 @@ static int __init inotify_user_setup(void) BUILD_BUG_ON(IN_ISDIR != FS_ISDIR); BUILD_BUG_ON(IN_ONESHOT != FS_IN_ONESHOT); - BUG_ON(hweight32(ALL_INOTIFY_BITS) != 22); + BUILD_BUG_ON(HWEIGHT32(ALL_INOTIFY_BITS) != 22); inotify_inode_mark_cachep = KMEM_CACHE(inotify_inode_mark, SLAB_PANIC|SLAB_ACCOUNT);