All of lore.kernel.org
 help / color / mirror / Atom feed
* [regulator:for-5.8 14/15] drivers/regulator/max8998.c:374:5: warning: no previous prototype for function 'max8998_set_current_limit'
@ 2020-05-23  7:19 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-05-23  7:19 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.8
head:   0c680ffb99ea4022b97fbbf831da46b0f90958a5
commit: 4ffea5e083f8125fe273cf331ecb10d901eb64a2 [14/15] regulator: max8998: Add charger regulator
config: x86_64-randconfig-a011-20200521 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3393cc4cebf9969db94dc424b7a2b6195589c33b)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        git checkout 4ffea5e083f8125fe273cf331ecb10d901eb64a2
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All warnings (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/regulator/max8998.c:374:5: warning: no previous prototype for function 'max8998_set_current_limit' [-Wmissing-prototypes]
int max8998_set_current_limit(struct regulator_dev *rdev,
^
drivers/regulator/max8998.c:374:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int max8998_set_current_limit(struct regulator_dev *rdev,
^
static
>> drivers/regulator/max8998.c:418:5: warning: no previous prototype for function 'max8998_get_current_limit' [-Wmissing-prototypes]
int max8998_get_current_limit(struct regulator_dev *rdev)
^
drivers/regulator/max8998.c:418:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int max8998_get_current_limit(struct regulator_dev *rdev)
^
static
2 warnings generated.

vim +/max8998_set_current_limit +374 drivers/regulator/max8998.c

   373	
 > 374	int max8998_set_current_limit(struct regulator_dev *rdev,
   375				      int min_uA, int max_uA)
   376	{
   377		struct max8998_data *max8998 = rdev_get_drvdata(rdev);
   378		struct i2c_client *i2c = max8998->iodev->i2c;
   379		unsigned int n_currents = rdev->desc->n_current_limits;
   380		int i, sel = -1;
   381	
   382		if (n_currents == 0)
   383			return -EINVAL;
   384	
   385		if (rdev->desc->curr_table) {
   386			const unsigned int *curr_table = rdev->desc->curr_table;
   387			bool ascend = curr_table[n_currents - 1] > curr_table[0];
   388	
   389			/* search for closest to maximum */
   390			if (ascend) {
   391				for (i = n_currents - 1; i >= 0; i--) {
   392					if (min_uA <= curr_table[i] &&
   393					    curr_table[i] <= max_uA) {
   394						sel = i;
   395						break;
   396					}
   397				}
   398			} else {
   399				for (i = 0; i < n_currents; i++) {
   400					if (min_uA <= curr_table[i] &&
   401					    curr_table[i] <= max_uA) {
   402						sel = i;
   403						break;
   404					}
   405				}
   406			}
   407		}
   408	
   409		if (sel < 0)
   410			return -EINVAL;
   411	
   412		sel <<= ffs(rdev->desc->csel_mask) - 1;
   413	
   414		return max8998_update_reg(i2c, rdev->desc->csel_reg,
   415					  sel, rdev->desc->csel_mask);
   416	}
   417	
 > 418	int max8998_get_current_limit(struct regulator_dev *rdev)
   419	{
   420		struct max8998_data *max8998 = rdev_get_drvdata(rdev);
   421		struct i2c_client *i2c = max8998->iodev->i2c;
   422		u8 val;
   423		int ret;
   424	
   425		ret = max8998_read_reg(i2c, rdev->desc->csel_reg, &val);
   426		if (ret != 0)
   427			return ret;
   428	
   429		val &= rdev->desc->csel_mask;
   430		val >>= ffs(rdev->desc->csel_mask) - 1;
   431	
   432		if (rdev->desc->curr_table) {
   433			if (val >= rdev->desc->n_current_limits)
   434				return -EINVAL;
   435	
   436			return rdev->desc->curr_table[val];
   437		}
   438	
   439		return -EINVAL;
   440	}
   441	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

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

only message in thread, other threads:[~2020-05-23  7:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-23  7:19 [regulator:for-5.8 14/15] drivers/regulator/max8998.c:374:5: warning: no previous prototype for function 'max8998_set_current_limit' kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.