[Skiboot] [PATCH trivial] powercap: occ: Set occ_set_powercap as const attribute
Vasant Hegde
hegdevasant at linux.vnet.ibm.com
Thu Jul 8 19:19:11 AEST 2021
From: "Pratik R. Sampat" <psampat at linux.ibm.com>
The commit fixes the compile time warning suggestion of setting
occ_set_powercap as a candiate for the attribute 'const'.
Fixes: c6aabe3f2eb5 (powercap: occ: Add a generic powercap framework)
Signed-off-by: Pratik R. Sampat <psampat at linux.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
hw/occ.c | 2 +-
include/powercap.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/occ.c b/hw/occ.c
index a1e4982f4..b09b76dc4 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -1512,7 +1512,7 @@ static struct opal_occ_cmd_data pcap_data = {
.cmd = OCC_CMD_SET_POWER_CAP,
};
-int occ_set_powercap(u32 handle, int token, u32 pcap)
+int __attribute__((__const__)) occ_set_powercap(u32 handle, int token, u32 pcap)
{
struct occ_dynamic_data *ddata;
struct proc_chip *chip;
diff --git a/include/powercap.h b/include/powercap.h
index 3340ab7e1..e47219130 100644
--- a/include/powercap.h
+++ b/include/powercap.h
@@ -25,6 +25,6 @@ enum powercap_class {
/* Powercap OCC interface */
int occ_get_powercap(u32 handle, u32 *pcap);
-int occ_set_powercap(u32 handle, int token, u32 pcap);
+int __attribute__((__const__)) occ_set_powercap(u32 handle, int token, u32 pcap);
#endif /* __POWERCAP_H */
--
2.31.1
More information about the Skiboot
mailing list