Re: [PATCH v6 6/7] power: supply: max77705: Add fuel gauge driver for Maxim 77705

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

 



Hi Dzmitry,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 58ca61c1a866bfdaa5e19fb19a2416764f847d75]

url:    https://github.com/intel-lab-lkp/linux/commits/Dzmitry-Sankouski/power-supply-add-undervoltage-health-status-property/20241008-000014
base:   58ca61c1a866bfdaa5e19fb19a2416764f847d75
patch link:    https://lore.kernel.org/r/20241007-starqltechn_integration_upstream-v6-6-0d38b5090c57%40gmail.com
patch subject: [PATCH v6 6/7] power: supply: max77705: Add fuel gauge driver for Maxim 77705
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20241011/202410110404.etzjIhE5-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241011/202410110404.etzjIhE5-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/202410110404.etzjIhE5-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/power/supply/max77705_fuel_gauge.c:220:7: warning: variable 'ret' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
     220 |         case POWER_SUPPLY_PROP_MANUFACTURER:
         |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/max77705_fuel_gauge.c:227:6: note: uninitialized use occurs here
     227 |         if (ret)
         |             ^~~
   drivers/power/supply/max77705_fuel_gauge.c:217:7: warning: variable 'ret' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
     217 |         case POWER_SUPPLY_PROP_MODEL_NAME:
         |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/power/supply/max77705_fuel_gauge.c:227:6: note: uninitialized use occurs here
     227 |         if (ret)
         |             ^~~
   drivers/power/supply/max77705_fuel_gauge.c:169:9: note: initialize the variable 'ret' to silence this warning
     169 |         int ret;
         |                ^
         |                 = 0
   2 warnings generated.

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for MODVERSIONS
   Depends on [n]: MODULES [=y] && !COMPILE_TEST [=y]
   Selected by [y]:
   - RANDSTRUCT_FULL [=y] && (CC_HAS_RANDSTRUCT [=y] || GCC_PLUGINS [=n]) && MODULES [=y]


vim +/ret +220 drivers/power/supply/max77705_fuel_gauge.c

   162	
   163	static int max77705_fg_get_property(struct power_supply *psy,
   164					    enum power_supply_property psp,
   165					    union power_supply_propval *val)
   166	{
   167		struct max77705_fuelgauge_data *fuelgauge =
   168		    power_supply_get_drvdata(psy);
   169		int ret;
   170	
   171		switch (psp) {
   172		case POWER_SUPPLY_PROP_STATUS:
   173			ret = max77705_battery_get_status(fuelgauge, &val->intval);
   174			break;
   175		case POWER_SUPPLY_PROP_PRESENT:
   176			ret = max77705_fg_check_battery_present(fuelgauge, &val->intval);
   177			break;
   178		case POWER_SUPPLY_PROP_VOLTAGE_NOW:
   179			ret = max77705_fg_read_reg(fuelgauge, VCELL_REG, &val->intval);
   180			break;
   181		case POWER_SUPPLY_PROP_VOLTAGE_OCV:
   182			ret = max77705_fg_read_reg(fuelgauge, VFOCV_REG, &val->intval);
   183			break;
   184		case POWER_SUPPLY_PROP_VOLTAGE_AVG:
   185			ret = max77705_fg_read_reg(fuelgauge, AVR_VCELL_REG, &val->intval);
   186			break;
   187		case POWER_SUPPLY_PROP_CURRENT_NOW:
   188			ret = max77705_fg_read_reg(fuelgauge, CURRENT_REG, &val->intval);
   189			break;
   190		case POWER_SUPPLY_PROP_CURRENT_AVG:
   191			ret = max77705_fg_read_reg(fuelgauge, AVG_CURRENT_REG, &val->intval);
   192			break;
   193		case POWER_SUPPLY_PROP_CHARGE_NOW:
   194			ret = max77705_fg_read_reg(fuelgauge, REMCAP_REP_REG, &val->intval);
   195			break;
   196		case POWER_SUPPLY_PROP_CHARGE_FULL:
   197			ret = max77705_fg_read_reg(fuelgauge, FULLCAP_REP_REG, &val->intval);
   198			break;
   199		case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
   200			ret = max77705_fg_read_reg(fuelgauge, DESIGNCAP_REG, &val->intval);
   201			break;
   202		case POWER_SUPPLY_PROP_CAPACITY:
   203			ret = max77705_fg_read_reg(fuelgauge, SOCREP_REG, &val->intval);
   204			break;
   205		case POWER_SUPPLY_PROP_TEMP:
   206			ret = max77705_fg_read_temp(fuelgauge, &val->intval);
   207			break;
   208		case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW:
   209			ret = max77705_fg_read_reg(fuelgauge, TIME_TO_EMPTY_REG, &val->intval);
   210			break;
   211		case POWER_SUPPLY_PROP_TIME_TO_FULL_NOW:
   212			ret = max77705_fg_read_reg(fuelgauge, TIME_TO_FULL_REG, &val->intval);
   213			break;
   214		case POWER_SUPPLY_PROP_CYCLE_COUNT:
   215			ret = max77705_fg_read_reg(fuelgauge, CYCLES_REG, &val->intval);
   216			break;
   217		case POWER_SUPPLY_PROP_MODEL_NAME:
   218			val->strval = max77705_fuelgauge_model;
   219			break;
 > 220		case POWER_SUPPLY_PROP_MANUFACTURER:
   221			val->strval = max77705_fuelgauge_manufacturer;
   222			break;
   223		default:
   224			return -EINVAL;
   225		}
   226	
   227		if (ret)
   228			return ret;
   229	
   230		max77705_unit_adjustment(fuelgauge, psp, val);
   231	
   232		return 0;
   233	}
   234	

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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux