lkml.org 
[lkml]   [2022]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] orangefs: make static read-only arrays modes and orangefs_modes const
Date
The static arrays modes and orangefs_modes are read-only so it makes
sense to make them const.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
fs/orangefs/orangefs-utils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c
index 46b7dcff18ac..87d83d08470d 100644
--- a/fs/orangefs/orangefs-utils.c
+++ b/fs/orangefs/orangefs-utils.c
@@ -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,
--
2.33.1
\
 
 \ /
  Last update: 2022-01-24 00:21    [W:0.028 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site