Return-Path: 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 Date: Thu, 4 May 2017 20:21:45 +0200 (CEST) From: Julia Lawall 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: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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)