[usb:usb-next 43/44] drivers/usb/core/quirks.c:135:9: error: implicit declaration of function 'param_set_copystring'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next
head:   8f94390226487bcb86c554ddc12eef0d27bdec3b
commit: b27560e4d9e5240b5544c9c5650c7442e482646e [43/44] usb: core: Add "quirks" parameter for usbcore
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout b27560e4d9e5240b5544c9c5650c7442e482646e
        # save the attached .config to linux build tree
        make.cross ARCH=sparc64 

All error/warnings (new ones prefixed by >>):

>> drivers/usb/core/quirks.c:27:59: warning: 'struct kernel_param' declared inside parameter list will not be visible outside of this definition or declaration
    static int quirks_param_set(const char *val, const struct kernel_param *kp)
                                                              ^~~~~~~~~~~~
   drivers/usb/core/quirks.c: In function 'quirks_param_set':
>> drivers/usb/core/quirks.c:135:9: error: implicit declaration of function 'param_set_copystring' [-Werror=implicit-function-declaration]
     return param_set_copystring(val, kp);
            ^~~~~~~~~~~~~~~~~~~~
   drivers/usb/core/quirks.c: At top level:
>> drivers/usb/core/quirks.c:138:21: error: variable 'quirks_param_ops' has initializer but incomplete type
    static const struct kernel_param_ops quirks_param_ops = {
                        ^~~~~~~~~~~~~~~~
>> drivers/usb/core/quirks.c:139:3: error: 'const struct kernel_param_ops' has no member named 'set'
     .set = quirks_param_set,
      ^~~
>> drivers/usb/core/quirks.c:139:9: warning: excess elements in struct initializer
     .set = quirks_param_set,
            ^~~~~~~~~~~~~~~~
   drivers/usb/core/quirks.c:139:9: note: (near initialization for 'quirks_param_ops')
>> drivers/usb/core/quirks.c:140:3: error: 'const struct kernel_param_ops' has no member named 'get'
     .get = param_get_string,
      ^~~
>> drivers/usb/core/quirks.c:140:9: error: 'param_get_string' undeclared here (not in a function); did you mean 'page_get_link'?
     .get = param_get_string,
            ^~~~~~~~~~~~~~~~
            page_get_link
   drivers/usb/core/quirks.c:140:9: warning: excess elements in struct initializer
   drivers/usb/core/quirks.c:140:9: note: (near initialization for 'quirks_param_ops')
>> drivers/usb/core/quirks.c:143:15: error: variable 'quirks_param_string' has initializer but incomplete type
    static struct kparam_string quirks_param_string = {
                  ^~~~~~~~~~~~~
>> drivers/usb/core/quirks.c:144:3: error: 'struct kparam_string' has no member named 'maxlen'
     .maxlen = sizeof(quirks_param),
      ^~~~~~
   drivers/usb/core/quirks.c:144:12: warning: excess elements in struct initializer
     .maxlen = sizeof(quirks_param),
               ^~~~~~
   drivers/usb/core/quirks.c:144:12: note: (near initialization for 'quirks_param_string')
>> drivers/usb/core/quirks.c:145:3: error: 'struct kparam_string' has no member named 'string'
     .string = quirks_param,
      ^~~~~~
   drivers/usb/core/quirks.c:145:12: warning: excess elements in struct initializer
     .string = quirks_param,
               ^~~~~~~~~~~~
   drivers/usb/core/quirks.c:145:12: note: (near initialization for 'quirks_param_string')
>> drivers/usb/core/quirks.c:148:25: error: expected ')' before '&' token
    module_param_cb(quirks, &quirks_param_ops, &quirks_param_string, 0644);
                            ^
>> drivers/usb/core/quirks.c:149:26: error: expected ')' before string constant
    MODULE_PARM_DESC(quirks, "Add/modify USB quirks by specifying quirks=vendorID:productID:quirks");
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/usb/core/quirks.c:138:38: error: storage size of 'quirks_param_ops' isn't known
    static const struct kernel_param_ops quirks_param_ops = {
                                         ^~~~~~~~~~~~~~~~
>> drivers/usb/core/quirks.c:143:29: error: storage size of 'quirks_param_string' isn't known
    static struct kparam_string quirks_param_string = {
                                ^~~~~~~~~~~~~~~~~~~
   drivers/usb/core/quirks.c:143:29: warning: 'quirks_param_string' defined but not used [-Wunused-variable]
   cc1: some warnings being treated as errors

vim +/param_set_copystring +135 drivers/usb/core/quirks.c

    26	
  > 27	static int quirks_param_set(const char *val, const struct kernel_param *kp)
    28	{
    29		char *p, *field;
    30		u16 vid, pid;
    31		u32 flags;
    32		size_t i;
    33	
    34		mutex_lock(&quirk_mutex);
    35	
    36		if (!val || !*val) {
    37			quirk_count = 0;
    38			kfree(quirk_list);
    39			quirk_list = NULL;
    40			goto unlock;
    41		}
    42	
    43		for (quirk_count = 1, i = 0; val[i]; i++)
    44			if (val[i] == ',')
    45				quirk_count++;
    46	
    47		if (quirk_list) {
    48			kfree(quirk_list);
    49			quirk_list = NULL;
    50		}
    51	
    52		quirk_list = kcalloc(quirk_count, sizeof(struct quirk_entry),
    53				     GFP_KERNEL);
    54		if (!quirk_list) {
    55			mutex_unlock(&quirk_mutex);
    56			return -ENOMEM;
    57		}
    58	
    59		for (i = 0, p = (char *)val; p && *p;) {
    60			/* Each entry consists of VID:PID:flags */
    61			field = strsep(&p, ":");
    62			if (!field)
    63				break;
    64	
    65			if (kstrtou16(field, 16, &vid))
    66				break;
    67	
    68			field = strsep(&p, ":");
    69			if (!field)
    70				break;
    71	
    72			if (kstrtou16(field, 16, &pid))
    73				break;
    74	
    75			field = strsep(&p, ",");
    76			if (!field || !*field)
    77				break;
    78	
    79			/* Collect the flags */
    80			for (flags = 0; *field; field++) {
    81				switch (*field) {
    82				case 'a':
    83					flags |= USB_QUIRK_STRING_FETCH_255;
    84					break;
    85				case 'b':
    86					flags |= USB_QUIRK_RESET_RESUME;
    87					break;
    88				case 'c':
    89					flags |= USB_QUIRK_NO_SET_INTF;
    90					break;
    91				case 'd':
    92					flags |= USB_QUIRK_CONFIG_INTF_STRINGS;
    93					break;
    94				case 'e':
    95					flags |= USB_QUIRK_RESET;
    96					break;
    97				case 'f':
    98					flags |= USB_QUIRK_HONOR_BNUMINTERFACES;
    99					break;
   100				case 'g':
   101					flags |= USB_QUIRK_DELAY_INIT;
   102					break;
   103				case 'h':
   104					flags |= USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL;
   105					break;
   106				case 'i':
   107					flags |= USB_QUIRK_DEVICE_QUALIFIER;
   108					break;
   109				case 'j':
   110					flags |= USB_QUIRK_IGNORE_REMOTE_WAKEUP;
   111					break;
   112				case 'k':
   113					flags |= USB_QUIRK_NO_LPM;
   114					break;
   115				case 'l':
   116					flags |= USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL;
   117					break;
   118				case 'm':
   119					flags |= USB_QUIRK_DISCONNECT_SUSPEND;
   120					break;
   121				/* Ignore unrecognized flag characters */
   122				}
   123			}
   124	
   125			quirk_list[i++] = (struct quirk_entry)
   126				{ .vid = vid, .pid = pid, .flags = flags };
   127		}
   128	
   129		if (i < quirk_count)
   130			quirk_count = i;
   131	
   132	unlock:
   133		mutex_unlock(&quirk_mutex);
   134	
 > 135		return param_set_copystring(val, kp);
   136	}
   137	
 > 138	static const struct kernel_param_ops quirks_param_ops = {
 > 139		.set = quirks_param_set,
 > 140		.get = param_get_string,
   141	};
   142	
 > 143	static struct kparam_string quirks_param_string = {
 > 144		.maxlen = sizeof(quirks_param),
 > 145		.string = quirks_param,
   146	};
   147	
 > 148	module_param_cb(quirks, &quirks_param_ops, &quirks_param_string, 0644);
 > 149	MODULE_PARM_DESC(quirks, "Add/modify USB quirks by specifying quirks=vendorID:productID:quirks");
   150	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux