Skip to content

Commit

Permalink
xen/manage: Constify struct shutdown_handler
Browse files Browse the repository at this point in the history
'struct shutdown_handler' is not modified in this driver.

Constifying this structure moves some data to a read-only section, so
increase overall security.

On a x86_64, with allmodconfig:
Before:
======
   text	   data	    bss	    dec	    hex	filename
   7043	    788	      8	   7839	   1e9f	drivers/xen/manage.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
   7164	    676	      8	   7848	   1ea8	drivers/xen/manage.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/ca1e75f66aed43191cf608de6593c7d6db9148f1.1719134768.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Juergen Gross <jgross@suse.com>
  • Loading branch information
Christophe JAILLET authored and Juergen Gross committed Jul 1, 2024
1 parent 22a40d1 commit e51d31c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/xen/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static void do_reboot(void)
orderly_reboot();
}

static struct shutdown_handler shutdown_handlers[] = {
static const struct shutdown_handler shutdown_handlers[] = {
{ "poweroff", true, do_poweroff },
{ "halt", false, do_poweroff },
{ "reboot", true, do_reboot },
Expand Down

0 comments on commit e51d31c

Please sign in to comment.