Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2343405imm; Thu, 27 Sep 2018 11:12:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV63AkU0G+xViXgz9FZ3exK9fCJeQreOEAmFBH4QFJcK2jRWXbVmoAS1sFu/XjVwLjUY2atOl X-Received: by 2002:a62:e110:: with SMTP id q16-v6mr4713053pfh.75.1538071975548; Thu, 27 Sep 2018 11:12:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538071975; cv=none; d=google.com; s=arc-20160816; b=bmTfZVyED6qTbbbRriVg1m7h+D486Fd1xGz9jIvpylUuWYooysP+NWPTbodXE1foAE lUoG9GJ0xehDlLWkc3nF/YnKasnMzi064zE74sXCdTa73+jjCGomcAx+Nb82YylWuFdY qsqJK8dNnykc6hNiethKKUqvYXau1jkdt0o9DaFqMNWAdTQM+97WEKvWldJxNDQzGL2T zyXngqxZ7O6m2xsC1Q1je3HRM6QUAvOTJ0KL0tI9Y0Xa+uH0fPT/KLxX/AKOwBjuRAYM tfqge5QoX+rV6gyQbGMsanZ/zQg9frtwpF/Jh5V1j6T0SE/dXIvcQ7KxMXVjfPCuxjn9 +Giw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xZtG4/vcM42ddSOkegOG9pv0meOBfwefQ0R0Jgpl8DU=; b=vvzGE0DYPZ1mDvbLBrZgCTXiNQ649A7wuvraX1KYVQTg4cY8wuJlpPNRsLLoCVgS/9 cJ0RlBnB2MGM7VzosEseS4VAvoayhQ6cssT1bHY29BBTyExK3WhdMbngu91HDwC/LlSl 9MLgB1NeYW4QWSXkuAtrVQa1TpI49pblfN/U/z9jNs2U9sBfucpTkl3G1zZ2skE5gx0o xv6328xFvrr+DRwfSVtJmB7jPdkGN5yj6Q3wXaXn6Esru8n8nzqaWcVvDNc7o8jbSpFr 3nt2YtS3dQeSsSiokOq0Q0dsSn7gC2IeZcF5WmWJGZuJ8ffS52WnqVwkbrL9nGIIEMw6 bxiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JfIVLQqL; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m76-v6si2665152pfg.323.2018.09.27.11.12.36; Thu, 27 Sep 2018 11:12:55 -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=@google.com header.s=20161025 header.b=JfIVLQqL; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728357AbeI1AbV (ORCPT + 99 others); Thu, 27 Sep 2018 20:31:21 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:37635 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727335AbeI1AbV (ORCPT ); Thu, 27 Sep 2018 20:31:21 -0400 Received: by mail-pg1-f196.google.com with SMTP id c10-v6so2537443pgq.4 for ; Thu, 27 Sep 2018 11:11:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xZtG4/vcM42ddSOkegOG9pv0meOBfwefQ0R0Jgpl8DU=; b=JfIVLQqLJlIHOxw/VQjpFIGBnIonYbMNu7GRZnYyG17m0ungk3LyZ8ydmu7Ex6a9j7 Qt23iu6J0zIpop5QADWOw/WOSyDWIgNCUNb8s3Y4rY6UwronilSPIn/rlMTWKoYSWY1S qN3ebgLfmRjarYYnwF5rvxK478I6EN9PkUg5SPZZYjlmnKvSTWkSiDDxTqlXavr8XFyj FP/1qAzKomIy4H67b3DvjawQ03sy7aqel44abiCXVftQ8UPKDmhvlFQ3flRsLwplIwaO c6+0Sf8GTLqk9XQ+jrmhh3EPMyJmNr76aLjiNPLWKGfr4TJJ//Kb3d2ImXeqm3pMX438 5o+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xZtG4/vcM42ddSOkegOG9pv0meOBfwefQ0R0Jgpl8DU=; b=kid05AtcAVH6lX4bsghsF8HjdFohkP6W/OODRBCbEpibGhZx735kQdoqztxRRhoq4W fOOnUw4EmeA9jYdSn3e30lOL4uLZou0illyUlsx/YIKl2MDf+0IHOq7B5fjWUNplmNjN +DEhFHIWzNLEmv574G8Sb+i4nlEMBPJLsWMvevbP3zKYOiwSqlpsJoI+HuviBQdK5np2 qZJ1ke8yEH3dyYSu4jyzX7cLrFP4CV+CWflLSkLmfDsvXgQiZlu/6PVL3VUGK/YEhPYc pHWGyydeypmBEepwGws/BdimRhdZji2swOMRWEWC3HsVY/9OdDtnA0vVEwk0DRR73KxX DOQQ== X-Gm-Message-State: ABuFfoh25nBxyvvuFyEI2wB8U4jtM8qls64/Ea2p4ZE5Ddydka9Ria9T x3C9pHexqqbqPsWynuibUQH8wfJDKHZNhmjuxs0hjg== X-Received: by 2002:aa7:800f:: with SMTP id j15-v6mr12747031pfi.174.1538071911309; Thu, 27 Sep 2018 11:11:51 -0700 (PDT) MIME-Version: 1.0 References: <20180921215505.14634-1-natechancellor@gmail.com> <20180927180632.11520-1-natechancellor@gmail.com> <20180927180816.GA12545@flashbox> In-Reply-To: <20180927180816.GA12545@flashbox> From: Nick Desaulniers Date: Thu, 27 Sep 2018 11:11:39 -0700 Message-ID: Subject: Re: [PATCH v2] drm/amd/display: Use proper enums in process_channel_reply To: Nathan Chancellor Cc: Harry Wentland , sunpeng.li@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, David1.Zhou@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 27, 2018 at 11:08 AM Nathan Chancellor wrote: > > On Thu, Sep 27, 2018 at 11:06:33AM -0700, Nathan Chancellor wrote: > > 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 Reviewed-by: Nick Desaulniers > > --- > > > > 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. > > Sigh Harry, sorry... Thanks for the patch, Nathan. Don't worry about sending a v3 over this; its below the commit line so this detail wont get committed. > > > > > 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 > > -- Thanks, ~Nick Desaulniers