Re: [PATCH v3 16/16] power: supply: olpc_battery: Add OLPC XO 1.75 support

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

 



Hi Lubomir,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.0-rc1 next-20190108]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Lubomir-Rintel/Add-support-for-OLPC-XO-1-75-Embedded-Controller/20190108-114514
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

>> arch/x86/platform/olpc/olpc.c:325:1: warning: 'postcore_initcall()' has implicit return type
>> arch/x86/platform/olpc/olpc.c:30:24: warning: symbol 'olpc_platform_info' was not declared. Should it be static?
>> arch/x86/platform/olpc/olpc.c:294:14: error: undefined identifier 'olpc_ofw_present'
>> arch/x86/platform/olpc/olpc.c:298:43: error: undefined identifier 'olpc_board_pre'
>> arch/x86/platform/olpc/olpc.c:299:17: error: undefined identifier 'olpc_ec_driver_register'
   arch/x86/platform/olpc/olpc.c:301:17: error: undefined identifier 'olpc_ec_driver_register'
>> arch/x86/platform/olpc/olpc.c:305:13: error: undefined identifier 'olpc_board_at_least'
   arch/x86/platform/olpc/olpc.c:316:43: error: undefined identifier 'olpc_board_pre'
--
>> arch/x86/platform/olpc/olpc_ofw.c:17:5: warning: symbol 'olpc_ofw_pgd' was not declared. Should it be static?
>> arch/x86/platform/olpc/olpc_ofw.c:31:14: warning: incorrect type in assignment (different address spaces)
   arch/x86/platform/olpc/olpc_ofw.c:31:14:    expected struct pgd_t [usertype] *base
   arch/x86/platform/olpc/olpc_ofw.c:31:14:    got void [noderef] <asn:2> *
>> arch/x86/platform/olpc/olpc_ofw.c:43:23: warning: incorrect type in argument 1 (different address spaces)
   arch/x86/platform/olpc/olpc_ofw.c:43:23:    expected void [noderef] <asn:2> *addr
   arch/x86/platform/olpc/olpc_ofw.c:43:23:    got struct pgd_t [usertype] *base
>> arch/x86/platform/olpc/olpc_ofw.c:23:13: warning: symbol 'setup_olpc_ofw_pgd' was not declared. Should it be static?
>> arch/x86/platform/olpc/olpc_ofw.c:46:5: warning: symbol '__olpc_ofw' was not declared. Should it be static?
>> arch/x86/platform/olpc/olpc_ofw.c:80:6: warning: symbol 'olpc_ofw_present' was not declared. Should it be static?
>> arch/x86/platform/olpc/olpc_ofw.c:92:13: warning: symbol 'olpc_ofw_detect' was not declared. Should it be static?
>> arch/x86/platform/olpc/olpc_ofw.c:117:13: warning: symbol 'olpc_ofw_is_installed' was not declared. Should it be static?
>> arch/x86/platform/olpc/olpc_ofw.c:58:28: warning: non size-preserving pointer to integer cast
>> arch/x86/platform/olpc/olpc_ofw.c:101:40: warning: non size-preserving integer to pointer cast
--
>> arch/x86/platform/olpc/olpc_dt.c:34:13: error: undefined identifier 'olpc_ofw'
   arch/x86/platform/olpc/olpc_dt.c:48:13: error: undefined identifier 'olpc_ofw'
   arch/x86/platform/olpc/olpc_dt.c:65:13: error: undefined identifier 'olpc_ofw'
   arch/x86/platform/olpc/olpc_dt.c:85:21: error: undefined identifier 'olpc_ofw'
   arch/x86/platform/olpc/olpc_dt.c:105:13: error: undefined identifier 'olpc_ofw'
   arch/x86/platform/olpc/olpc_dt.c:120:13: error: undefined identifier 'olpc_ofw'
   arch/x86/platform/olpc/olpc_dt.c:173:13: error: undefined identifier 'olpc_ofw'
   arch/x86/platform/olpc/olpc_dt.c:190:13: error: undefined identifier 'olpc_ofw'
>> arch/x86/platform/olpc/olpc_dt.c:220:5: warning: symbol 'olpc_dt_compatible_match' was not declared. Should it be static?
>> arch/x86/platform/olpc/olpc_dt.c:253:26: error: undefined identifier 'olpc_board_pre'
>> arch/x86/platform/olpc/olpc_dt.c:300:14: error: undefined identifier 'olpc_ofw_is_installed'
--
>> drivers/power/supply/olpc_battery.c:328:24: warning: cast to restricted __le16
>> drivers/power/supply/olpc_battery.c:330:24: warning: cast to restricted __be16
>> drivers/power/supply/olpc_battery.c:330:24: warning: cast to restricted __be16
>> drivers/power/supply/olpc_battery.c:330:24: warning: cast to restricted __be16
>> drivers/power/supply/olpc_battery.c:330:24: warning: cast to restricted __be16
>> drivers/power/supply/olpc_battery.c:405:51: warning: incorrect type in argument 2 (different base types)
   drivers/power/supply/olpc_battery.c:405:51:    expected unsigned short [usertype] ec_word
   drivers/power/supply/olpc_battery.c:405:51:    got restricted __be16 [addressable] [usertype] ec_word
   drivers/power/supply/olpc_battery.c:413:51: warning: incorrect type in argument 2 (different base types)
   drivers/power/supply/olpc_battery.c:413:51:    expected unsigned short [usertype] ec_word
   drivers/power/supply/olpc_battery.c:413:51:    got restricted __be16 [addressable] [usertype] ec_word
   drivers/power/supply/olpc_battery.c:444:51: warning: incorrect type in argument 2 (different base types)
   drivers/power/supply/olpc_battery.c:444:51:    expected unsigned short [usertype] ec_word
   drivers/power/supply/olpc_battery.c:444:51:    got restricted __be16 [addressable] [usertype] ec_word
   drivers/power/supply/olpc_battery.c:451:56: warning: incorrect type in argument 2 (different base types)
   drivers/power/supply/olpc_battery.c:451:56:    expected unsigned short [usertype] ec_word
   drivers/power/supply/olpc_battery.c:451:56:    got restricted __be16 [addressable] [usertype] ec_word
   drivers/power/supply/olpc_battery.c:458:51: warning: incorrect type in argument 2 (different base types)
   drivers/power/supply/olpc_battery.c:458:51:    expected unsigned short [usertype] ec_word
   drivers/power/supply/olpc_battery.c:458:51:    got restricted __be16 [addressable] [usertype] ec_word
--
>> drivers/platform/olpc/olpc-ec.c:70:6: warning: symbol 'olpc_ec_driver_register' was not declared. Should it be static?
>> drivers/platform/olpc/olpc-ec.c:126:5: warning: symbol 'olpc_ec_cmd' was not declared. Should it be static?
>> drivers/platform/olpc/olpc-ec.c:165:6: warning: symbol 'olpc_ec_wakeup_set' was not declared. Should it be static?
>> drivers/platform/olpc/olpc-ec.c:176:6: warning: symbol 'olpc_ec_wakeup_clear' was not declared. Should it be static?
>> drivers/platform/olpc/olpc-ec.c:187:5: warning: symbol 'olpc_ec_mask_write' was not declared. Should it be static?
>> drivers/platform/olpc/olpc-ec.c:211:6: warning: symbol 'olpc_ec_wakeup_available' was not declared. Should it be static?
>> drivers/platform/olpc/olpc-ec.c:220:5: warning: symbol 'olpc_ec_sci_query' was not declared. Should it be static?
--
>> drivers/platform/olpc/olpc-xo175-ec.c:26:11: error: unable to open 'asm/system_misc.h'
--
>> drivers/input/mouse/hgpk.c:763:13: error: undefined identifier 'olpc_board_at_least'
--
>> sound/pci/cs5535audio/cs5535audio_olpc.c:28:6: warning: symbol 'olpc_analog_input' was not declared. Should it be static?
>> sound/pci/cs5535audio/cs5535audio_olpc.c:51:6: warning: symbol 'olpc_mic_bias' was not declared. Should it be static?
>> sound/pci/cs5535audio/cs5535audio_olpc.c:144:13: error: undefined identifier 'olpc_board_at_least'
>> sound/pci/cs5535audio/cs5535audio_olpc.c:148:5: warning: symbol 'olpc_quirks' was not declared. Should it be static?
>> sound/pci/cs5535audio/cs5535audio_olpc.c:189:6: warning: symbol 'olpc_quirks_cleanup' was not declared. Should it be static?
--
>> drivers/staging/olpc_dcon/olpc_dcon.c:141:17: error: undefined identifier 'olpc_board_at_least'
   drivers/staging/olpc_dcon/olpc_dcon.c:202:14: error: undefined identifier 'olpc_board_at_least'
   drivers/staging/olpc_dcon/olpc_dcon.c:799:13: error: undefined identifier 'olpc_board_at_least'
--
>> drivers/staging/olpc_dcon/olpc_dcon_xo_1.c:42:18: warning: symbol 'gpios' was not declared. Should it be static?
>> drivers/staging/olpc_dcon/olpc_dcon_xo_1.c:48:44: warning: incorrect type in initializer (different modifiers)
   drivers/staging/olpc_dcon/olpc_dcon_xo_1.c:48:44:    expected struct dcon_gpio *pin
   drivers/staging/olpc_dcon/olpc_dcon_xo_1.c:48:44:    got struct dcon_gpio const *

vim +328 drivers/power/supply/olpc_battery.c

   324	
   325	static u16 ecword_to_cpu(struct olpc_battery_data *data, u16 ec_word)
   326	{
   327		if (data->little_endian)
 > 328			return le16_to_cpu(ec_word);
   329		else
 > 330			return be16_to_cpu(ec_word);
   331	}
   332	
   333	/*********************************************************************
   334	 *		Battery properties
   335	 *********************************************************************/
   336	static int olpc_bat_get_property(struct power_supply *psy,
   337					 enum power_supply_property psp,
   338					 union power_supply_propval *val)
   339	{
   340		struct olpc_battery_data *data = power_supply_get_drvdata(psy);
   341		int ret = 0;
   342		__be16 ec_word;
   343		uint8_t ec_byte;
   344		__be64 ser_buf;
   345	
   346		ret = olpc_ec_cmd(EC_BAT_STATUS, NULL, 0, &ec_byte, 1);
   347		if (ret)
   348			return ret;
   349	
   350		/* Theoretically there's a race here -- the battery could be
   351		   removed immediately after we check whether it's present, and
   352		   then we query for some other property of the now-absent battery.
   353		   It doesn't matter though -- the EC will return the last-known
   354		   information, and it's as if we just ran that _little_ bit faster
   355		   and managed to read it out before the battery went away. */
   356		if (!(ec_byte & (BAT_STAT_PRESENT | BAT_STAT_TRICKLE)) &&
   357				psp != POWER_SUPPLY_PROP_PRESENT)
   358			return -ENODEV;
   359	
   360		switch (psp) {
   361		case POWER_SUPPLY_PROP_STATUS:
   362			ret = olpc_bat_get_status(data, val, ec_byte);
   363			if (ret)
   364				return ret;
   365			break;
   366		case POWER_SUPPLY_PROP_CHARGE_TYPE:
   367			if (ec_byte & BAT_STAT_TRICKLE)
   368				val->intval = POWER_SUPPLY_CHARGE_TYPE_TRICKLE;
   369			else if (ec_byte & BAT_STAT_CHARGING)
   370				val->intval = POWER_SUPPLY_CHARGE_TYPE_FAST;
   371			else
   372				val->intval = POWER_SUPPLY_CHARGE_TYPE_NONE;
   373			break;
   374		case POWER_SUPPLY_PROP_PRESENT:
   375			val->intval = !!(ec_byte & (BAT_STAT_PRESENT |
   376						    BAT_STAT_TRICKLE));
   377			break;
   378	
   379		case POWER_SUPPLY_PROP_HEALTH:
   380			if (ec_byte & BAT_STAT_DESTROY)
   381				val->intval = POWER_SUPPLY_HEALTH_DEAD;
   382			else {
   383				ret = olpc_bat_get_health(val);
   384				if (ret)
   385					return ret;
   386			}
   387			break;
   388	
   389		case POWER_SUPPLY_PROP_MANUFACTURER:
   390			ret = olpc_bat_get_mfr(val);
   391			if (ret)
   392				return ret;
   393			break;
   394		case POWER_SUPPLY_PROP_TECHNOLOGY:
   395			ret = olpc_bat_get_tech(val);
   396			if (ret)
   397				return ret;
   398			break;
   399		case POWER_SUPPLY_PROP_VOLTAGE_AVG:
   400		case POWER_SUPPLY_PROP_VOLTAGE_NOW:
   401			ret = olpc_ec_cmd(EC_BAT_VOLTAGE, NULL, 0, (void *)&ec_word, 2);
   402			if (ret)
   403				return ret;
   404	
 > 405			val->intval = ecword_to_cpu(data, ec_word) * 9760L / 32;
   406			break;
   407		case POWER_SUPPLY_PROP_CURRENT_AVG:
   408		case POWER_SUPPLY_PROP_CURRENT_NOW:
   409			ret = olpc_ec_cmd(EC_BAT_CURRENT, NULL, 0, (void *)&ec_word, 2);
   410			if (ret)
   411				return ret;
   412	
   413			val->intval = ecword_to_cpu(data, ec_word) * 15625L / 120;
   414			break;
   415		case POWER_SUPPLY_PROP_CAPACITY:
   416			ret = olpc_ec_cmd(EC_BAT_SOC, NULL, 0, &ec_byte, 1);
   417			if (ret)
   418				return ret;
   419			val->intval = ec_byte;
   420			break;
   421		case POWER_SUPPLY_PROP_CAPACITY_LEVEL:
   422			if (ec_byte & BAT_STAT_FULL)
   423				val->intval = POWER_SUPPLY_CAPACITY_LEVEL_FULL;
   424			else if (ec_byte & BAT_STAT_LOW)
   425				val->intval = POWER_SUPPLY_CAPACITY_LEVEL_LOW;
   426			else
   427				val->intval = POWER_SUPPLY_CAPACITY_LEVEL_NORMAL;
   428			break;
   429		case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
   430			ret = olpc_bat_get_charge_full_design(val);
   431			if (ret)
   432				return ret;
   433			break;
   434		case POWER_SUPPLY_PROP_CHARGE_NOW:
   435			ret = olpc_bat_get_charge_now(val);
   436			if (ret)
   437				return ret;
   438			break;
   439		case POWER_SUPPLY_PROP_TEMP:
   440			ret = olpc_ec_cmd(EC_BAT_TEMP, NULL, 0, (void *)&ec_word, 2);
   441			if (ret)
   442				return ret;
   443	
   444			val->intval = ecword_to_cpu(data, ec_word) * 10 / 256;
   445			break;
   446		case POWER_SUPPLY_PROP_TEMP_AMBIENT:
   447			ret = olpc_ec_cmd(EC_AMB_TEMP, NULL, 0, (void *)&ec_word, 2);
   448			if (ret)
   449				return ret;
   450	
   451			val->intval = (int)ecword_to_cpu(data, ec_word) * 10 / 256;
   452			break;
   453		case POWER_SUPPLY_PROP_CHARGE_COUNTER:
   454			ret = olpc_ec_cmd(EC_BAT_ACR, NULL, 0, (void *)&ec_word, 2);
   455			if (ret)
   456				return ret;
   457	
   458			val->intval = ecword_to_cpu(data, ec_word) * 6250 / 15;
   459			break;
   460		case POWER_SUPPLY_PROP_SERIAL_NUMBER:
   461			ret = olpc_ec_cmd(EC_BAT_SERIAL, NULL, 0, (void *)&ser_buf, 8);
   462			if (ret)
   463				return ret;
   464	
   465			sprintf(data->bat_serial, "%016llx", (long long)be64_to_cpu(ser_buf));
   466			val->strval = data->bat_serial;
   467			break;
   468		case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN:
   469			ret = olpc_bat_get_voltage_max_design(val);
   470			if (ret)
   471				return ret;
   472			break;
   473		default:
   474			ret = -EINVAL;
   475			break;
   476		}
   477	
   478		return ret;
   479	}
   480	

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

Attachment: .config.gz
Description: application/gzip


[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