Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3072778imm; Mon, 24 Sep 2018 15:23:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV60tEtXXD0HFYqykJ9IpZU1HDcfnNkph1kBcObH4ib0yUATzXH8Qk1QN4nUlaw6i7X6Xl1Ed X-Received: by 2002:a17:902:be06:: with SMTP id r6-v6mr694875pls.32.1537827835770; Mon, 24 Sep 2018 15:23:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537827835; cv=none; d=google.com; s=arc-20160816; b=ZlNDrRlZhezpdTHVVxXks7f9oMdFNaysMBabE1xrFOu1At0doZtSoC/pC6vccIiusM 8Ch8ZC2RQPeQYRbEnlWwyXXaYzSrevz3IEXcqMRdpIXUh8Raylw8/tI7B6D+JSu3xG/3 TJ170wuU0DpAe0l9c77hYCTmbL6/MYlOnsNx3IPV4EFpmjtIcwFmTobOzxSWh5DMM1er pi7LTgZ6OGEcc0WcjU/1skKQXlokxhmuluPBicU+fUmO2RRHZyKGQNhSGXUL7g1zVCHZ +3WZRXsyDt+OzeXkG7WOJJfGglrYbzywgM127yJMrFbfyNZTun1oozprTat3ObwGeitW WRKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5rMojbeLQ4wf0Thqx+pjTHjeMhNiJTAXQ4pr12hittM=; b=QVw64OKZ3a5ZI+GdO2pwdIEUy9gNcJIA7bSkOhl/b2F9mCv3eOJpiuuHoi/vAefQEb liowy8GFcyF+vCAaXdrrMj1Ai8CxpeLvqah9JOseroH/Dso+O0A1Oo3alF1clnv3Tlbn JxXVDQchQaoFKEbmKXhJHP0Pj4YG1hPxSiedfkxQfa47mkcPY9mMAAAzgv2KmHtAb+mE larh6IA5hAFoP1IrN3ukNx3K+WMyV9VYMP3YPKHOHVeyF/5gstVyyE5TTDU3G4TJIfvn 1xyysbT/dNdtKdsJ61LKSUiyjEahmi07EAMFkP4ZLPCD7OKNpOoMieQZ8lbMW7SNXG9m nIGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fqdDPHNr; 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 i10-v6si524430pgb.71.2018.09.24.15.23.40; Mon, 24 Sep 2018 15:23: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=@gmail.com header.s=20161025 header.b=fqdDPHNr; 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 S1728335AbeIYE0y (ORCPT + 99 others); Tue, 25 Sep 2018 00:26:54 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:36244 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727079AbeIYE0x (ORCPT ); Tue, 25 Sep 2018 00:26:53 -0400 Received: by mail-wm1-f65.google.com with SMTP id y13-v6so6816069wmi.1 for ; Mon, 24 Sep 2018 15:22:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5rMojbeLQ4wf0Thqx+pjTHjeMhNiJTAXQ4pr12hittM=; b=fqdDPHNraTHggCGg9Y9Zix+roaZ63/1S4yiN+kxWzEfQFnarPro1W2HO/g/kXG1nXb pyCIfRP80cmgsxMwKLafNn5CB+rY4WSgFHuYH/MlQlqFyA+nP8ZUago7ScPWFUzipQ0O 8wwUF37tPJWFt31beJecNCrkE2BDXmcA53hQQRV/7x43dfd/PU6b1j4BPQE5H43r2BVw NqPYoDNvH5uZxN+eZWsLALOl6HOXaX9n+0t1qpoepyNe8AGPhpRZ7nZIw7JX+s6/NDWz fIpjynSN3w9ZDvZtAE3gQ/EqjrfQY7DvicPHYXgmrKp6ztr7i6EucjP4mNBkBLnCGkos iCjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5rMojbeLQ4wf0Thqx+pjTHjeMhNiJTAXQ4pr12hittM=; b=erLymB//gnU1Zco0sQV13OOaoe2Rl3omBGpGXXizRLCfuZg7Lhj9tb36x2dVXSQLyk 4sH2li7QnpiJeBhk63X+HYb/zwXzZMelPCfIDCkHJFw1JOIlLTEXeqHD1xMEpm9x+TM3 iLXwKAh+D98/yHObMWOZ7j1QVj7CI7tVL0psZsIxoi2PzzyUrS1Ua9IcjZNpeE8a0bjT 2+EX6z1ntB+Ty9wnHm4/x4g91nkEcC/sFeod/Ma01UAYkcJRoJvLAC+DoOHeJVB+7oAr 08CX9W7C4nemBP5wwY9JNgxUtYN4z3zZxrJu/oPKDSlT5Yl8HfIuaIUBDWFgzOiya4OW b5zg== X-Gm-Message-State: ABuFfohtJQ0iDKOmRSiXFl8GKlW2s6YW7JR4/eZJgjh/Lc71KQzUO8Fh FpiZKTACO4X+Xxyj3ltBQhv69EFBD3xV5w== X-Received: by 2002:a1c:adca:: with SMTP id w193-v6mr246000wme.147.1537827747633; Mon, 24 Sep 2018 15:22:27 -0700 (PDT) Received: from flashbox ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id q200-v6sm22865609wmd.2.2018.09.24.15.22.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Sep 2018 15:22:26 -0700 (PDT) Date: Mon, 24 Sep 2018 15:22:25 -0700 From: Nathan Chancellor To: Nick Desaulniers Cc: harry.wentland@amd.com, 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 Subject: Re: [PATCH] drm/amd/display: Change status's type in aux_reply_transaction_data Message-ID: <20180924222225.GA26613@flashbox> References: <20180921215505.14634-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 24, 2018 at 03:07:16PM -0700, Nick Desaulniers wrote: > On Fri, Sep 21, 2018 at 2:55 PM 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; > > ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > I think the enum is actually wrong here. I think the correct fix would be: > > - reply->status = AUX_CHANNEL_OPERATION_FAILED_HPD_DISCON; > + reply->status = AUX_TRANSACTION_REPLY_HPD_DISCON; > > The identifiers are so similar, my guess was that it was easy to mix > them up. This looks like an actual bug to me, since the identifiers > have different values between the 2 different enums. > Hmmm interesting... I will be happy to send a v2 with your suggestion if one of the maintainers could confirm that to be the case (given DRM code is rather dense). Thanks for the review! Nathan > > > > Instead of implicitly or explicitly converting between types, just > > change status to type uint8_t (since its max size is 255) which avoids > > this construct altogether. > > > > Reported-by: Nick Desaulniers > > Signed-off-by: Nathan Chancellor > > --- > > drivers/gpu/drm/amd/display/dc/dc_ddc_types.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/amd/display/dc/dc_ddc_types.h b/drivers/gpu/drm/amd/display/dc/dc_ddc_types.h > > index 05c8c31d8b31..97e1d4d19263 100644 > > --- a/drivers/gpu/drm/amd/display/dc/dc_ddc_types.h > > +++ b/drivers/gpu/drm/amd/display/dc/dc_ddc_types.h > > @@ -79,7 +79,7 @@ enum aux_transaction_reply { > > }; > > > > struct aux_reply_transaction_data { > > - enum aux_transaction_reply status; > > + uint8_t status; > > uint32_t length; > > uint8_t *data; > > }; > > -- > > 2.19.0 > > > > > -- > Thanks, > ~Nick Desaulniers