Skip to contentSkip to conversation

staging: lustre: obd: make echo_lock_ops const

PATCH In review Bhumika Goyal 2 participants 2 messages Aug 3, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: obd: make echo_lock_ops const

Declare echo_lock_ops object of type cl_lock_operations as const as it is only passed to the function cl_lock_slice_add. The corresponding argument is of type const, so make the object const.

---
 drivers/staging/lustre/lustre/obdecho/echo_client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/obdecho/echo_client.c +1 -1
index 1c4a8fe..b3fbc3c 100644
@@ -319,7 +319,7 @@ static void echo_lock_fini(const struct lu_env *env,
 	kmem_cache_free(echo_lock_kmem, ecl);
 }
 
-static struct cl_lock_operations echo_lock_ops = {
+static const struct cl_lock_operations echo_lock_ops = {
 	.clo_fini      = echo_lock_fini,
 };
 
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines

Declare echo_lock_ops object of type cl_lock_operations as const as it is only passed to the function cl_lock_slice_add. The corresponding argument is of type const, so make the object const.

Quoted 22 lines
---
 drivers/staging/lustre/lustre/obdecho/echo_client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/obdecho/echo_client.c +1 -1
index 1c4a8fe..b3fbc3c 100644
@@ -319,7 +319,7 @@ static void echo_lock_fini(const struct lu_env *env,
 	kmem_cache_free(echo_lock_kmem, ecl);
 }
 
-static struct cl_lock_operations echo_lock_ops = {
+static const struct cl_lock_operations echo_lock_ops = {
 	.clo_fini      = echo_lock_fini,
 };
 
Signature · 1 line
1.9.1