From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>
Cc: Stephen Boyd <swboyd@chromium.org>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
<linux-arm-msm@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>,
<freedreno@lists.freedesktop.org>
Subject: Re: [PATCH v2] drm/msm/dpu: simplify and unify dpu_encoder_get_intf and dpu_encoder_get_wb
Date: Fri, 24 Jun 2022 19:08:24 -0700 [thread overview]
Message-ID: <5fa4aead-985b-e87b-5c66-5d9449fa1b5f@quicinc.com> (raw)
In-Reply-To: <20220625003028.383259-1-dmitry.baryshkov@linaro.org>
On 6/24/2022 5:30 PM, Dmitry Baryshkov wrote:
> Remove extra nestting level from the dpu_encoder_get_intf(), replacing it
> with the explicit return in case the INTF_WB was passed to the function.
>
> While we are at it, also change dpu_encoder_get_wb() to also use
> explicit return rather than the goto.
>
> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
> ---
>
> Changes since v1: fix the typo (noticed by Stephen)
>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index f435baa500f8..c682d4e02d1b 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -1255,12 +1255,13 @@ static enum dpu_intf dpu_encoder_get_intf(const struct dpu_mdss_cfg *catalog,
> {
> int i = 0;
>
> - if (type != INTF_WB) {
> - for (i = 0; i < catalog->intf_count; i++) {
> - if (catalog->intf[i].type == type
> - && catalog->intf[i].controller_id == controller_id) {
> - return catalog->intf[i].id;
> - }
> + if (type == INTF_WB)
> + return INTF_MAX;
> +
> + for (i = 0; i < catalog->intf_count; i++) {
> + if (catalog->intf[i].type == type
> + && catalog->intf[i].controller_id == controller_id) {
> + return catalog->intf[i].id;
> }
> }
>
> @@ -1273,14 +1274,13 @@ static enum dpu_wb dpu_encoder_get_wb(const struct dpu_mdss_cfg *catalog,
> int i = 0;
>
> if (type != INTF_WB)
> - goto end;
> + return WB_MAX;
>
> for (i = 0; i < catalog->wb_count; i++) {
> if (catalog->wb[i].id == controller_id)
> return catalog->wb[i].id;
> }
>
> -end:
> return WB_MAX;
> }
>
prev parent reply other threads:[~2022-06-25 2:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-25 0:30 [PATCH v2] drm/msm/dpu: simplify and unify dpu_encoder_get_intf and dpu_encoder_get_wb Dmitry Baryshkov
2022-06-25 2:08 ` Abhinav Kumar [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=5fa4aead-985b-e87b-5c66-5d9449fa1b5f@quicinc.com \
--to=quic_abhinavk@quicinc.com \
--cc=airlied@linux.ie \
--cc=bjorn.andersson@linaro.org \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=robdclark@gmail.com \
--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