From patchwork Thu May 4 18:21:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 9712493 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 E3D5860387 for ; Thu, 4 May 2017 18:25:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA10F2807B for ; Thu, 4 May 2017 18:25:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF2A528387; Thu, 4 May 2017 18:25:23 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 897A92807B for ; Thu, 4 May 2017 18:25:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754514AbdEDSXR (ORCPT ); Thu, 4 May 2017 14:23:17 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:54369 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751878AbdEDSVz (ORCPT ); Thu, 4 May 2017 14:21:55 -0400 X-IronPort-AV: E=Sophos;i="5.38,287,1491256800"; d="scan'208";a="271744111" Received: from unknown (HELO hadrien.local) ([88.131.217.146]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 May 2017 20:21:45 +0200 Date: Thu, 4 May 2017 20:21:45 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: David Howells , Alexander Viro , kbuild-all@01.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] VFS: fix bugon.cocci warnings Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 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 Use BUG_ON instead of a if condition followed by BUG. Generated by: scripts/coccinelle/misc/bugon.cocci Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git mount-context head: 87bc8f53d9779ac0347cf31c637a3d1a52611680 commit: be6c651c8f022bd739eb5f894a896bcde5834f82 [3/9] VFS: Introduce a mount context mount_context.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/fs/mount_context.c +++ b/fs/mount_context.c @@ -191,8 +191,7 @@ struct mount_context *__vfs_fsopen(struc struct mount_context *mc; int ret; - if (fs_type->fsopen && fs_type->mc_size < sizeof(*mc)) - BUG(); + BUG_ON(fs_type->fsopen && fs_type->mc_size < sizeof(*mc)); mc = kzalloc(max_t(size_t, fs_type->mc_size, sizeof(*mc)), GFP_KERNEL); if (!mc)