From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Stephen Boyd <swboyd@chromium.org>
Cc: Abhinav Kumar <abhinavk@codeaurora.org>,
Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Kalyan Thota <kalyan_t@codeaurora.org>,
Kuogee Hsieh <khsieh@codeaurora.org>,
Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
Rob Herring <robh+dt@kernel.org>,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/5] drm/msm/dp: Support up to 3 DP controllers
Date: Thu, 26 Aug 2021 09:57:18 -0700 [thread overview]
Message-ID: <YSfH7j+24OMa3rVE@ripper> (raw)
In-Reply-To: <CAE-0n50JXw6KL-u70csWS-9F6YhZy0pNah91h4e9a_9MnjJzmA@mail.gmail.com>
On Thu 26 Aug 00:13 PDT 2021, Stephen Boyd wrote:
> Quoting Bjorn Andersson (2021-08-25 16:42:31)
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
[..]
> > @@ -203,8 +204,8 @@ static int dpu_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor)
> > dpu_debugfs_vbif_init(dpu_kms, entry);
> > dpu_debugfs_core_irq_init(dpu_kms, entry);
> >
> > - if (priv->dp)
> > - msm_dp_debugfs_init(priv->dp, minor);
> > + for (i = 0; i < ARRAY_SIZE(priv->dp); i++)
> > + msm_dp_debugfs_init(priv->dp[i], minor);
>
> Does this need the same if (!priv->dp) continue check like the other
> loops over priv->dp?
>
[..]
> > @@ -800,7 +809,8 @@ static int dpu_irq_postinstall(struct msm_kms *kms)
> > if (!priv)
> > return -EINVAL;
> >
> > - msm_dp_irq_postinstall(priv->dp);
> > + for (i = 0; i < ARRAY_SIZE(priv->dp); i++)
> > + msm_dp_irq_postinstall(priv->dp[i]);
>
> This one too? Or maybe those gained NULL pointer checks.
>
This already has a NULL check, that's why I added one to the adjacent
msm_dp_debugfs_init() as well.
> >
> > return 0;
> > }
> > diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
[..]
> > @@ -1194,6 +1230,10 @@ static int dp_display_probe(struct platform_device *pdev)
> > if (!dp)
> > return -ENOMEM;
> >
> > + dp->id = dp_display_get_id(pdev);
>
> Ah ok, it's signed for this error check. Maybe assign dp->id in the
> function and return 0 instead of assigning it here?
> dp_display_assign_id()
>
I like the fact that the "getter" doesn't have side effects, but making
dp->id unsigned makes sense. So let's pay the price of a local signed
variable here.
> > + if (dp->id < 0)
> > + return -EINVAL;
> > +
Thanks for the feedback,
Bjorn
next prev parent reply other threads:[~2021-08-26 16:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-25 23:42 [PATCH v2 0/5] drm/msm/dp: Support multiple DP instances and add sc8180x Bjorn Andersson
2021-08-25 23:42 ` [PATCH v2 1/5] drm/msm/dp: Remove global g_dp_display variable Bjorn Andersson
2021-08-26 6:54 ` Stephen Boyd
2021-08-25 23:42 ` [PATCH v2 2/5] drm/msm/dp: Modify prototype of encoder based API Bjorn Andersson
2021-08-26 7:06 ` Stephen Boyd
2021-08-25 23:42 ` [PATCH v2 3/5] drm/msm/dp: Support up to 3 DP controllers Bjorn Andersson
2021-08-26 7:13 ` Stephen Boyd
2021-08-26 16:57 ` Bjorn Andersson [this message]
2021-08-26 17:59 ` Stephen Boyd
2021-08-27 5:20 ` Stephen Boyd
2021-08-27 17:14 ` Bjorn Andersson
2021-09-28 17:22 ` khsieh
2021-10-01 13:58 ` Doug Anderson
2021-10-01 14:18 ` Bjorn Andersson
2021-08-25 23:42 ` [PATCH v2 4/5] dt-bindings: msm/dp: Add SC8180x compatibles Bjorn Andersson
2021-08-25 23:42 ` [PATCH v2 5/5] drm/msm/dp: Add sc8180x DP controllers Bjorn Andersson
2021-08-26 7:14 ` Stephen Boyd
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=YSfH7j+24OMa3rVE@ripper \
--to=bjorn.andersson@linaro.org \
--cc=abhinavk@codeaurora.org \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=kalyan_t@codeaurora.org \
--cc=khsieh@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robdclark@gmail.com \
--cc=robh+dt@kernel.org \
--cc=sean@poorly.run \
--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;
as well as URLs for NNTP newsgroup(s).