All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [linux-next:master 10947/14131] drivers/regulator/max8998.c:374:5: warning: no previous prototype for function 'max8998_set_current_limit'
Date: Sat, 30 May 2020 01:39:18 +0800	[thread overview]
Message-ID: <202005300114.cSTGPxdd%lkp@intel.com> (raw)

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

Hi Jonathan,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   e7b08814b16b80a0bf76eeca16317f8c2ed23b8c
commit: 4ffea5e083f8125fe273cf331ecb10d901eb64a2 [10947/14131] regulator: max8998: Add charger regulator
config: x86_64-randconfig-a011-20200529 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 2d068e534f1671459e1b135852c1b3c10502e929)
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: 37193 bytes --]

                 reply	other threads:[~2020-05-29 17:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202005300114.cSTGPxdd%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.