All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: greybus: audio manager module: make char array const
@ 2022-04-20  5:37 Ian Cowan
  2022-04-20  6:24 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Cowan @ 2022-04-20  5:37 UTC (permalink / raw)
  To: vaibhav.sr; +Cc: mgreer, johan, elder, gregkh, greybus-dev, linux-staging, ian

Make the envp char array a const in the send_add_uevent function since
the value will never change. It will remain an array of the pointers to
the various char arrays.

There does exist a warning when running the checkpatch script to
make this a static variable, but there does not appear to be any advantage
to make this change.

Signed-off-by: Ian Cowan <ian@linux.cowan.aero>
---
 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 0a0f0a394c84..c9d223b0e541 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[] = {
+	const char *envp[] = {
 		name_string,
 		vid_string,
 		pid_string,
-- 
2.32.0


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

* Re: [PATCH] Staging: greybus: audio manager module: make char array const
  2022-04-20  5:37 [PATCH] Staging: greybus: audio manager module: make char array const Ian Cowan
@ 2022-04-20  6:24 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2022-04-20  6:24 UTC (permalink / raw)
  To: Ian Cowan
  Cc: vaibhav.sr, mgreer, johan, elder, gregkh, greybus-dev, linux-staging

On Wed, Apr 20, 2022 at 01:37:55AM -0400, Ian Cowan wrote:
> There does exist a warning when running the checkpatch script to
> make this a static variable, but there does not appear to be any advantage
> to make this change.

Heh.  Don't send patches unless there is an advantage.

This patch breaks the build.  You need to at least try to compile your
changes before you send them.

regards,
dan carpenter


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

end of thread, other threads:[~2022-04-20  6:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20  5:37 [PATCH] Staging: greybus: audio manager module: make char array const Ian Cowan
2022-04-20  6:24 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.