Linux-Hwmon Archive on lore.kernel.org
 help / color / Atom feed
* [hwmon:hwmon-playground 37/44] drivers/hwmon/pmbus/ibm-cffps.c:250:3: error: too few arguments to function 'pmbus_set_page'
@ 2020-01-26 17:10 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-01-26 17:10 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: kbuild-all, linux-hwmon

[-- Attachment #1: Type: text/plain, Size: 11991 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-playground
head:   e8dc30cf9ae936e93319687fa88ed45c55797807
commit: 81a9e2ca8e40ffd25ae444bdd943dba8d3454ffe [37/44] hwmon: (pmbus) Add 'phase' parameter where needed for multi-phase support
config: riscv-randconfig-a001-20200126 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 81a9e2ca8e40ffd25ae444bdd943dba8d3454ffe
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=riscv 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/hwmon/pmbus/ibm-cffps.c: In function 'ibm_cffps_debugfs_write':
>> drivers/hwmon/pmbus/ibm-cffps.c:250:3: error: too few arguments to function 'pmbus_set_page'
      pmbus_set_page(psu->client, 0);
      ^~~~~~~~~~~~~~
   In file included from drivers/hwmon/pmbus/ibm-cffps.c:19:0:
   drivers/hwmon/pmbus/pmbus.h:461:5: note: declared here
    int pmbus_set_page(struct i2c_client *client, int page, int phase);
        ^~~~~~~~~~~~~~
   drivers/hwmon/pmbus/ibm-cffps.c: In function 'ibm_cffps_read_word_data':
>> drivers/hwmon/pmbus/ibm-cffps.c:351:8: error: too few arguments to function 'pmbus_read_word_data'
      rc = pmbus_read_word_data(client, page, CFFPS_12VCS_VOUT_CMD);
           ^~~~~~~~~~~~~~~~~~~~
   In file included from drivers/hwmon/pmbus/ibm-cffps.c:19:0:
   drivers/hwmon/pmbus/pmbus.h:462:5: note: declared here
    int pmbus_read_word_data(struct i2c_client *client, int page, int phase,
        ^~~~~~~~~~~~~~~~~~~~
--
>> drivers/hwmon/pmbus/max20730.c:168:21: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
      .read_word_data = max20730_read_word_data,
                        ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/pmbus/max20730.c:168:21: note: (near initialization for 'max20730_info[0].read_word_data')
   drivers/hwmon/pmbus/max20730.c:206:21: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
      .read_word_data = max20730_read_word_data,
                        ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/pmbus/max20730.c:206:21: note: (near initialization for 'max20730_info[1].read_word_data')
   drivers/hwmon/pmbus/max20730.c:234:21: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
      .read_word_data = max20730_read_word_data,
                        ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/pmbus/max20730.c:234:21: note: (near initialization for 'max20730_info[2].read_word_data')
   cc1: some warnings being treated as errors

vim +/pmbus_set_page +250 drivers/hwmon/pmbus/ibm-cffps.c

d6bb645a1704cb Edward A. James 2017-12-11  237  
abe508b66d23cf Eddie James     2019-12-19  238  static ssize_t ibm_cffps_debugfs_write(struct file *file,
abe508b66d23cf Eddie James     2019-12-19  239  				       const char __user *buf, size_t count,
abe508b66d23cf Eddie James     2019-12-19  240  				       loff_t *ppos)
abe508b66d23cf Eddie James     2019-12-19  241  {
abe508b66d23cf Eddie James     2019-12-19  242  	u8 data;
abe508b66d23cf Eddie James     2019-12-19  243  	ssize_t rc;
abe508b66d23cf Eddie James     2019-12-19  244  	int *idxp = file->private_data;
abe508b66d23cf Eddie James     2019-12-19  245  	int idx = *idxp;
abe508b66d23cf Eddie James     2019-12-19  246  	struct ibm_cffps *psu = to_psu(idxp, idx);
abe508b66d23cf Eddie James     2019-12-19  247  
abe508b66d23cf Eddie James     2019-12-19  248  	switch (idx) {
abe508b66d23cf Eddie James     2019-12-19  249  	case CFFPS_DEBUGFS_ON_OFF_CONFIG:
abe508b66d23cf Eddie James     2019-12-19 @250  		pmbus_set_page(psu->client, 0);
abe508b66d23cf Eddie James     2019-12-19  251  
abe508b66d23cf Eddie James     2019-12-19  252  		rc = simple_write_to_buffer(&data, 1, ppos, buf, count);
d9c8ae69b99621 Eddie James     2020-01-07  253  		if (rc <= 0)
abe508b66d23cf Eddie James     2019-12-19  254  			return rc;
abe508b66d23cf Eddie James     2019-12-19  255  
abe508b66d23cf Eddie James     2019-12-19  256  		rc = i2c_smbus_write_byte_data(psu->client,
abe508b66d23cf Eddie James     2019-12-19  257  					       PMBUS_ON_OFF_CONFIG, data);
abe508b66d23cf Eddie James     2019-12-19  258  		if (rc)
abe508b66d23cf Eddie James     2019-12-19  259  			return rc;
abe508b66d23cf Eddie James     2019-12-19  260  
abe508b66d23cf Eddie James     2019-12-19  261  		rc = 1;
abe508b66d23cf Eddie James     2019-12-19  262  		break;
abe508b66d23cf Eddie James     2019-12-19  263  	default:
abe508b66d23cf Eddie James     2019-12-19  264  		return -EINVAL;
abe508b66d23cf Eddie James     2019-12-19  265  	}
abe508b66d23cf Eddie James     2019-12-19  266  
abe508b66d23cf Eddie James     2019-12-19  267  	return rc;
abe508b66d23cf Eddie James     2019-12-19  268  }
abe508b66d23cf Eddie James     2019-12-19  269  
d6bb645a1704cb Edward A. James 2017-12-11  270  static const struct file_operations ibm_cffps_fops = {
d6bb645a1704cb Edward A. James 2017-12-11  271  	.llseek = noop_llseek,
abe508b66d23cf Eddie James     2019-12-19  272  	.read = ibm_cffps_debugfs_read,
abe508b66d23cf Eddie James     2019-12-19  273  	.write = ibm_cffps_debugfs_write,
d6bb645a1704cb Edward A. James 2017-12-11  274  	.open = simple_open,
d6bb645a1704cb Edward A. James 2017-12-11  275  };
d6bb645a1704cb Edward A. James 2017-12-11  276  
f69316d62c7066 Edward A. James 2017-08-21  277  static int ibm_cffps_read_byte_data(struct i2c_client *client, int page,
f69316d62c7066 Edward A. James 2017-08-21  278  				    int reg)
f69316d62c7066 Edward A. James 2017-08-21  279  {
f69316d62c7066 Edward A. James 2017-08-21  280  	int rc, mfr;
f69316d62c7066 Edward A. James 2017-08-21  281  
f69316d62c7066 Edward A. James 2017-08-21  282  	switch (reg) {
f69316d62c7066 Edward A. James 2017-08-21  283  	case PMBUS_STATUS_VOUT:
f69316d62c7066 Edward A. James 2017-08-21  284  	case PMBUS_STATUS_IOUT:
f69316d62c7066 Edward A. James 2017-08-21  285  	case PMBUS_STATUS_TEMPERATURE:
f69316d62c7066 Edward A. James 2017-08-21  286  	case PMBUS_STATUS_FAN_12:
f69316d62c7066 Edward A. James 2017-08-21  287  		rc = pmbus_read_byte_data(client, page, reg);
f69316d62c7066 Edward A. James 2017-08-21  288  		if (rc < 0)
f69316d62c7066 Edward A. James 2017-08-21  289  			return rc;
f69316d62c7066 Edward A. James 2017-08-21  290  
f69316d62c7066 Edward A. James 2017-08-21  291  		mfr = pmbus_read_byte_data(client, page,
f69316d62c7066 Edward A. James 2017-08-21  292  					   PMBUS_STATUS_MFR_SPECIFIC);
f69316d62c7066 Edward A. James 2017-08-21  293  		if (mfr < 0)
f69316d62c7066 Edward A. James 2017-08-21  294  			/*
f69316d62c7066 Edward A. James 2017-08-21  295  			 * Return the status register instead of an error,
f69316d62c7066 Edward A. James 2017-08-21  296  			 * since we successfully read status.
f69316d62c7066 Edward A. James 2017-08-21  297  			 */
f69316d62c7066 Edward A. James 2017-08-21  298  			return rc;
f69316d62c7066 Edward A. James 2017-08-21  299  
f69316d62c7066 Edward A. James 2017-08-21  300  		/* Add MFR_SPECIFIC bits to the standard pmbus status regs. */
f69316d62c7066 Edward A. James 2017-08-21  301  		if (reg == PMBUS_STATUS_FAN_12) {
f69316d62c7066 Edward A. James 2017-08-21  302  			if (mfr & CFFPS_MFR_FAN_FAULT)
f69316d62c7066 Edward A. James 2017-08-21  303  				rc |= PB_FAN_FAN1_FAULT;
f69316d62c7066 Edward A. James 2017-08-21  304  		} else if (reg == PMBUS_STATUS_TEMPERATURE) {
f69316d62c7066 Edward A. James 2017-08-21  305  			if (mfr & CFFPS_MFR_THERMAL_FAULT)
f69316d62c7066 Edward A. James 2017-08-21  306  				rc |= PB_TEMP_OT_FAULT;
f69316d62c7066 Edward A. James 2017-08-21  307  		} else if (reg == PMBUS_STATUS_VOUT) {
f69316d62c7066 Edward A. James 2017-08-21  308  			if (mfr & (CFFPS_MFR_OV_FAULT | CFFPS_MFR_VAUX_FAULT))
f69316d62c7066 Edward A. James 2017-08-21  309  				rc |= PB_VOLTAGE_OV_FAULT;
f69316d62c7066 Edward A. James 2017-08-21  310  			if (mfr & CFFPS_MFR_UV_FAULT)
f69316d62c7066 Edward A. James 2017-08-21  311  				rc |= PB_VOLTAGE_UV_FAULT;
f69316d62c7066 Edward A. James 2017-08-21  312  		} else if (reg == PMBUS_STATUS_IOUT) {
f69316d62c7066 Edward A. James 2017-08-21  313  			if (mfr & CFFPS_MFR_OC_FAULT)
f69316d62c7066 Edward A. James 2017-08-21  314  				rc |= PB_IOUT_OC_FAULT;
f69316d62c7066 Edward A. James 2017-08-21  315  			if (mfr & CFFPS_MFR_CURRENT_SHARE_WARNING)
f69316d62c7066 Edward A. James 2017-08-21  316  				rc |= PB_CURRENT_SHARE_FAULT;
f69316d62c7066 Edward A. James 2017-08-21  317  		}
f69316d62c7066 Edward A. James 2017-08-21  318  		break;
f69316d62c7066 Edward A. James 2017-08-21  319  	default:
f69316d62c7066 Edward A. James 2017-08-21  320  		rc = -ENODATA;
f69316d62c7066 Edward A. James 2017-08-21  321  		break;
f69316d62c7066 Edward A. James 2017-08-21  322  	}
f69316d62c7066 Edward A. James 2017-08-21  323  
f69316d62c7066 Edward A. James 2017-08-21  324  	return rc;
f69316d62c7066 Edward A. James 2017-08-21  325  }
f69316d62c7066 Edward A. James 2017-08-21  326  
f69316d62c7066 Edward A. James 2017-08-21  327  static int ibm_cffps_read_word_data(struct i2c_client *client, int page,
81a9e2ca8e40ff Guenter Roeck   2020-01-14  328  				    int phase, int reg)
f69316d62c7066 Edward A. James 2017-08-21  329  {
f69316d62c7066 Edward A. James 2017-08-21  330  	int rc, mfr;
f69316d62c7066 Edward A. James 2017-08-21  331  
f69316d62c7066 Edward A. James 2017-08-21  332  	switch (reg) {
f69316d62c7066 Edward A. James 2017-08-21  333  	case PMBUS_STATUS_WORD:
81a9e2ca8e40ff Guenter Roeck   2020-01-14  334  		rc = pmbus_read_word_data(client, page, phase, reg);
f69316d62c7066 Edward A. James 2017-08-21  335  		if (rc < 0)
f69316d62c7066 Edward A. James 2017-08-21  336  			return rc;
f69316d62c7066 Edward A. James 2017-08-21  337  
f69316d62c7066 Edward A. James 2017-08-21  338  		mfr = pmbus_read_byte_data(client, page,
f69316d62c7066 Edward A. James 2017-08-21  339  					   PMBUS_STATUS_MFR_SPECIFIC);
f69316d62c7066 Edward A. James 2017-08-21  340  		if (mfr < 0)
f69316d62c7066 Edward A. James 2017-08-21  341  			/*
f69316d62c7066 Edward A. James 2017-08-21  342  			 * Return the status register instead of an error,
f69316d62c7066 Edward A. James 2017-08-21  343  			 * since we successfully read status.
f69316d62c7066 Edward A. James 2017-08-21  344  			 */
f69316d62c7066 Edward A. James 2017-08-21  345  			return rc;
f69316d62c7066 Edward A. James 2017-08-21  346  
f69316d62c7066 Edward A. James 2017-08-21  347  		if (mfr & CFFPS_MFR_PS_KILL)
f69316d62c7066 Edward A. James 2017-08-21  348  			rc |= PB_STATUS_OFF;
f69316d62c7066 Edward A. James 2017-08-21  349  		break;
1952d79a0d2635 Eddie James     2019-12-19  350  	case PMBUS_VIRT_READ_VMON:
1952d79a0d2635 Eddie James     2019-12-19 @351  		rc = pmbus_read_word_data(client, page, CFFPS_12VCS_VOUT_CMD);
1952d79a0d2635 Eddie James     2019-12-19  352  		break;
f69316d62c7066 Edward A. James 2017-08-21  353  	default:
f69316d62c7066 Edward A. James 2017-08-21  354  		rc = -ENODATA;
f69316d62c7066 Edward A. James 2017-08-21  355  		break;
f69316d62c7066 Edward A. James 2017-08-21  356  	}
f69316d62c7066 Edward A. James 2017-08-21  357  
f69316d62c7066 Edward A. James 2017-08-21  358  	return rc;
f69316d62c7066 Edward A. James 2017-08-21  359  }
f69316d62c7066 Edward A. James 2017-08-21  360  

:::::: The code at line 250 was first introduced by commit
:::::: abe508b66d23cf2ed18c991c200b957e92f4bfbc hwmon: (pmbus/ibm-cffps) Add new manufacturer debugfs entries

:::::: TO: Eddie James <eajames@linux.ibm.com>
:::::: CC: Guenter Roeck <linux@roeck-us.net>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25985 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-26 17:10 [hwmon:hwmon-playground 37/44] drivers/hwmon/pmbus/ibm-cffps.c:250:3: error: too few arguments to function 'pmbus_set_page' kbuild test robot

Linux-Hwmon Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hwmon/0 linux-hwmon/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hwmon linux-hwmon/ https://lore.kernel.org/linux-hwmon \
		linux-hwmon@vger.kernel.org
	public-inbox-index linux-hwmon

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hwmon


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git