[soc-thermal:for-kernelci 37/79] drivers/thermal/thermal_sysfs.c:596:12: error: static declaration of 'thermal_zone_create_device_groups' follows non-static declaration

From: kbuild test robot <hidden>
Date: 2016-10-10 16:20:22

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal.git for-kernelci
head:   6eb525fbac3341918ec0e81f2e2c70cedcd26059
commit: 2add47fde8a0c1a3638826e64e9b261d87454175 [37/79] thermal: core: move thermal_zone sysfs to thermal_sysfs.c
config: x86_64-randconfig-x014-201641 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout 2add47fde8a0c1a3638826e64e9b261d87454175
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: the soc-thermal/for-kernelci HEAD 6eb525fbac3341918ec0e81f2e2c70cedcd26059 builds fine.
      It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):
quoted
drivers/thermal/thermal_sysfs.c:596:12: error: static declaration of 'thermal_zone_create_device_groups' follows non-static declaration
    static int thermal_zone_create_device_groups(struct thermal_zone_device *tz,
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/thermal/thermal_sysfs.c:24:0:
   drivers/thermal/thermal_core.h:70:5: note: previous declaration of 'thermal_zone_create_device_groups' was here
    int thermal_zone_create_device_groups(struct thermal_zone_device *, int);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/thermal/thermal_sysfs.c:596:12: warning: 'thermal_zone_create_device_groups' defined but not used [-Wunused-function]
    static int thermal_zone_create_device_groups(struct thermal_zone_device *tz,
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/thermal/thermal_sysfs.c:19:0:
   include/linux/device.h:575:26: warning: 'dev_attr_emul_temp' defined but not used [-Wunused-variable]
     struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
                             ^
quoted
drivers/thermal/thermal_sysfs.c:398:8: note: in expansion of macro 'DEVICE_ATTR'
    static DEVICE_ATTR(emul_temp, S_IWUSR, NULL, emul_temp_store);
           ^~~~~~~~~~~

vim +/thermal_zone_create_device_groups +596 drivers/thermal/thermal_sysfs.c

   392	 * These are thermal zone device attributes that will always be present.
   393	 * All the attributes created for tzp (create_s32_tzp_attr) also are always
   394	 * present on the sysfs interface.
   395	 */
   396	static DEVICE_ATTR(type, 0444, type_show, NULL);
   397	static DEVICE_ATTR(temp, 0444, temp_show, NULL);
 > 398	static DEVICE_ATTR(emul_temp, S_IWUSR, NULL, emul_temp_store);
   399	static DEVICE_ATTR(policy, S_IRUGO | S_IWUSR, policy_show, policy_store);
   400	static DEVICE_ATTR(available_policies, S_IRUGO, available_policies_show, NULL);
   401	static DEVICE_ATTR(sustainable_power, S_IWUSR | S_IRUGO, sustainable_power_show,
   402			   sustainable_power_store);
   403	
   404	/* These thermal zone device attributes are created based on conditions */
   405	static DEVICE_ATTR(mode, 0644, mode_show, mode_store);
   406	static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, passive_store);
   407	
   408	/* These attributes are unconditionally added to a thermal zone */
   409	static struct attribute *thermal_zone_dev_attrs[] = {
   410		&dev_attr_type.attr,
   411		&dev_attr_temp.attr,
   412	#if (IS_ENABLED(CONFIG_THERMAL_EMULATION))
   413		&dev_attr_emul_temp.attr,
   414	#endif
   415		&dev_attr_policy.attr,
   416		&dev_attr_available_policies.attr,
   417		&dev_attr_sustainable_power.attr,
   418		&dev_attr_k_po.attr,
   419		&dev_attr_k_pu.attr,
   420		&dev_attr_k_i.attr,
   421		&dev_attr_k_d.attr,
   422		&dev_attr_integral_cutoff.attr,
   423		&dev_attr_slope.attr,
   424		&dev_attr_offset.attr,
   425		NULL,
   426	};
   427	
   428	static struct attribute_group thermal_zone_attribute_group = {
   429		.attrs = thermal_zone_dev_attrs,
   430	};
   431	
   432	/* We expose mode only if .get_mode is present */
   433	static struct attribute *thermal_zone_mode_attrs[] = {
   434		&dev_attr_mode.attr,
   435		NULL,
   436	};
   437	
   438	static umode_t thermal_zone_mode_is_visible(struct kobject *kobj,
   439						    struct attribute *attr,
   440						    int attrno)
   441	{
   442		struct device *dev = container_of(kobj, struct device, kobj);
   443		struct thermal_zone_device *tz;
   444	
   445		tz = container_of(dev, struct thermal_zone_device, device);
   446	
   447		if (tz->ops->get_mode)
   448			return attr->mode;
   449	
   450		return 0;
   451	}
   452	
   453	static struct attribute_group thermal_zone_mode_attribute_group = {
   454		.attrs = thermal_zone_mode_attrs,
   455		.is_visible = thermal_zone_mode_is_visible,
   456	};
   457	
   458	/* We expose passive only if passive trips are present */
   459	static struct attribute *thermal_zone_passive_attrs[] = {
   460		&dev_attr_passive.attr,
   461		NULL,
   462	};
   463	
   464	static umode_t thermal_zone_passive_is_visible(struct kobject *kobj,
   465						       struct attribute *attr,
   466						       int attrno)
   467	{
   468		struct device *dev = container_of(kobj, struct device, kobj);
   469		struct thermal_zone_device *tz;
   470		enum thermal_trip_type trip_type;
   471		int count;
   472	
   473		tz = container_of(dev, struct thermal_zone_device, device);
   474	
   475		for (count = 0; count < tz->trips; count++) {
   476			tz->ops->get_trip_type(tz, count, &trip_type);
   477	
   478			if (trip_type == THERMAL_TRIP_PASSIVE)
   479				return attr->mode;
   480		}
   481	
   482		return 0;
   483	}
   484	
   485	static struct attribute_group thermal_zone_passive_attribute_group = {
   486		.attrs = thermal_zone_passive_attrs,
   487		.is_visible = thermal_zone_passive_is_visible,
   488	};
   489	
   490	static const struct attribute_group *thermal_zone_attribute_groups[] = {
   491		&thermal_zone_attribute_group,
   492		&thermal_zone_mode_attribute_group,
   493		&thermal_zone_passive_attribute_group,
   494		/* This is not NULL terminated as we create the group dynamically */
   495	};
   496	
   497	/**
   498	 * create_trip_attrs() - create attributes for trip points
   499	 * @tz:		the thermal zone device
   500	 * @mask:	Writeable trip point bitmap.
   501	 *
   502	 * helper function to instantiate sysfs entries for every trip
   503	 * point and its properties of a struct thermal_zone_device.
   504	 *
   505	 * Return: 0 on success, the proper error value otherwise.
   506	 */
   507	static int create_trip_attrs(struct thermal_zone_device *tz, int mask)
   508	{
   509		int size = sizeof(struct thermal_attr) * tz->trips;
   510		struct attribute **attrs;
   511		int indx;
   512	
   513		tz->trip_type_attrs = kzalloc(size, GFP_KERNEL);
   514		if (!tz->trip_type_attrs)
   515			return -ENOMEM;
   516	
   517		tz->trip_temp_attrs = kzalloc(size, GFP_KERNEL);
   518		if (!tz->trip_temp_attrs) {
   519			kfree(tz->trip_type_attrs);
   520			return -ENOMEM;
   521		}
   522	
   523		if (tz->ops->get_trip_hyst) {
   524			tz->trip_hyst_attrs = kzalloc(size, GFP_KERNEL);
   525			if (!tz->trip_hyst_attrs) {
   526				kfree(tz->trip_type_attrs);
   527				kfree(tz->trip_temp_attrs);
   528				return -ENOMEM;
   529			}
   530		}
   531	
   532		attrs = kzalloc(sizeof(*attrs) * tz->trips * 3 + 1, GFP_KERNEL);
   533		if (!attrs) {
   534			kfree(tz->trip_type_attrs);
   535			kfree(tz->trip_temp_attrs);
   536			if (tz->ops->get_trip_hyst)
   537				kfree(tz->trip_hyst_attrs);
   538			return -ENOMEM;
   539		}
   540	
   541		for (indx = 0; indx < tz->trips; indx++) {
   542			/* create trip type attribute */
   543			snprintf(tz->trip_type_attrs[indx].name, THERMAL_NAME_LENGTH,
   544				 "trip_point_%d_type", indx);
   545	
   546			sysfs_attr_init(&tz->trip_type_attrs[indx].attr.attr);
   547			tz->trip_type_attrs[indx].attr.attr.name =
   548							tz->trip_type_attrs[indx].name;
   549			tz->trip_type_attrs[indx].attr.attr.mode = S_IRUGO;
   550			tz->trip_type_attrs[indx].attr.show = trip_point_type_show;
   551			attrs[indx] = &tz->trip_type_attrs[indx].attr.attr;
   552	
   553			/* create trip temp attribute */
   554			snprintf(tz->trip_temp_attrs[indx].name, THERMAL_NAME_LENGTH,
   555				 "trip_point_%d_temp", indx);
   556	
   557			sysfs_attr_init(&tz->trip_temp_attrs[indx].attr.attr);
   558			tz->trip_temp_attrs[indx].attr.attr.name =
   559							tz->trip_temp_attrs[indx].name;
   560			tz->trip_temp_attrs[indx].attr.attr.mode = S_IRUGO;
   561			tz->trip_temp_attrs[indx].attr.show = trip_point_temp_show;
   562			if (IS_ENABLED(CONFIG_THERMAL_WRITABLE_TRIPS) &&
   563			    mask & (1 << indx)) {
   564				tz->trip_temp_attrs[indx].attr.attr.mode |= S_IWUSR;
   565				tz->trip_temp_attrs[indx].attr.store =
   566								trip_point_temp_store;
   567			}
   568			attrs[indx + tz->trips] = &tz->trip_temp_attrs[indx].attr.attr;
   569	
   570			/* create Optional trip hyst attribute */
   571			if (!tz->ops->get_trip_hyst)
   572				continue;
   573			snprintf(tz->trip_hyst_attrs[indx].name, THERMAL_NAME_LENGTH,
   574				 "trip_point_%d_hyst", indx);
   575	
   576			sysfs_attr_init(&tz->trip_hyst_attrs[indx].attr.attr);
   577			tz->trip_hyst_attrs[indx].attr.attr.name =
   578						tz->trip_hyst_attrs[indx].name;
   579			tz->trip_hyst_attrs[indx].attr.attr.mode = S_IRUGO;
   580			tz->trip_hyst_attrs[indx].attr.show = trip_point_hyst_show;
   581			if (tz->ops->set_trip_hyst) {
   582				tz->trip_hyst_attrs[indx].attr.attr.mode |= S_IWUSR;
   583				tz->trip_hyst_attrs[indx].attr.store =
   584						trip_point_hyst_store;
   585			}
   586			attrs[indx + tz->trips * 2] =
   587						&tz->trip_hyst_attrs[indx].attr.attr;
   588		}
   589		attrs[tz->trips * 3] = NULL;
   590	
   591		tz->trips_attribute_group.attrs = attrs;
   592	
   593		return 0;
   594	}
   595	
 > 596	static int thermal_zone_create_device_groups(struct thermal_zone_device *tz,
   597						     int mask)
   598	{
   599		const struct attribute_group **groups;

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

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help