All of lore.kernel.org
 help / color / mirror / Atom feed
* [plbossart-sound:sdw/sysfs-support2 3/3] drivers/soundwire/sysfs_slave_dpn.c:34:13: warning: incompatible implicit declaration of built-in function 'strdup'
@ 2020-05-07  3:00 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-05-07  3:00 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 10434 bytes --]

tree:   https://github.com/plbossart/sound sdw/sysfs-support2
head:   3e03b2e737474483350aa87c35a3c7d0023a78f4
commit: 3e03b2e737474483350aa87c35a3c7d0023a78f4 [3/3] soundwire: add macros for dpN sysfs support
config: microblaze-randconfig-a001-20200507 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.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 3e03b2e737474483350aa87c35a3c7d0023a78f4
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=microblaze 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/soundwire/sysfs_slave_dpn.c:27:13: warning: 'struct slave' declared inside parameter list will not be visible outside of this definition or declaration
      27 |      struct slave **slv)
         |             ^~~~~
   drivers/soundwire/sysfs_slave_dpn.c: In function 'get_port_N_dir':
   drivers/soundwire/sysfs_slave_dpn.c:34:13: error: implicit declaration of function 'strdup' [-Werror=implicit-function-declaration]
      34 |  filename = strdup(kobj->name);
         |             ^~~~~~
>> drivers/soundwire/sysfs_slave_dpn.c:34:13: warning: incompatible implicit declaration of built-in function 'strdup'
   drivers/soundwire/sysfs_slave_dpn.c:38:2: error: 'token' undeclared (first use in this function); did you mean 'to_kset'?
      38 |  token = filename;
         |  ^~~~~
         |  to_kset
   drivers/soundwire/sysfs_slave_dpn.c:38:2: note: each undeclared identifier is reported only once for each function it appears in
   drivers/soundwire/sysfs_slave_dpn.c:39:2: error: 'end' undeclared (first use in this function)
      39 |  end = filename;
         |  ^~~
   drivers/soundwire/sysfs_slave_dpn.c:70:7: error: assignment to 'struct slave *' from incompatible pointer type 'struct sdw_slave *' [-Werror=incompatible-pointer-types]
      70 |  *slv = dev_to_sdw_dev(dev);
         |       ^
   drivers/soundwire/sysfs_slave_dpn.c:73:2: error: implicit declaration of function 'free' [-Werror=implicit-function-declaration]
      73 |  free(filename);
         |  ^~~~
>> drivers/soundwire/sysfs_slave_dpn.c:73:2: warning: incompatible implicit declaration of built-in function 'free'
   drivers/soundwire/sysfs_slave_dpn.c:12:1: note: include '<stdlib.h>' or provide a declaration of 'free'
      11 | #include "sysfs_local.h"
     +++ |+#include <stdlib.h>
      12 | 
   drivers/soundwire/sysfs_slave_dpn.c: In function 'dpn_attr_show':
   drivers/soundwire/sysfs_slave_dpn.c:88:2: error: 'ret' undeclared (first use in this function)
      88 |  ret = get_port_N_dir(kobj, &N, &dir, &codec);
         |  ^~~
   drivers/soundwire/sysfs_slave_dpn.c:88:40: error: 'codec' undeclared (first use in this function)
      88 |  ret = get_port_N_dir(kobj, &N, &dir, &codec);
         |                                        ^~~~~
   drivers/soundwire/sysfs_slave_dpn.c:91:24: error: passing argument 1 of 'dpn_attr->show' from incompatible pointer type [-Werror=incompatible-pointer-types]
      91 |  return dpn_attr->show(slave, N, dir, dpn_attr, buf);
         |                        ^~~~~
         |                        |
         |                        struct slave *
   drivers/soundwire/sysfs_slave_dpn.c:91:24: note: expected 'struct device *' but argument is of type 'struct slave *'
   drivers/soundwire/sysfs_slave_dpn.c: At top level:
   drivers/soundwire/sysfs_slave_dpn.c:111:27: warning: 'struct slave' declared inside parameter list will not be visible outside of this definition or declaration
     111 | dpn_##field##_show(struct slave *slave,     \
         |                           ^~~~~
   drivers/soundwire/sysfs_slave_dpn.c:143:1: note: in expansion of macro 'sdw_dpn_attr'
     143 | sdw_dpn_attr(max_word, "%d\n");
         | ^~~~~~~~~~~~
   drivers/soundwire/sysfs_slave_dpn.c: In function 'dpn_max_word_show':
   drivers/soundwire/sysfs_slave_dpn.c:124:14: error: dereferencing pointer to incomplete type 'struct slave'
     124 |   dpn = slave->prop.src_dpn_prop;    \
         |              ^~
   drivers/soundwire/sysfs_slave_dpn.c:143:1: note: in expansion of macro 'sdw_dpn_attr'
     143 | sdw_dpn_attr(max_word, "%d\n");
         | ^~~~~~~~~~~~
   In file included from include/linux/kobject.h:20,
                    from include/linux/device.h:17,
                    from drivers/soundwire/sysfs_slave_dpn.c:4:
   drivers/soundwire/sysfs_slave_dpn.c: At top level:
   drivers/soundwire/sysfs_slave_dpn.c:141:59: error: '_field_show' undeclared here (not in a function)
     141 | static struct dpn_attribute dpn_attr_##_field = __ATTR_RO(_field);
         |                                                           ^~~~~~
   include/linux/sysfs.h:117:10: note: in definition of macro '__ATTR_RO'
     117 |  .show = _name##_show,      \
         |          ^~~~~
   drivers/soundwire/sysfs_slave_dpn.c:143:1: note: in expansion of macro 'sdw_dpn_attr'
     143 | sdw_dpn_attr(max_word, "%d\n");
         | ^~~~~~~~~~~~
   drivers/soundwire/sysfs_slave_dpn.c:111:27: warning: 'struct slave' declared inside parameter list will not be visible outside of this definition or declaration
     111 | dpn_##field##_show(struct slave *slave,     \
         |                           ^~~~~
   drivers/soundwire/sysfs_slave_dpn.c:144:1: note: in expansion of macro 'sdw_dpn_attr'
     144 | sdw_dpn_attr(min_word, "%d\n");
         | ^~~~~~~~~~~~
   drivers/soundwire/sysfs_slave_dpn.c: In function 'dpn_min_word_show':
   drivers/soundwire/sysfs_slave_dpn.c:124:14: error: dereferencing pointer to incomplete type 'struct slave'
     124 |   dpn = slave->prop.src_dpn_prop;    \
         |              ^~
   drivers/soundwire/sysfs_slave_dpn.c:144:1: note: in expansion of macro 'sdw_dpn_attr'
     144 | sdw_dpn_attr(min_word, "%d\n");
         | ^~~~~~~~~~~~
   drivers/soundwire/sysfs_slave_dpn.c: At top level:
   drivers/soundwire/sysfs_slave_dpn.c:141:29: error: redefinition of 'dpn_attr__field'
     141 | static struct dpn_attribute dpn_attr_##_field = __ATTR_RO(_field);
         |                             ^~~~~~~~~
   drivers/soundwire/sysfs_slave_dpn.c:144:1: note: in expansion of macro 'sdw_dpn_attr'
     144 | sdw_dpn_attr(min_word, "%d\n");
         | ^~~~~~~~~~~~
   drivers/soundwire/sysfs_slave_dpn.c:141:29: note: previous definition of 'dpn_attr__field' was here
     141 | static struct dpn_attribute dpn_attr_##_field = __ATTR_RO(_field);
         |                             ^~~~~~~~~
   drivers/soundwire/sysfs_slave_dpn.c:143:1: note: in expansion of macro 'sdw_dpn_attr'
     143 | sdw_dpn_attr(max_word, "%d\n");
         | ^~~~~~~~~~~~
   drivers/soundwire/sysfs_slave_dpn.c:111:27: warning: 'struct slave' declared inside parameter list will not be visible outside of this definition or declaration
     111 | dpn_##field##_show(struct slave *slave,     \
         |                           ^~~~~
   drivers/soundwire/sysfs_slave_dpn.c:145:1: note: in expansion of macro 'sdw_dpn_attr'
     145 | sdw_dpn_attr(max_grouping, "%d\n");
         | ^~~~~~~~~~~~
   drivers/soundwire/sysfs_slave_dpn.c: In function 'dpn_max_grouping_show':
   drivers/soundwire/sysfs_slave_dpn.c:124:14: error: dereferencing pointer to incomplete type 'struct slave'
     124 |   dpn = slave->prop.src_dpn_prop;    \
         |              ^~
   drivers/soundwire/sysfs_slave_dpn.c:145:1: note: in expansion of macro 'sdw_dpn_attr'
     145 | sdw_dpn_attr(max_grouping, "%d\n");
         | ^~~~~~~~~~~~
   drivers/soundwire/sysfs_slave_dpn.c: At top level:
   drivers/soundwire/sysfs_slave_dpn.c:141:29: error: redefinition of 'dpn_attr__field'
     141 | static struct dpn_attribute dpn_attr_##_field = __ATTR_RO(_field);
         |                             ^~~~~~~~~
   drivers/soundwire/sysfs_slave_dpn.c:145:1: note: in expansion of macro 'sdw_dpn_attr'
     145 | sdw_dpn_attr(max_grouping, "%d\n");
         | ^~~~~~~~~~~~
   drivers/soundwire/sysfs_slave_dpn.c:141:29: note: previous definition of 'dpn_attr__field' was here
     141 | static struct dpn_attribute dpn_attr_##_field = __ATTR_RO(_field);
         |                             ^~~~~~~~~
   drivers/soundwire/sysfs_slave_dpn.c:144:1: note: in expansion of macro 'sdw_dpn_attr'
     144 | sdw_dpn_attr(min_word, "%d\n");
         | ^~~~~~~~~~~~
   drivers/soundwire/sysfs_slave_dpn.c:111:27: warning: 'struct slave' declared inside parameter list will not be visible outside of this definition or declaration
     111 | dpn_##field##_show(struct slave *slave,     \
         |                           ^~~~~
   drivers/soundwire/sysfs_slave_dpn.c:146:1: note: in expansion of macro 'sdw_dpn_attr'

vim +/strdup +34 drivers/soundwire/sysfs_slave_dpn.c

    25	
    26	static int get_port_N_dir(struct kobject *kobj, int *N, int *dir,
    27				  struct slave **slv)
    28	{
    29		struct device *dev = kobj_to_dev(kobj->parent->parent);
    30		char *filename;
    31		ssize_t ret;
    32	
    33		/* the filename is dp:<N>:<sink/src> */
  > 34		filename = strdup(kobj->name);
    35		if (!filename)
    36			return -ENOMEM;
    37	
    38		token = filename;
    39		end = filename;
    40	
    41		/* skip dp */
    42		token = strsep(&filename, ":");
    43		if (!token) {
    44			ret = -EINVAL;
    45			goto err;
    46		}
    47	
    48		/* extract N */
    49		token = strsep(&filename, ":");
    50		if (!token) {
    51			ret = -EINVAL;
    52			goto err;
    53		}
    54	
    55		ret = kstrtoint(token, 10, N);
    56		if (ret < 0)
    57			goto err;
    58	
    59		/* extract direction */
    60		token = strsep(&filename, ":");
    61		if (!token) {
    62			ret = -EINVAL;
    63			goto err;
    64		}
    65		if (!strcmp(token, "sink"))
    66			*dir = 0;
    67		else
    68			*dir = 1;
    69	
    70		*slv = dev_to_sdw_dev(dev);
    71	
    72	err:
  > 73		free(filename);
    74		return ret;
    75	}
    76	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 24197 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-07  3:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07  3:00 [plbossart-sound:sdw/sysfs-support2 3/3] drivers/soundwire/sysfs_slave_dpn.c:34:13: warning: incompatible implicit declaration of built-in function 'strdup' kbuild test robot

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.