diff mbox series

drm: include: fix W=1 warnings in struct drm_dsc_config

Message ID 20190909135205.10277-1-benjamin.gaignard@st.com (mailing list archive)
State New, archived
Headers show
Series drm: include: fix W=1 warnings in struct drm_dsc_config | expand

Commit Message

Benjamin GAIGNARD Sept. 9, 2019, 1:52 p.m. UTC
Change scale_increment_interval and nfl_bpg_offset fields to
u32 to avoid W=1 warnings because we are testing them against
65535.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
---
 include/drm/drm_dsc.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Harry Wentland Sept. 10, 2019, 12:58 p.m. UTC | #1
+Manasi, Gaurav

On 2019-09-09 9:52 a.m., Benjamin Gaignard wrote:
> Change scale_increment_interval and nfl_bpg_offset fields to
> u32 to avoid W=1 warnings because we are testing them against
> 65535.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> ---
>   include/drm/drm_dsc.h | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/include/drm/drm_dsc.h b/include/drm/drm_dsc.h
> index 887954cbfc60..e495024e901c 100644
> --- a/include/drm/drm_dsc.h
> +++ b/include/drm/drm_dsc.h
> @@ -207,11 +207,13 @@ struct drm_dsc_config {
>   	 * Number of group times between incrementing the scale factor value
>   	 * used at the beginning of a slice.
>   	 */
> -	u16 scale_increment_interval;
> +	u32 scale_increment_interval;

The DSC spec defines both as u16. I think the check in drm_dsc.c is 
useless and should be dropped.

Harry

> +
>   	/**
>   	 * @nfl_bpg_offset: Non first line BPG offset to be used
>   	 */
> -	u16 nfl_bpg_offset;
> +
> +	u32 nfl_bpg_offset;
>   	/**
>   	 * @slice_bpg_offset: BPG offset used to enforce slice bit
>   	 */
>
Navare, Manasi Sept. 10, 2019, 5:58 p.m. UTC | #2
On Tue, Sep 10, 2019 at 12:58:24PM +0000, Harry Wentland wrote:
> +Manasi, Gaurav
> 
> On 2019-09-09 9:52 a.m., Benjamin Gaignard wrote:
> > Change scale_increment_interval and nfl_bpg_offset fields to
> > u32 to avoid W=1 warnings because we are testing them against
> > 65535.
> > 
> > Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> > ---
> >   include/drm/drm_dsc.h | 6 ++++--
> >   1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/drm/drm_dsc.h b/include/drm/drm_dsc.h
> > index 887954cbfc60..e495024e901c 100644
> > --- a/include/drm/drm_dsc.h
> > +++ b/include/drm/drm_dsc.h
> > @@ -207,11 +207,13 @@ struct drm_dsc_config {
> >   	 * Number of group times between incrementing the scale factor value
> >   	 * used at the beginning of a slice.
> >   	 */
> > -	u16 scale_increment_interval;
> > +	u32 scale_increment_interval;
> 
> The DSC spec defines both as u16. I think the check in drm_dsc.c is 
> useless and should be dropped.
>

I agree with Harry here, all these variables should match the number of bits
in the spec, increasing them to u32 allows more values which violates the
DSC spec.

It should stay u16

Manasi
 
> Harry
> 
> > +
> >   	/**
> >   	 * @nfl_bpg_offset: Non first line BPG offset to be used
> >   	 */
> > -	u16 nfl_bpg_offset;
> > +
> > +	u32 nfl_bpg_offset;
> >   	/**
> >   	 * @slice_bpg_offset: BPG offset used to enforce slice bit
> >   	 */
> > 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/include/drm/drm_dsc.h b/include/drm/drm_dsc.h
index 887954cbfc60..e495024e901c 100644
--- a/include/drm/drm_dsc.h
+++ b/include/drm/drm_dsc.h
@@ -207,11 +207,13 @@  struct drm_dsc_config {
 	 * Number of group times between incrementing the scale factor value
 	 * used at the beginning of a slice.
 	 */
-	u16 scale_increment_interval;
+	u32 scale_increment_interval;
+
 	/**
 	 * @nfl_bpg_offset: Non first line BPG offset to be used
 	 */
-	u16 nfl_bpg_offset;
+
+	u32 nfl_bpg_offset;
 	/**
 	 * @slice_bpg_offset: BPG offset used to enforce slice bit
 	 */