drm/etnaviv: constify static struct cooling_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Sun, 28 Nov 2021 20:19:16 +0000 (21:19 +0100)
committerLucas Stach <l.stach@pengutronix.de>
Wed, 1 Dec 2021 12:27:51 +0000 (13:27 +0100)
The only usage of cooling_ops is to pass its address to
thermal_of_cooling_device_register(), which takes a pointer to const
struct thermal_cooling_device_ops as input. Make it const to allow the
compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
drivers/gpu/drm/etnaviv/etnaviv_gpu.c

index 242a5fd8b93212d9481d5aec67e569d01d728d47..ba5fd012a40a90f73df475076b14f2974fcab8e9 100644 (file)
@@ -1658,7 +1658,7 @@ etnaviv_gpu_cooling_set_cur_state(struct thermal_cooling_device *cdev,
        return 0;
 }
 
-static struct thermal_cooling_device_ops cooling_ops = {
+static const struct thermal_cooling_device_ops cooling_ops = {
        .get_max_state = etnaviv_gpu_cooling_get_max_state,
        .get_cur_state = etnaviv_gpu_cooling_get_cur_state,
        .set_cur_state = etnaviv_gpu_cooling_set_cur_state,