From patchwork Tue Jan 10 05:52:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 9506421 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 CF63A601E9 for ; Tue, 10 Jan 2017 06:03:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1CEE2845E for ; Tue, 10 Jan 2017 06:03:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B650428487; Tue, 10 Jan 2017 06:03:37 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 304612845E for ; Tue, 10 Jan 2017 06:03:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE1B16E190; Tue, 10 Jan 2017 06:03:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 624 seconds by postgrey-1.35 at gabe; Tue, 10 Jan 2017 06:03:28 UTC Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id A10656E190 for ; Tue, 10 Jan 2017 06:03:28 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.33,342,1477954800"; d="scan'208";a="254598346" Received: from wlan.dagstuhl.de (HELO [192.168.12.123]) ([192.76.146.51]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2017 06:52:59 +0100 Date: Tue, 10 Jan 2017 06:52:59 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Xiangliang Yu Subject: [PATCH] drm/amdgpu/gfx8: fix bugon.cocci warnings Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Cc: Tom St Denis , dri-devel@lists.freedesktop.org, Eric Huang , kbuild-all@01.org, Alex Deucher , Flora Cui , Rex Zhu , =?ISO-8859-15?Q?Christian_K=F6nig?= , Monk Liu X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use BUG_ON instead of a if condition followed by BUG. Generated by: scripts/coccinelle/misc/bugon.cocci CC: Xiangliang Yu Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu Reviewed-by: Christian König . --- gfx_v8_0.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c @@ -6623,8 +6623,7 @@ static void gfx_v8_0_ring_emit_fence_kiq u64 seq, unsigned int flags) { /* we only allocate 32bit for each seq wb address */ - if (flags & AMDGPU_FENCE_FLAG_64BIT) - BUG(); + BUG_ON(flags & AMDGPU_FENCE_FLAG_64BIT); /* write fence seq to the "addr" */ amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));