Commit eb514766 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Daniel Lezcano
Browse files

thermal/drivers/loongson2: Constify struct thermal_zone_device_ops



'struct thermal_zone_device_ops' could be left unmodified in this driver.

Constifying this structure moves some data to a read-only section, so
increases overall security, especially when the structure holds some
function pointers.

This partly reverts commit 734b5def ("thermal/drivers/loongson2: Add
Loongson-2K2000 support") which removed the const qualifier. Instead,
define two different structures.

On a x86_64, with allmodconfig:
Before:
======
   text	   data	    bss	    dec	    hex	filename
   5089	   1160	      0	   6249	   1869	drivers/thermal/loongson2_thermal.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
   5464	   1128	      0	   6592	   19c0	drivers/thermal/loongson2_thermal.o

Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/5f5f815f85a9450bca7848c6d47a1fee840f47e5.1748176328.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent 97d4d774
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment