diff mbox series

[6/9] drm/i915/gvt: Constify cmd_interrupt_events

Message ID 20211204105527.15741-7-rikard.falkeborn@gmail.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/gvt: Constify static structs | expand

Commit Message

Rikard Falkeborn Dec. 4, 2021, 10:55 a.m. UTC
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/cmd_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Wang, Zhi A Dec. 10, 2021, 8:12 a.m. UTC | #1
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/cmd_parser.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
> index c4118b808268..ce9307546e7f 100644
> --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
> +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
> @@ -1144,7 +1144,7 @@ struct cmd_interrupt_event {
>   	int mi_user_interrupt;
>   };
>   
> -static struct cmd_interrupt_event cmd_interrupt_events[] = {
> +static const struct cmd_interrupt_event cmd_interrupt_events[] = {
>   	[RCS0] = {
>   		.pipe_control_notify = RCS_PIPE_CONTROL,
>   		.mi_flush_dw = INTEL_GVT_EVENT_RESERVED,

Reviewed-by: Zhi Wang <zhi.a.wang@intel.com>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
index c4118b808268..ce9307546e7f 100644
--- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
+++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
@@ -1144,7 +1144,7 @@  struct cmd_interrupt_event {
 	int mi_user_interrupt;
 };
 
-static struct cmd_interrupt_event cmd_interrupt_events[] = {
+static const struct cmd_interrupt_event cmd_interrupt_events[] = {
 	[RCS0] = {
 		.pipe_control_notify = RCS_PIPE_CONTROL,
 		.mi_flush_dw = INTEL_GVT_EVENT_RESERVED,