lkml.org 
[lkml]   [2021]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRe: [PATCH 7/9] drm/i915/gvt: Constify formats
On Fri, Dec 10, 2021 at 08:20:22AM +0000, Wang, Zhi A wrote:
> On 12/4/2021 12:55 PM, Rikard Falkeborn wrote:
> > These are never modified, so make them const to allow the compiler to
> > put them in read-only memory. WHile at it, make the description const
> > char* since it is never modified.
> >
> > Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> > ---
> > drivers/gpu/drm/i915/gvt/fb_decoder.c | 24 ++++++++++++------------
> > 1 file changed, 12 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/gvt/fb_decoder.c b/drivers/gpu/drm/i915/gvt/fb_decoder.c
> > index 11a8baba6822..3c8736ae8fed 100644
> > --- a/drivers/gpu/drm/i915/gvt/fb_decoder.c
> > +++ b/drivers/gpu/drm/i915/gvt/fb_decoder.c
> > @@ -40,12 +40,12 @@
> >
> > #define PRIMARY_FORMAT_NUM 16
> > struct pixel_format {
> > - int drm_format; /* Pixel format in DRM definition */
> > - int bpp; /* Bits per pixel, 0 indicates invalid */
> > - char *desc; /* The description */
> > + int drm_format; /* Pixel format in DRM definition */
> > + int bpp; /* Bits per pixel, 0 indicates invalid */
> > + const char *desc; /* The description */
> > };
> Thanks so much for this. According to the code of i915, we prefer using
> one space as seperator.
> >

Thanks for reviewing. Just to clarify, is this how you want it to look:

struct pixel_format {
int drm_format; /* Pixel format in DRM definition */
int bpp; /* Bits per pixel, 0 indicates invalid */
char *desc; /* The description */
};

Rikard

\
 
 \ /
  Last update: 2021-12-12 14:21    [W:0.057 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site