Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp253260pxb; Wed, 18 Nov 2020 03:44:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3nUudvvlpW3Od9+1tzbOm+5hfxvzhoQ1FTgzYjU9yFdxCdeHkYGVCuyUtErtMF+YsG7ns X-Received: by 2002:aa7:d711:: with SMTP id t17mr25557908edq.83.1605699894680; Wed, 18 Nov 2020 03:44:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605699894; cv=none; d=google.com; s=arc-20160816; b=RiL6om+Fr8tmKd5C0gtvKVCDuGNujSize7GDYQk/1AVIqf1IwuqTAXckEc2mrcOnla hZ6iBaHFzJZJIJwt/JJA6AR3onQMaArXkT5Ask+25O5927lgYKWdvPp5reOsMnHYqemF /iy6+iGybZS4hANlnHacDYvsUdRrfAb38vUx9+XZ47Ch/jJc+xmaVMrTJ7OS6GVmxV2a +rKQtUIhzBmAChvJwSb/flBfHp901phMgz6i/6M5YJEkGzeNKxnfAcbo3Wzv72wHDt3c CDM+27LHeq38xtqrc3eqYKS3VX2z5ObMxIbGPOKMGr22O5SfxgQ7goDCbqfAG87A8fLs wqLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=MXsjv8hSPj7wZPiud7vL6v731fpizFXJQnOE5ntA54Y=; b=U6ueBWVDdhTijEBUrSyVl4v0q6TvFpy57EOzLf9U4R+kOhBh3sFhbrfJjBHRR82sa5 dIvAT5ae5G4kq1CUgxtP0qrhPfvhfLplLWo6GwjmNocyQ5aAWzxJuWFuISQGPT3aRqbP DIjcMsfrbsMWwGYobvcrZv9iKZ9bUFaNBydFqwjRgLZ93xQkbK966ejy8EbU/URzXv2/ FB1HX1hxG8R/PBiKlEYMW9sZ7pMgOa3lPteSDrteFomdp/5ul1tKRQ3jMkQ0la3AiQK9 WtEV21Q4G/Wlxasi+ZrBnEZa2zvxaUrZ+kGtJ1DmskP5H0ggcBhmaZxHJbVpgnbzQ++Y 6mZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vivo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g10si20079100edv.116.2020.11.18.03.44.31; Wed, 18 Nov 2020 03:44:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727294AbgKRLkb (ORCPT + 99 others); Wed, 18 Nov 2020 06:40:31 -0500 Received: from m17618.mail.qiye.163.com ([59.111.176.18]:32218 "EHLO m17618.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726867AbgKRLka (ORCPT ); Wed, 18 Nov 2020 06:40:30 -0500 Received: from ubuntu.localdomain (unknown [157.0.31.125]) by m17618.mail.qiye.163.com (Hmail) with ESMTPA id 4AB874E237B; Wed, 18 Nov 2020 19:40:27 +0800 (CST) From: Bernard Zhao To: David Airlie , Daniel Vetter , Bernard Zhao , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com Subject: [PATCH] drm/via: fix assignment in if condition Date: Wed, 18 Nov 2020 03:40:19 -0800 Message-Id: <20201118114021.105502-1-bernard@vivo.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZHkpOHxpIShoZGUNCVkpNS05NQkJNSUxPSk9VEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKTFVLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6PAw6Lww*GT8eIw4KEUwuME9L EToKCUJVSlVKTUtOTUJCTUlMTEJPVTMWGhIXVRkeCRUaCR87DRINFFUYFBZFWVdZEgtZQVlKTkxV S1VISlVKSU5ZV1kIAVlBSUhKSDcG X-HM-Tid: 0a75db27e9779376kuws4ab874e237b Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix check_patch.pl warning: ERROR: do not use assignment in if condition + if ((HALCYON_HEADER2 == (cmd = *buf)) && ERROR: do not use assignment in if condition + if (HALCYON_HEADER2 == (cmd = *buf)) Signed-off-by: Bernard Zhao --- drivers/gpu/drm/via/via_verifier.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/via/via_verifier.c b/drivers/gpu/drm/via/via_verifier.c index 8d8135f424ef..3d6e3a70f318 100644 --- a/drivers/gpu/drm/via/via_verifier.c +++ b/drivers/gpu/drm/via/via_verifier.c @@ -1001,8 +1001,8 @@ via_verify_command_stream(const uint32_t * buf, unsigned int size, state = via_check_vheader6(&buf, buf_end); break; case state_command: - if ((HALCYON_HEADER2 == (cmd = *buf)) && - supported_3d) + cmd = *buf; + if ((cmd == HALCYON_HEADER2) && supported_3d) state = state_header2; else if ((cmd & HALCYON_HEADER1MASK) == HALCYON_HEADER1) state = state_header1; @@ -1064,7 +1064,8 @@ via_parse_command_stream(struct drm_device *dev, const uint32_t *buf, state = via_parse_vheader6(dev_priv, &buf, buf_end); break; case state_command: - if (HALCYON_HEADER2 == (cmd = *buf)) + cmd = *buf; + if (cmd == HALCYON_HEADER2) state = state_header2; else if ((cmd & HALCYON_HEADER1MASK) == HALCYON_HEADER1) state = state_header1; -- 2.29.0