Message ID | 20211204105527.15741-9-rikard.falkeborn@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/i915/gvt: Constify static structs | expand |
On 12/4/2021 12:55 PM, Rikard Falkeborn wrote: > It is never modified, so make it const to allow the compiler to put it > in read-only memory. > > Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> > --- > drivers/gpu/drm/i915/gvt/gtt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c > index c8cd6bf28ea8..614156856f16 100644 > --- a/drivers/gpu/drm/i915/gvt/gtt.c > +++ b/drivers/gpu/drm/i915/gvt/gtt.c > @@ -185,7 +185,7 @@ struct gtt_type_table_entry { > .pse_entry_type = pse_type, \ > } > > -static struct gtt_type_table_entry gtt_type_table[] = { > +static const struct gtt_type_table_entry gtt_type_table[] = { > GTT_TYPE_TABLE_ENTRY(GTT_TYPE_PPGTT_ROOT_L4_ENTRY, > GTT_TYPE_PPGTT_ROOT_L4_ENTRY, > GTT_TYPE_INVALID, Reviewed-by: Zhi Wang <zhi.a.wang@intel.com>
diff --git a/drivers/gpu/drm/i915/gvt/gtt.c b/drivers/gpu/drm/i915/gvt/gtt.c index c8cd6bf28ea8..614156856f16 100644 --- a/drivers/gpu/drm/i915/gvt/gtt.c +++ b/drivers/gpu/drm/i915/gvt/gtt.c @@ -185,7 +185,7 @@ struct gtt_type_table_entry { .pse_entry_type = pse_type, \ } -static struct gtt_type_table_entry gtt_type_table[] = { +static const struct gtt_type_table_entry gtt_type_table[] = { GTT_TYPE_TABLE_ENTRY(GTT_TYPE_PPGTT_ROOT_L4_ENTRY, GTT_TYPE_PPGTT_ROOT_L4_ENTRY, GTT_TYPE_INVALID,
It is never modified, so make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> --- drivers/gpu/drm/i915/gvt/gtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)