diff mbox series

[trivial] powercap: occ: Set occ_set_powercap as const attribute

Message ID 20210708091911.311168-1-hegdevasant@linux.vnet.ibm.com
State Accepted
Headers show
Series [trivial] powercap: occ: Set occ_set_powercap as const attribute | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (99c10192f2f322381af244709e504d9b28ccbfbf)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Vasant Hegde July 8, 2021, 9:19 a.m. UTC
From: "Pratik R. Sampat" <psampat@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@linux.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hw/occ.c           | 2 +-
 include/powercap.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Vasant Hegde July 19, 2021, 3:49 p.m. UTC | #1
On 7/8/21 2:49 PM, Vasant Hegde wrote:
> From: "Pratik R. Sampat" <psampat@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@linux.ibm.com>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

Thanks! Merged to master as 1daaf0e.

-Vasant
diff mbox series

Patch

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 */