From: Markus Elfring <Markus.Elfring@web.de>
To: "Jose Fernandez" <josef@netflix.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
kernel-janitors@vger.kernel.org, "Alan Liu" <haoping.liu@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
"David Airlie" <airlied@gmail.com>,
"Fangzhi Zuo" <jerry.zuo@amd.com>,
"George Shen" <george.shen@amd.com>,
"Hamza Mahfooz" <hamza.mahfooz@amd.com>,
"Harry Wentland" <harry.wentland@amd.com>,
"Ilya Bakoulin" <ilya.bakoulin@amd.com>,
"Leo Li" <sunpeng.li@amd.com>, "Leo Ma" <hanghong.ma@amd.com>,
"Nasir Osman" <nasir.osman@amd.com>,
"Nicholas Kazlauskas" <Nicholas.Kazlauskas@amd.com>,
"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
"Wenjing Liu" <wenjing.liu@amd.com>,
"Xinhui Pan" <Xinhui.Pan@amd.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/amd/display: Fix division by zero in setup_dsc_config
Date: Mon, 22 Apr 2024 17:38:43 +0200 [thread overview]
Message-ID: <964c9987-ea86-4167-899d-3bd3442ebfdb@web.de> (raw)
In-Reply-To: <20240410043433.12854-1-josef@netflix.com>
…
> +++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
> @@ -1055,7 +1055,12 @@ static bool setup_dsc_config(
> if (!is_dsc_possible)
> goto done;
>
> - dsc_cfg->num_slices_v = pic_height/slice_height;
> + if (slice_height > 0)
> + dsc_cfg->num_slices_v = pic_height/slice_height;
> + else {
> + is_dsc_possible = false;
> + goto done;
> + }
>
> if (target_bandwidth_kbps > 0) {
> is_dsc_possible = decide_dsc_target_bpp_x16(
I suggest to take another coding style concern into account.
Please use curly brackets for both if branches.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.9-rc5#n213
Regards,
Markus
prev parent reply other threads:[~2024-04-22 15:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-10 4:34 [PATCH] drm/amd/display: Fix division by zero in setup_dsc_config Jose Fernandez
2024-04-22 15:38 ` Markus Elfring [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=964c9987-ea86-4167-899d-3bd3442ebfdb@web.de \
--to=markus.elfring@web.de \
--cc=Nicholas.Kazlauskas@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=george.shen@amd.com \
--cc=hamza.mahfooz@amd.com \
--cc=hanghong.ma@amd.com \
--cc=haoping.liu@amd.com \
--cc=harry.wentland@amd.com \
--cc=ilya.bakoulin@amd.com \
--cc=jerry.zuo@amd.com \
--cc=josef@netflix.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nasir.osman@amd.com \
--cc=sunpeng.li@amd.com \
--cc=wenjing.liu@amd.com \
/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