Skip to contentSkip to conversation

Staging: android: binder.c const char* smth TO const char * const smth

PATCH In review Valentin Ilie 2 participants 2 messages Apr 16, 2012 – Apr 18, 2012 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: android: binder.c const char* smth TO const char * const smth

Replaced static const char* var with static const char * var const smth because smth doesn't need to be reassigned at any point else at runtime.

---
 drivers/staging/android/binder.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/android/binder.c +3 -3
index c283212..221bd3f 100644
@@ -3303,7 +3303,7 @@ static void print_binder_proc(struct seq_file *m,
 		m->count = start_pos;
 }
 
-static const char *binder_return_strings[] = {
+static const char * const binder_return_strings[] = {
 	"BR_ERROR",
 	"BR_OK",
 	"BR_TRANSACTION",
@@ -3324,7 +3324,7 @@ static const char *binder_return_strings[] = {
 	"BR_FAILED_REPLY"
 };
 
-static const char *binder_command_strings[] = {
+static const char * const binder_command_strings[] = {
 	"BC_TRANSACTION",
 	"BC_REPLY",
 	"BC_ACQUIRE_RESULT",
@@ -3344,7 +3344,7 @@ static const char *binder_command_strings[] = {
 	"BC_DEAD_BINDER_DONE"
 };
 
-static const char *binder_objstat_strings[] = {
+static const char * const binder_objstat_strings[] = {
 	"proc",
 	"thread",
 	"node",
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 2 lines · Valentin Ilie

Replaced static const char* var with static const char * var const smth because smth doesn't need to be reassigned at any point else at runtime.

"smth"? What is that?

Quoted 11 lines
---
 drivers/staging/android/binder.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/android/binder.c +0 -0
index c283212..221bd3f 100644

drivers/staging/android/binder.c static void print_binder_proc(struct seq_file *m, · line 3306

Quoted 5 lines
drivers/staging/android/binder.c +1 -1
@@ -3303,7 +3303,7 @@ static void print_binder_proc(struct seq_file *m,
 		m->count = start_pos;
 }
 
-static const char *binder_return_strings[] = {
+static const char * const binder_return_strings[] = {

I don't understand, what's the advantage here? Why is this needed? Does it save space? Speed? Compiler warnings?

I need a better reason to apply it other than a word with no vowels...

greg k-h