Re: [PATCH v1 4/5] platform/x86: ayaneo-ec: Add controller power and modules attributes

From: kernel test robot
Date: Thu Aug 21 2025 - 04:46:52 EST


Hi Antheas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on c17b750b3ad9f45f2b6f7e6f7f4679844244f0b9]

url: https://github.com/intel-lab-lkp/linux/commits/Antheas-Kapenekakis/platform-x86-ayaneo-ec-Add-Ayaneo-Embedded-Controller-platform-driver/20250821-002525
base: c17b750b3ad9f45f2b6f7e6f7f4679844244f0b9
patch link: https://lore.kernel.org/r/20250820160628.99678-5-lkml%40antheas.dev
patch subject: [PATCH v1 4/5] platform/x86: ayaneo-ec: Add controller power and modules attributes
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20250821/202508211640.8MtPueLL-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250821/202508211640.8MtPueLL-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508211640.8MtPueLL-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/platform/x86/ayaneo-ec.c:395:12: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
395 | else if (sysfs_streq(buf, "off"))
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/platform/x86/ayaneo-ec.c:397:7: note: uninitialized use occurs here
397 | if (ret)
| ^~~
drivers/platform/x86/ayaneo-ec.c:395:8: note: remove the 'if' if its condition is always true
395 | else if (sysfs_streq(buf, "off"))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
396 | ret = ec_write(AYANEO_POWER_REG, AYANEO_POWER_OFF);
drivers/platform/x86/ayaneo-ec.c:389:9: note: initialize the variable 'ret' to silence this warning
389 | int ret;
| ^
| = 0
1 warning generated.


vim +395 drivers/platform/x86/ayaneo-ec.c

382
383 static ssize_t current_value_store(struct kobject *kobj,
384 struct kobj_attribute *attr, const char *buf,
385 size_t count)
386 {
387 struct ayaneo_fw_attr *fw_attr =
388 container_of(attr, struct ayaneo_fw_attr, current_value);
389 int ret;
390
391 switch (fw_attr->fw_attr_id) {
392 case AYANEO_ATTR_CONTROLLER_POWER:
393 if (sysfs_streq(buf, "on"))
394 ret = ec_write(AYANEO_POWER_REG, AYANEO_POWER_ON);
> 395 else if (sysfs_streq(buf, "off"))
396 ret = ec_write(AYANEO_POWER_REG, AYANEO_POWER_OFF);
397 if (ret)
398 return ret;
399 return count;
400 case AYANEO_ATTR_CONTROLLER_MODULES:
401 return -EINVAL;
402 }
403 return -EINVAL;
404 }
405

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki