Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3061847imm; Mon, 24 Sep 2018 15:10:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV622WLisjfEp66j/SUiunuYfScZs1mDCZ3K3557yM4DcpZ3gxyiSjhT7Ln1y4ngTlK46vG0p X-Received: by 2002:a63:5660:: with SMTP id g32-v6mr578810pgm.227.1537827002565; Mon, 24 Sep 2018 15:10:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537827002; cv=none; d=google.com; s=arc-20160816; b=mq89T+qiRmOJ9Zs5tIUtQFmJZVz+8qNNStKQStiRdmC9mL2SzR+DIgn1pOsiM38uA5 GowtaoNFyCBfLXvPHaQ05WLuxuFAyPRCRWwef/x1FSTgE4RXJHSZGfzU7xQM1ErF13iw 7mu8GZJkdl0aeGL0Kk7gLBG7j8l/LdU6s852xMQJ4dMm+dbEWlNAo6kCd1c79ldkJtUd xeoic8JW486pd8Dz9M0hHsHEkVfQ8pVlMZLYHJGNWd1LAl1Fryp2OK6R6M0t2inYtym9 YNuWiH2x9UOlLyswOqP9CtgCQp5yXhzScr29Gyn+wQcdxMSVu9kSrOHA13+AxOxEUdkg 8S+g== 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=fSmDT0rO3RTbXHu8PVgi/4vnDW7DuX+yiL+YCsE4uGs=; b=ViFyUxXmD1FDcHlMYKTEeyFJdVOhNFVOw3ahH5TPYRhbwV6DF16atAVUbtJ1LwkAO8 9z4WjG7Plq6ZC3wnfuYwengQSn5Odp2WpZXGatOokZqVBvQyUmz560Qj425mlEBdlIvt vTzbvWsaQv7ThweXcDRGXe3icqCa7DtYc+xPnIEOOdTllyp3zBHIvG1KySFHWdn4qmbU nDFQHtPwG4w2w6nqYYeXq/0bilSZm8ic6Ryn4i9GTrhzITOWwP8z4JC75eiOKFY8G+VY KKH/lNCqa5ehjzUh1JUVpbC6U+gKWx0EttH8TiLsgDuybArMiKmFjos5vyxCun/3TzWY rBFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YxWzHX4v; 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 g16-v6si367994pgj.35.2018.09.24.15.09.46; Mon, 24 Sep 2018 15:10:02 -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=YxWzHX4v; 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 S1728415AbeIYELt (ORCPT + 99 others); Tue, 25 Sep 2018 00:11:49 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:39329 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727253AbeIYELs (ORCPT ); Tue, 25 Sep 2018 00:11:48 -0400 Received: by mail-pg1-f193.google.com with SMTP id 85-v6so6847726pge.6 for ; Mon, 24 Sep 2018 15:07:28 -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=fSmDT0rO3RTbXHu8PVgi/4vnDW7DuX+yiL+YCsE4uGs=; b=YxWzHX4vQzVBXYosoBSYGromW+Obac3lEQgE+N2ikwPS5cE7gdMH3Lf4JIPMlb+xJB nhmoCo+BCpIxtFHh6hzS0DgSXzvmKHfCQ3ywejQg7VAgEuWLH09ZxelcuirUn/3uL4gB /xN1Nud27F+UzXFB/6YeMlL/+Ji7hMvP0NNxTEpdW+GV0kA/VeS+qDUIh976lVceyho6 neX4Bdkp/ZjLU1I2xGVPo9MgGNob+unO5BjR/c1/QeLQuBAoRG4Y64W8mEUeEt7w1MgQ 0EnJNASQBPN+/Oe55QpRBsly+9wjOLUa2lImJo+pedX64gaMRnrGRd33j3lMgOqTkCeT iitg== 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=fSmDT0rO3RTbXHu8PVgi/4vnDW7DuX+yiL+YCsE4uGs=; b=DzHydYQDt2jHx9Wb1rJcZbs3gFTOXB6ZM+NoCXa5xU8dYpA0gbYaSE3HthymXhg56g /+k6CGBTMIZKSVxLeP2g+sZE4Sl/biKJ40y60hFWYhILHsjIzqczH9TIgszmDgVLrmbc 3UxZfYEqJWCtMaNoTjZXC/gGKKNT0TpXLEGToWID0XCOBE15NLBpqBQ2PpUJ5OxtbxxY wpB7Zq8KS1ity+9Ug4BSS3LJxgYCLmcX98vJ6F7tKEPSDh2ANfwNvFN7eysgTYFfjMhf XdB2cA+FxFrB5vIWtfkpRay0ykysARkhT6Qs/lIWyseK8QKAr/l3sbzfas9YYeSg7Mam JOGQ== X-Gm-Message-State: ABuFfohfIRw39Kv8UqLwV1uPoJFUuX3NXHFvZOlIArrzhI0EMxVYPxKe gnG0fa3pgJv4LcOEkNov60vbPnJJ+OmZW85DKOUt1A== X-Received: by 2002:a17:902:6e01:: with SMTP id u1-v6mr645472plk.13.1537826847840; Mon, 24 Sep 2018 15:07:27 -0700 (PDT) MIME-Version: 1.0 References: <20180921215505.14634-1-natechancellor@gmail.com> In-Reply-To: <20180921215505.14634-1-natechancellor@gmail.com> From: Nick Desaulniers Date: Mon, 24 Sep 2018 15:07:16 -0700 Message-ID: Subject: Re: [PATCH] drm/amd/display: Change status's type in aux_reply_transaction_data To: Nathan Chancellor 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 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 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. > > 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