public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: audio_manager: make envp[] static const
@ 2025-11-22  8:38 Sameeksha Sankpal
  2025-11-24  7:56 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sameeksha Sankpal @ 2025-11-22  8:38 UTC (permalink / raw)
  To: vaibhav.sr, mgreer
  Cc: johan, elder, gregkh, greybus-dev, linux-staging, linux-kernel,
	Sameeksha Sankpal

The envp[] array contains string literals and is never modified.
Declare it as 'static const char * const' to place it in read-only
memory and avoid unnecessary stack usage.

This fixes a checkpatch warning:
"char * array declaration might be better as static const"

Signed-off-by: Sameeksha Sankpal <sameekshasankpal@gmail.com>
---
 drivers/staging/greybus/audio_manager_module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c
index 4a4dfb42f50f..1b83c05f2434 100644
--- a/drivers/staging/greybus/audio_manager_module.c
+++ b/drivers/staging/greybus/audio_manager_module.c
@@ -159,7 +159,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.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-11-24 16:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-22  8:38 [PATCH] staging: greybus: audio_manager: make envp[] static const Sameeksha Sankpal
2025-11-24  7:56 ` kernel test robot
2025-11-24  9:11 ` kernel test robot
2025-11-24 16:37 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox