[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8a7dded1-809c-1bc6-f05d-8acd017b32fd@intel.com>
Date: Fri, 10 Dec 2021 08:20:54 +0000
From: "Wang, Zhi A" <zhi.a.wang@...el.com>
To: Rikard Falkeborn <rikard.falkeborn@...il.com>,
Zhenyu Wang <zhenyuw@...ux.intel.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
"Joonas Lahtinen" <joonas.lahtinen@...ux.intel.com>,
"Vivi, Rodrigo" <rodrigo.vivi@...el.com>,
Tvrtko Ursulin <tvrtko.ursulin@...ux.intel.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>
CC: "intel-gvt-dev@...ts.freedesktop.org"
<intel-gvt-dev@...ts.freedesktop.org>,
"intel-gfx@...ts.freedesktop.org" <intel-gfx@...ts.freedesktop.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 9/9] drm/i915/gvt: Constify vgpu_types
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. While at it, make name a const char*.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@...il.com>
> ---
> drivers/gpu/drm/i915/gvt/vgpu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/vgpu.c b/drivers/gpu/drm/i915/gvt/vgpu.c
> index fa6b92615799..8dddd0a940a1 100644
> --- a/drivers/gpu/drm/i915/gvt/vgpu.c
> +++ b/drivers/gpu/drm/i915/gvt/vgpu.c
> @@ -77,7 +77,7 @@ void populate_pvinfo_page(struct intel_vgpu *vgpu)
> #define VGPU_WEIGHT(vgpu_num) \
> (VGPU_MAX_WEIGHT / (vgpu_num))
>
> -static struct {
> +static const struct {
> unsigned int low_mm;
> unsigned int high_mm;
> unsigned int fence;
> @@ -88,7 +88,7 @@ static struct {
> */
> unsigned int weight;
> enum intel_vgpu_edid edid;
> - char *name;
> + const char *name;
> } vgpu_types[] = {
> /* Fixed vGPU type table */
> { MB_TO_BYTES(64), MB_TO_BYTES(384), 4, VGPU_WEIGHT(8), GVT_EDID_1024_768, "8" },
Reviewed-by: Zhi Wang <zhi.a.wang@...el.com>
Powered by blists - more mailing lists