Skip to contentSkip to conversation

staging: greybus: char * array declaration as static const

PATCH In review Payal Kshirsagar 2 participants 2 messages Mar 16, 2019

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

PATCH 1/1 staging: greybus: char * array declaration as static const

char * array declaration might be better as static const

---
 drivers/staging/greybus/audio_manager_module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/audio_manager_module.c +1 -1
index 2bfd804..6ef7381 100644
@@ -158,7 +158,7 @@ static void send_add_uevent(struct gb_audio_manager_module *module)
 	char ip_devices_string[64];
 	char op_devices_string[64];
 
-	char *envp[] = {
+	static const char * const envp[] = {
 		name_string,
 		vid_string,
 		pid_string,
Signature · 1 line
2.7.4
#1 lore raw
Quoted 1 line · Payal Kshirsagar

char * array declaration might be better as static const

Why, in this particular case?

The commit log message should be inthe imperative. It should explain what you have done and why. It should not just copy a checkpatch message.

In the original code there is no space after the *. The changed code should be that way as well.

julia

Quoted 29 lines
---
 drivers/staging/greybus/audio_manager_module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/audio_manager_module.c +1 -2
index 2bfd804..6ef7381 100644
@@ -158,7 +158,7 @@ static void send_add_uevent(struct gb_audio_manager_module *module)
 	char ip_devices_string[64];
 	char op_devices_string[64];
 
-	char *envp[] = {
+	static const char * const envp[] = {
 		name_string,
 		vid_string,
 		pid_string,
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1552739192-32372-1-git-send-email-payal.s.kshirsagar.98%40gmail.com.
For more options, visit https://groups.google.com/d/optout.