Skip to contentSkip to conversation

Staging: greybus: Make string array const

PATCH New Eames Trinh 2 participants 3 messages Aug 21, 2017 – Aug 22, 2017

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

PATCH 1/1 Staging: greybus: Make string array const

Added const to string array.

---
 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 adc16977452d..73a3e2decb3a 100644
@@ -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,
Signature · 1 line
2.11.0
#1 lore raw
url: https://github.com/0day-ci/linux/commits/Eames-Trinh/Staging-greybus-Make-string-array-const/20170823-042339 config: i386-allmodconfig (attached as .config) compiler: gcc-6 (Debian 6.2.0-3)…

Hi Eames,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.13-rc6 next-20170822]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Eames-Trinh/Staging-greybus-Make-string-array-const/20170823-042339
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce:

        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

drivers/staging/greybus/audio_manager_module.c: In function 'send_add_uevent':

>> drivers/staging/greybus/audio_manager_module.c:181:46: error: passing argument 3 of 'kobject_uevent_env' from incompatible pointer type [-Werror=incompatible-pointer-types]
     kobject_uevent_env(&module->kobj, KOBJ_ADD, envp);
                                                 ^~~~

In file included from drivers/staging/greybus/audio_manager.h:12:0,
from drivers/staging/greybus/audio_manager_module.c:11:
include/linux/kobject.h:218:5: note: expected 'char **' but argument is of type 'const char **'
int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

vim +/kobject_uevent_env +181 drivers/staging/greybus/audio_manager_module.c

8db00736 Svetlin Ankov    2016-01-13  152  
8db00736 Svetlin Ankov    2016-01-13  153  static void send_add_uevent(struct gb_audio_manager_module *module)
8db00736 Svetlin Ankov    2016-01-13  154  {
8db00736 Svetlin Ankov    2016-01-13  155  	char name_string[128];
8db00736 Svetlin Ankov    2016-01-13  156  	char vid_string[64];
8db00736 Svetlin Ankov    2016-01-13  157  	char pid_string[64];
d0af1bd5 Pankaj Bharadiya 2016-10-16  158  	char intf_id_string[64];
a9234bfd Vaibhav Agarwal  2016-03-30  159  	char ip_devices_string[64];
a9234bfd Vaibhav Agarwal  2016-03-30  160  	char op_devices_string[64];
8db00736 Svetlin Ankov    2016-01-13  161  
7be2c2a6 Eames Trinh      2017-08-22  162  	const char *envp[] = {
8db00736 Svetlin Ankov    2016-01-13  163  		name_string,
8db00736 Svetlin Ankov    2016-01-13  164  		vid_string,
8db00736 Svetlin Ankov    2016-01-13  165  		pid_string,
d0af1bd5 Pankaj Bharadiya 2016-10-16  166  		intf_id_string,
a9234bfd Vaibhav Agarwal  2016-03-30  167  		ip_devices_string,
a9234bfd Vaibhav Agarwal  2016-03-30  168  		op_devices_string,
8db00736 Svetlin Ankov    2016-01-13  169  		NULL
8db00736 Svetlin Ankov    2016-01-13  170  	};
8db00736 Svetlin Ankov    2016-01-13  171  
8db00736 Svetlin Ankov    2016-01-13  172  	snprintf(name_string, 128, "NAME=%s", module->desc.name);
8db00736 Svetlin Ankov    2016-01-13  173  	snprintf(vid_string, 64, "VID=%d", module->desc.vid);
8db00736 Svetlin Ankov    2016-01-13  174  	snprintf(pid_string, 64, "PID=%d", module->desc.pid);
d0af1bd5 Pankaj Bharadiya 2016-10-16  175  	snprintf(intf_id_string, 64, "INTF_ID=%d", module->desc.intf_id);
a9234bfd Vaibhav Agarwal  2016-03-30  176  	snprintf(ip_devices_string, 64, "I/P DEVICES=0x%X",
a9234bfd Vaibhav Agarwal  2016-03-30  177  		 module->desc.ip_devices);
a9234bfd Vaibhav Agarwal  2016-03-30  178  	snprintf(op_devices_string, 64, "O/P DEVICES=0x%X",
a9234bfd Vaibhav Agarwal  2016-03-30  179  		 module->desc.op_devices);
8db00736 Svetlin Ankov    2016-01-13  180  
8db00736 Svetlin Ankov    2016-01-13 @181  	kobject_uevent_env(&module->kobj, KOBJ_ADD, envp);
8db00736 Svetlin Ankov    2016-01-13  182  }
8db00736 Svetlin Ankov    2016-01-13  183  

:::::: The code at line 181 was first introduced by commit
:::::: 8db00736d365b75d6af5dfd4a2673a1453fff4b7 greybus: audio: Add Audio Manager

:::::: TO: Svetlin Ankov <[email protected]> :::::: CC: Greg Kroah-Hartman <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#2 lore raw
In reply to Eames Trinh
url: https://github.com/0day-ci/linux/commits/Eames-Trinh/Staging-greybus-Make-string-array-const/20170823-042339 config: xtensa-allmodconfig (attached as .config) compiler: xtensa-linux-gcc (GCC)…

Hi Eames,

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.13-rc6 next-20170822]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Eames-Trinh/Staging-greybus-Make-string-array-const/20170823-042339
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa

All warnings (new ones prefixed by >>):

drivers/staging//greybus/audio_manager_module.c: In function 'send_add_uevent':

>> drivers/staging//greybus/audio_manager_module.c:181:2: warning: passing argument 3 of 'kobject_uevent_env' from incompatible pointer type
     kobject_uevent_env(&module->kobj, KOBJ_ADD, envp);
     ^

In file included from drivers/staging//greybus/audio_manager.h:12:0,
from drivers/staging//greybus/audio_manager_module.c:11:
include/linux/kobject.h:218:5: note: expected 'char **' but argument is of type 'const char **'
int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
^

vim +/kobject_uevent_env +181 drivers/staging//greybus/audio_manager_module.c

8db00736 Svetlin Ankov    2016-01-13  152  
8db00736 Svetlin Ankov    2016-01-13  153  static void send_add_uevent(struct gb_audio_manager_module *module)
8db00736 Svetlin Ankov    2016-01-13  154  {
8db00736 Svetlin Ankov    2016-01-13  155  	char name_string[128];
8db00736 Svetlin Ankov    2016-01-13  156  	char vid_string[64];
8db00736 Svetlin Ankov    2016-01-13  157  	char pid_string[64];
d0af1bd5 Pankaj Bharadiya 2016-10-16  158  	char intf_id_string[64];
a9234bfd Vaibhav Agarwal  2016-03-30  159  	char ip_devices_string[64];
a9234bfd Vaibhav Agarwal  2016-03-30  160  	char op_devices_string[64];
8db00736 Svetlin Ankov    2016-01-13  161  
7be2c2a6 Eames Trinh      2017-08-22  162  	const char *envp[] = {
8db00736 Svetlin Ankov    2016-01-13  163  		name_string,
8db00736 Svetlin Ankov    2016-01-13  164  		vid_string,
8db00736 Svetlin Ankov    2016-01-13  165  		pid_string,
d0af1bd5 Pankaj Bharadiya 2016-10-16  166  		intf_id_string,
a9234bfd Vaibhav Agarwal  2016-03-30  167  		ip_devices_string,
a9234bfd Vaibhav Agarwal  2016-03-30  168  		op_devices_string,
8db00736 Svetlin Ankov    2016-01-13  169  		NULL
8db00736 Svetlin Ankov    2016-01-13  170  	};
8db00736 Svetlin Ankov    2016-01-13  171  
8db00736 Svetlin Ankov    2016-01-13  172  	snprintf(name_string, 128, "NAME=%s", module->desc.name);
8db00736 Svetlin Ankov    2016-01-13  173  	snprintf(vid_string, 64, "VID=%d", module->desc.vid);
8db00736 Svetlin Ankov    2016-01-13  174  	snprintf(pid_string, 64, "PID=%d", module->desc.pid);
d0af1bd5 Pankaj Bharadiya 2016-10-16  175  	snprintf(intf_id_string, 64, "INTF_ID=%d", module->desc.intf_id);
a9234bfd Vaibhav Agarwal  2016-03-30  176  	snprintf(ip_devices_string, 64, "I/P DEVICES=0x%X",
a9234bfd Vaibhav Agarwal  2016-03-30  177  		 module->desc.ip_devices);
a9234bfd Vaibhav Agarwal  2016-03-30  178  	snprintf(op_devices_string, 64, "O/P DEVICES=0x%X",
a9234bfd Vaibhav Agarwal  2016-03-30  179  		 module->desc.op_devices);
8db00736 Svetlin Ankov    2016-01-13  180  
8db00736 Svetlin Ankov    2016-01-13 @181  	kobject_uevent_env(&module->kobj, KOBJ_ADD, envp);
8db00736 Svetlin Ankov    2016-01-13  182  }
8db00736 Svetlin Ankov    2016-01-13  183  

:::::: The code at line 181 was first introduced by commit
:::::: 8db00736d365b75d6af5dfd4a2673a1453fff4b7 greybus: audio: Add Audio Manager

:::::: TO: Svetlin Ankov <[email protected]> :::::: CC: Greg Kroah-Hartman <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation