Skip to contentSkip to conversation

orangefs: make static read-only arrays modes and orangefs_modes const

PATCH New Colin Ian King 1 participant 1 message Jan 23, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 orangefs: make static read-only arrays modes and orangefs_modes const

The static arrays modes and orangefs_modes are read-only so it makes sense to make them const.

---
 fs/orangefs/orangefs-utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/orangefs/orangefs-utils.c +2 -2
index 46b7dcff18ac..87d83d08470d 100644
@@ -538,13 +538,13 @@ __s32 ORANGEFS_util_translate_mode(int mode)
 {
 	int ret = 0;
 	int i = 0;
-	static int modes[NUM_MODES] = {
+	static const int modes[NUM_MODES] = {
 		S_IXOTH, S_IWOTH, S_IROTH,
 		S_IXGRP, S_IWGRP, S_IRGRP,
 		S_IXUSR, S_IWUSR, S_IRUSR,
 		S_ISGID, S_ISUID
 	};
-	static int orangefs_modes[NUM_MODES] = {
+	static const int orangefs_modes[NUM_MODES] = {
 		ORANGEFS_O_EXECUTE, ORANGEFS_O_WRITE, ORANGEFS_O_READ,
 		ORANGEFS_G_EXECUTE, ORANGEFS_G_WRITE, ORANGEFS_G_READ,
 		ORANGEFS_U_EXECUTE, ORANGEFS_U_WRITE, ORANGEFS_U_READ,
Signature · 1 line
2.33.1