Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: maitreye@codeaurora.org
To: Stephen Boyd <swboyd@chromium.org>
Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
	abhinavk@codeaurora.org, khsieh@codeaurora.org,
	seanpaul@chromium.org, aravindh@codeaurora.org,
	freedreno@lists.freedesktop.org
Subject: Re: [PATCH v3] drm/msm/dp: add logs across DP driver for ease of debugging
Date: Wed, 21 Jul 2021 15:01:00 -0700	[thread overview]
Message-ID: <d4daea9cdacc8a5544cefde5b64fdb78@codeaurora.org> (raw)
In-Reply-To: <CAE-0n52+E0eTgK_4x3OVnqv+U_12tMqxZYtcu3t+FiCJeaq2_g@mail.gmail.com>

Hello Stephen,
Thanks again for the review comments



On 2021-07-20 22:31, Stephen Boyd wrote:
> Quoting maitreye (2021-07-20 15:39:30)
>> diff --git a/drivers/gpu/drm/msm/dp/dp_link.c 
>> b/drivers/gpu/drm/msm/dp/dp_link.c
>> index be986da..316e8e6 100644
>> --- a/drivers/gpu/drm/msm/dp/dp_link.c
>> +++ b/drivers/gpu/drm/msm/dp/dp_link.c
>> @@ -1036,43 +1036,46 @@ int dp_link_process_request(struct dp_link 
>> *dp_link)
>> 
>>         if (link->request.test_requested == DP_TEST_LINK_EDID_READ) {
>>                 dp_link->sink_request |= DP_TEST_LINK_EDID_READ;
>> -               return ret;
>> +               goto out;
>>         }
>> 
>>         ret = dp_link_process_ds_port_status_change(link);
>>         if (!ret) {
>>                 dp_link->sink_request |= DS_PORT_STATUS_CHANGED;
>> -               return ret;
>> +               goto out;
>>         }
>> 
>>         ret = dp_link_process_link_training_request(link);
>>         if (!ret) {
>>                 dp_link->sink_request |= DP_TEST_LINK_TRAINING;
>> -               return ret;
>> +               goto out;
>>         }
>> 
>>         ret = dp_link_process_phy_test_pattern_request(link);
>>         if (!ret) {
>>                 dp_link->sink_request |= 
>> DP_TEST_LINK_PHY_TEST_PATTERN;
>> -               return ret;
>> +               goto out;
>>         }
>> 
>>         ret = dp_link_process_link_status_update(link);
> 
> if ret == 0 we go into the if below and goto out.
> 
>>         if (!ret) {
>>                 dp_link->sink_request |= DP_LINK_STATUS_UPDATED;
>> -               return ret;
>> +               goto out;
>>         }
> 
> At this point ret != 0 due to the goto above.
> 
>> 
>>         if (dp_link_is_video_pattern_requested(link)) {
>> -               ret = 0;
> 
> And now we've removed the ret = 0 assignment from here.
> 
>>                 dp_link->sink_request |= DP_TEST_LINK_VIDEO_PATTERN;
>> +               goto out;
> 
> And then we goto out. Isn't this a behavior change? Still feels like we
> should be using if/else-if logic here instead of this goto maze.
> 
>>         }
>> 
>>         if (dp_link_is_audio_pattern_requested(link)) {
>>                 dp_link->sink_request |= DP_TEST_LINK_AUDIO_PATTERN;
>> -               return -EINVAL;
>> +               ret = -EINVAL;
>> +               goto out;
>>         }
>> 
>> +out:
>> +       DRM_DEBUG_DP("sink request=%#x", dp_link->sink_request);
>>         return ret;
>>  }
>> 

Thank you. I see what you are saying, and yes it makes sense, I'll 
change it to if else-if logic.

      reply	other threads:[~2021-07-21 22:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 22:39 [PATCH v3] drm/msm/dp: add logs across DP driver for ease of debugging maitreye
2021-07-21  5:31 ` Stephen Boyd
2021-07-21 22:01   ` maitreye [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4daea9cdacc8a5544cefde5b64fdb78@codeaurora.org \
    --to=maitreye@codeaurora.org \
    --cc=abhinavk@codeaurora.org \
    --cc=aravindh@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=khsieh@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=seanpaul@chromium.org \
    --cc=swboyd@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox