lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202210290349.6tfFM0Il-lkp@intel.com>
Date:   Sat, 29 Oct 2022 03:43:39 +0800
From:   kernel test robot <lkp@...el.com>
To:     Yinbo Zhu <zhuyinbo@...ngson.cn>,
        "Rafael J . Wysocki" <rafael@...nel.org>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Amit Kucheria <amitk@...nel.org>,
        Zhang Rui <rui.zhang@...el.com>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        linux-pm@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        zhanghongchen <zhanghongchen@...ngson.cn>,
        Liu Peibao <liupeibao@...ngson.cn>,
        Yinbo Zhu <zhuyinbo@...ngson.cn>
Subject: Re: [PATCH v8 1/2] thermal: loongson-2: add thermal management
 support

Hi Yinbo,

I love your patch! Yet something to improve:

[auto build test ERROR on rafael-pm/thermal]
[also build test ERROR on linus/master v6.1-rc2 next-20221028]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Yinbo-Zhu/thermal-loongson-2-add-thermal-management-support/20221028-093603
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal
patch link:    https://lore.kernel.org/r/20221028013532.10361-1-zhuyinbo%40loongson.cn
patch subject: [PATCH v8 1/2] thermal: loongson-2: add thermal management support
config: i386-randconfig-a002
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/d94e01f4aefe4c0ab05babe101f0a0ce53165456
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Yinbo-Zhu/thermal-loongson-2-add-thermal-management-support/20221028-093603
        git checkout d94e01f4aefe4c0ab05babe101f0a0ce53165456
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

>> drivers/thermal/loongson2_thermal.c:136:48: error: variable has incomplete type 'const struct thermal_zone_of_device_ops'
   static const struct thermal_zone_of_device_ops loongson2_of_thermal_ops = {
                                                  ^
   drivers/thermal/loongson2_thermal.c:136:21: note: forward declaration of 'struct thermal_zone_of_device_ops'
   static const struct thermal_zone_of_device_ops loongson2_of_thermal_ops = {
                       ^
>> drivers/thermal/loongson2_thermal.c:177:14: error: implicit declaration of function 'devm_thermal_zone_of_sensor_register' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           data->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev,
                       ^
   drivers/thermal/loongson2_thermal.c:177:14: note: did you mean 'devm_thermal_of_zone_register'?
   include/linux/thermal.h:320:29: note: 'devm_thermal_of_zone_register' declared here
   struct thermal_zone_device *devm_thermal_of_zone_register(struct device *dev, int id, void *data,
                               ^
   2 errors generated.


vim +136 drivers/thermal/loongson2_thermal.c

   135	
 > 136	static const struct thermal_zone_of_device_ops loongson2_of_thermal_ops = {
   137		.get_temp = loongson2_thermal_get_temp,
   138		.set_trips = loongson2_thermal_set_trips,
   139	};
   140	
   141	static int loongson2_thermal_probe(struct platform_device *pdev)
   142	{
   143		struct device *dev = &pdev->dev;
   144		struct resource *res;
   145		struct loongson2_thermal_data *data;
   146		int ret;
   147	
   148		data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
   149		if (!data)
   150			return -ENOMEM;
   151	
   152		data->pdev = pdev;
   153		platform_set_drvdata(pdev, data);
   154	
   155		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   156		data->regs = devm_ioremap(dev, res->start, resource_size(res));
   157		if (IS_ERR(data->regs))
   158			return PTR_ERR(data->regs);
   159	
   160		/* get irq */
   161		data->irq = platform_get_irq(pdev, 0);
   162		if (data->irq < 0)
   163			return data->irq;
   164	
   165		/* get id */
   166		data->id = loongson2_thermal_get_sensor_id();
   167		if (data->id > LOONGSON2_SOC_MAX_SENSOR_NUM - 1 || data->id < 0) {
   168			dev_err(dev, "sensor id error,must be in <0 ~ %d>\n",
   169					LOONGSON2_SOC_MAX_SENSOR_NUM - 1);
   170			return -EINVAL;
   171		}
   172	
   173		writeb(0xff, data->regs + LOONGSON2_TSENSOR_STATUS);
   174	
   175		loongson2_thermal_set(data, 0, 0, false);
   176	
 > 177		data->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev,
   178								   data->id, data,
   179								   &loongson2_of_thermal_ops);
   180		if (IS_ERR(data->tzd)) {
   181			ret = PTR_ERR(data->tzd);
   182			data->tzd = NULL;
   183			dev_err(&pdev->dev, "failed to register %d\n", ret);
   184			return ret;
   185		}
   186	
   187		ret = devm_request_threaded_irq(dev, data->irq,
   188				loongson2_thermal_alarm_irq, loongson2_thermal_irq_thread,
   189				IRQF_ONESHOT, "loongson2_thermal", data);
   190		if (ret < 0) {
   191			dev_err(dev, "failed to request alarm irq: %d\n", ret);
   192			return ret;
   193		}
   194	
   195		/*
   196		 * Thermal_zone doesn't enable hwmon as default,
   197		 * enable it here
   198		 */
   199		data->tzd->tzp->no_hwmon = false;
   200		ret = thermal_add_hwmon_sysfs(data->tzd);
   201		if (ret) {
   202			dev_err(dev, "failed to add hwmon sysfs interface %d\n", ret);
   203			return ret;
   204		}
   205	
   206		return 0;
   207	}
   208	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (167646 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ