Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2338292imm; Thu, 27 Sep 2018 11:07:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV60G6CFTeycPzkgUpRVyH/f35c093O4VZTWA/9f5UDuFrJwWKdOa5bnoVTzUEuIZTvqym+F2 X-Received: by 2002:a63:da57:: with SMTP id l23-v6mr11434751pgj.179.1538071667803; Thu, 27 Sep 2018 11:07:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538071667; cv=none; d=google.com; s=arc-20160816; b=H9FneVotCGTrMxELIOaYJG9SFQJkmrxhMkkFqFglRR+eWQeiJNMN+2WQn6CuuAjoGh e5Lo4NRrey+4gNCyfagp1NK2Q+FbCJn4Fi55q4ZU9ncCDsdQXJB6WzJs9y+zB7hYX/cq DHmYaIvhPDaJ1o+2xYaf10xyD5AUUI/cKM1ctC5nh8dx9RZjQ2Sy/QSqHtBkUNPqlOZ1 JWw+BiDOuVTMjZBGo8c9GibnyImQDnk35NWOGMhrDdixz0ZFiHdXi28Wy0SEu1BSNLOE O0uFJS2+t/9LHaupQ7ehVVVSlnIzfY/SeBKXIL5lvAzDt5Xbp761ZsfWPC0wy4enCfJs xr0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UEeulAjiOWAtqzm4y+NbcWygbkvyt477fVUAQwaNkkw=; b=yDQLckWs8dIgPs/7nzmpirVHopA4pcRLTV3Ktw9oj9FAq/lP8MvMQzSbsIE8KNVKVF WhW3Pjel6UEW571Ocxg9dwd6cVtujdg4Fmw1i1msqZ11CM1PK0Ga5BC7qZp/kLEVh8+p 73ArY288qx59GmD4u/2AIcwSqUpXDuMQJMgHukDlHIcAKbVjX0kte8Ld7m3sC5SoXqkq DvGA1GQjyDLla9CDW3QuQAu27WtayzIdZIWJZBuxCh/s58w0LtpJbNNJ986YPtxEjG7D /1Frh2pWsJyMr613+kjGep0cvzqgoVztxNB+ipHdbZmifWk2WVNXW3renIcD5Emcr7yw sClQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b+WLNcdX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10-v6si2372198pgg.330.2018.09.27.11.07.22; Thu, 27 Sep 2018 11:07:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b+WLNcdX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728284AbeI1A0P (ORCPT + 99 others); Thu, 27 Sep 2018 20:26:15 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35656 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727320AbeI1A0P (ORCPT ); Thu, 27 Sep 2018 20:26:15 -0400 Received: by mail-wr1-f67.google.com with SMTP id o16so3637554wrx.2 for ; Thu, 27 Sep 2018 11:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UEeulAjiOWAtqzm4y+NbcWygbkvyt477fVUAQwaNkkw=; b=b+WLNcdXpsvnpzngdJnZqKr/W4C5alr+JyzgNpzn1QSogx/kAJ9L6geA4HZMw1aAIR wIjFCtk7yt/FAs5/EocHSVBGwaz1oSDCilLHK7E9e1VVciFDx1dRadaJzddOhMDdrW2g O9uPl5nx8Wx7lLHfK6E0l+SnHP8dvdAM7glnexaYvYrOTahQN7XHB3FzR96fUVUNBVC3 9CU6RWcf3mHw5Lgi8aDAGqqc6pd9v49wqEyvV7R0PqlgjiEisyo047otKN0pOCYvocm6 ogxxNiGhvwEIjkTZ4BWIFXBvJsyyAaDUcXQeFlUf/fY3nIDdaB6OUICUOOwHd9helsOU lX6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UEeulAjiOWAtqzm4y+NbcWygbkvyt477fVUAQwaNkkw=; b=TUNxlqZhofUWVs47btsMaJhO0UX4vuVz79iwGTreSHUujAyU+M5Bw3u6cMmIUni2lg TgaUOph0Mu+SMNzTcidNCeE54K947/twYl/VkLiZezQrj4MlvXFxVYMZtFHaCZo5NxiO akm3141nKqYFkqjySB2ZD0exyLCM+Jv2ROgcV87GOdn9gOHJn7dkMdxZxb8yucIi/x6W hSBiNBUDTaoQEYjF8AvcHZp/S6UFDpyEE3xuVhuHa8Rma99rVHyIIyug0LLy3HXlp53j sfbobemFIPOvAS3j+TtY7DMYTYxhaT6VDK1PaD6D5S/BaKGVQCeW/aJda8KYzwtd43S2 PK1Q== X-Gm-Message-State: ABuFfog0uM33uAvLBJkfxbnQ4cOjrwqROI4L5i8oyZ0sZjtu7zwUAF8s etdLpMic8NkpOud36kbqoD1evqXm2CWsFA== X-Received: by 2002:adf:9031:: with SMTP id h46-v6mr9650316wrh.248.1538071605122; Thu, 27 Sep 2018 11:06:45 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id 144-v6sm3893418wma.19.2018.09.27.11.06.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 11:06:44 -0700 (PDT) From: Nathan Chancellor To: Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "David (ChunMing) Zhou" Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Nick Desaulniers , Nathan Chancellor Subject: [PATCH v2] drm/amd/display: Use proper enums in process_channel_reply Date: Thu, 27 Sep 2018 11:06:33 -0700 Message-Id: <20180927180632.11520-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180921215505.14634-1-natechancellor@gmail.com> References: <20180921215505.14634-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang warns when one enumerated type is implicitly converted to another. drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:315:19: warning: implicit conversion from enumeration type 'enum aux_channel_operation_result' to different enumeration type 'enum aux_transaction_reply' [-Wenum-conversion] reply->status = AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON; ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../display/dc/i2caux/dce110/aux_engine_dce110.c:349:19: warning: implicit conversion from enumeration type 'enum aux_channel_operation_result' to different enumeration type 'enum aux_transaction_reply' [-Wenum-conversion] reply->status = AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON; ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The current enum is incorrect, it should be from aux_transaction_reply, so use AUX_TRANSACTION_REPLY_HPD_DISCON. Reported-by: Nick Desaulniers Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- v1 -> v2: * Rather than change status to an integer, use the proper enumerated type from aux_transaction reply as suggested by Nick and confirmed by Henry. drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 2 +- .../gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c index 3f5b2e6f7553..aaeb7faac0c4 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_aux.c @@ -312,7 +312,7 @@ static void process_channel_reply( /* in case HPD is LOW, exit AUX transaction */ if ((sw_status & AUX_SW_STATUS__AUX_SW_HPD_DISCON_MASK)) { - reply->status = AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON; + reply->status = AUX_TRANSACTION_REPLY_HPD_DISCON; return; } diff --git a/drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c b/drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c index 8eee8ace1259..59c3ed43d609 100644 --- a/drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c +++ b/drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c @@ -346,7 +346,7 @@ static void process_channel_reply( /* in case HPD is LOW, exit AUX transaction */ if ((sw_status & AUX_SW_STATUS__AUX_SW_HPD_DISCON_MASK)) { - reply->status = AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON; + reply->status = AUX_TRANSACTION_REPLY_HPD_DISCON; return; } -- 2.19.0