From patchwork Fri Apr 15 07:15:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 8845541 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9E58EC0553 for ; Fri, 15 Apr 2016 07:15:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CAE3C202EB for ; Fri, 15 Apr 2016 07:15:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9AA90202DD for ; Fri, 15 Apr 2016 07:15:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 843356EBA9; Fri, 15 Apr 2016 07:15:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org 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 478236EBA9 for ; Fri, 15 Apr 2016 07:15:53 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.24,486,1454972400"; d="scan'208";a="214266888" Received: from 198.67.28.109.rev.sfr.net (HELO hadrien) ([109.28.67.198]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 15 Apr 2016 09:15:50 +0200 Date: Fri, 15 Apr 2016 09:15:49 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: Dave Airlie Subject: [PATCH] drm/amdgpu: fix compare_const_fl.cocci warnings Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Cc: Alex Deucher , linux-kernel@vger.kernel.org, kbuild-all@01.org, dri-devel@lists.freedesktop.org, =?ISO-8859-15?Q?Christian_K=F6nig?= 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-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move constants to the right of binary operators. Generated by: scripts/coccinelle/misc/compare_const_fl.cocci Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- Could be nice to put the thing being tested first. amdgpu_grph_object_id_helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_grph_object_id_helpers.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_grph_object_id_helpers.c @@ -169,11 +169,11 @@ struct graphics_object_id amdgpu_object_ struct graphics_object_id go_id = { 0 }; type = object_type_from_bios_object_id(bios_object_id); - if (OBJECT_TYPE_UNKNOWN == type) + if (type == OBJECT_TYPE_UNKNOWN) return go_id; enum_id = enum_id_from_bios_object_id(bios_object_id); - if (ENUM_ID_UNKNOWN == enum_id) + if (enum_id == ENUM_ID_UNKNOWN) return go_id; go_id = display_graphics_object_id_init(