All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [chanwoo:devfreq-testing 4/4] drivers/devfreq/governor_passive.c:350:17: error: this 'if' clause does not guard...
Date: Thu, 16 Sep 2021 08:04:23 +0800	[thread overview]
Message-ID: <202109160813.kEdExbgm-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git devfreq-testing
head:   c27162469a5f04fd237debefc710d28956b9704e
commit: c27162469a5f04fd237debefc710d28956b9704e [4/4] PM / devfreq: passive: Update frequency when start governor
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 11.2.0
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git/commit/?id=c27162469a5f04fd237debefc710d28956b9704e
        git remote add chanwoo https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git
        git fetch --no-tags chanwoo devfreq-testing
        git checkout c27162469a5f04fd237debefc710d28956b9704e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=nios2 

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

All errors (new ones prefixed by >>):

   drivers/devfreq/governor_passive.c: In function 'cpufreq_passive_register_notifier':
   drivers/devfreq/governor_passive.c:205:9: error: implicit declaration of function 'get_online_cpus'; did you mean 'get_online_mems'? [-Werror=implicit-function-declaration]
     205 |         get_online_cpus();
         |         ^~~~~~~~~~~~~~~
         |         get_online_mems
   drivers/devfreq/governor_passive.c:255:9: error: implicit declaration of function 'put_online_cpus'; did you mean 'num_online_cpus'? [-Werror=implicit-function-declaration]
     255 |         put_online_cpus();
         |         ^~~~~~~~~~~~~~~
         |         num_online_cpus
   drivers/devfreq/governor_passive.c: In function 'devfreq_passive_event_handler':
>> drivers/devfreq/governor_passive.c:350:17: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     350 |                 if (parent->previous_freq)
         |                 ^~
   drivers/devfreq/governor_passive.c:352:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     352 |                         ret = devfreq_update_target(devfreq, parent->previous_freq);
         |                         ^~~
   cc1: all warnings being treated as errors


vim +/if +350 drivers/devfreq/governor_passive.c

   322	
   323	static int devfreq_passive_event_handler(struct devfreq *devfreq,
   324					unsigned int event, void *data)
   325	{
   326		struct devfreq_passive_data *p_data
   327				= (struct devfreq_passive_data *)devfreq->data;
   328		struct devfreq *parent = (struct devfreq *)p_data->parent;
   329		struct notifier_block *nb = &p_data->nb;
   330		int ret = 0;
   331	
   332		if (p_data->parent_type == DEVFREQ_PARENT_DEV && !parent)
   333			return -EPROBE_DEFER;
   334	
   335		switch (event) {
   336		case DEVFREQ_GOV_START:
   337			if (!p_data->this)
   338				p_data->this = devfreq;
   339	
   340			/*
   341			 * If the parent device changes the their frequency before
   342			 * registering the passive device, the passive device cannot
   343			 * receive the notification from parent device and then the
   344			 * passive device cannot be able to set the proper frequency
   345			 * according to the frequency of parent device.
   346			 *
   347			 * When start the passive governor, update the frequency
   348			 * according to the frequency of parent device.
   349			 */
 > 350			if (parent->previous_freq)
   351				mutex_lock(&devfreq->lock);
   352				ret = devfreq_update_target(devfreq, parent->previous_freq);
   353				if (ret < 0) {
   354					dev_warn(&devfreq->dev,
   355					"failed to update devfreq using passive governor\n");
   356				mutex_unlock(&devfreq->lock);
   357			}
   358	
   359			if (p_data->parent_type == DEVFREQ_PARENT_DEV) {
   360				nb->notifier_call = devfreq_passive_notifier_call;
   361				ret = devfreq_register_notifier(parent, nb,
   362							DEVFREQ_TRANSITION_NOTIFIER);
   363			} else if (p_data->parent_type == CPUFREQ_PARENT_DEV) {
   364				ret = cpufreq_passive_register_notifier(devfreq);
   365			} else {
   366				ret = -EINVAL;
   367			}
   368			break;
   369		case DEVFREQ_GOV_STOP:
   370			if (p_data->parent_type == DEVFREQ_PARENT_DEV)
   371				WARN_ON(devfreq_unregister_notifier(parent, nb,
   372							DEVFREQ_TRANSITION_NOTIFIER));
   373			else if (p_data->parent_type == CPUFREQ_PARENT_DEV)
   374				WARN_ON(cpufreq_passive_unregister_notifier(devfreq));
   375			else
   376				ret = -EINVAL;
   377			break;
   378		default:
   379			break;
   380		}
   381	
   382		return ret;
   383	}
   384	

---
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: 60767 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Chanwoo Choi <cw00.choi@samsung.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [chanwoo:devfreq-testing 4/4] drivers/devfreq/governor_passive.c:350:17: error: this 'if' clause does not guard...
Date: Thu, 16 Sep 2021 08:04:23 +0800	[thread overview]
Message-ID: <202109160813.kEdExbgm-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git devfreq-testing
head:   c27162469a5f04fd237debefc710d28956b9704e
commit: c27162469a5f04fd237debefc710d28956b9704e [4/4] PM / devfreq: passive: Update frequency when start governor
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 11.2.0
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git/commit/?id=c27162469a5f04fd237debefc710d28956b9704e
        git remote add chanwoo https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux.git
        git fetch --no-tags chanwoo devfreq-testing
        git checkout c27162469a5f04fd237debefc710d28956b9704e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=nios2 

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

All errors (new ones prefixed by >>):

   drivers/devfreq/governor_passive.c: In function 'cpufreq_passive_register_notifier':
   drivers/devfreq/governor_passive.c:205:9: error: implicit declaration of function 'get_online_cpus'; did you mean 'get_online_mems'? [-Werror=implicit-function-declaration]
     205 |         get_online_cpus();
         |         ^~~~~~~~~~~~~~~
         |         get_online_mems
   drivers/devfreq/governor_passive.c:255:9: error: implicit declaration of function 'put_online_cpus'; did you mean 'num_online_cpus'? [-Werror=implicit-function-declaration]
     255 |         put_online_cpus();
         |         ^~~~~~~~~~~~~~~
         |         num_online_cpus
   drivers/devfreq/governor_passive.c: In function 'devfreq_passive_event_handler':
>> drivers/devfreq/governor_passive.c:350:17: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     350 |                 if (parent->previous_freq)
         |                 ^~
   drivers/devfreq/governor_passive.c:352:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     352 |                         ret = devfreq_update_target(devfreq, parent->previous_freq);
         |                         ^~~
   cc1: all warnings being treated as errors


vim +/if +350 drivers/devfreq/governor_passive.c

   322	
   323	static int devfreq_passive_event_handler(struct devfreq *devfreq,
   324					unsigned int event, void *data)
   325	{
   326		struct devfreq_passive_data *p_data
   327				= (struct devfreq_passive_data *)devfreq->data;
   328		struct devfreq *parent = (struct devfreq *)p_data->parent;
   329		struct notifier_block *nb = &p_data->nb;
   330		int ret = 0;
   331	
   332		if (p_data->parent_type == DEVFREQ_PARENT_DEV && !parent)
   333			return -EPROBE_DEFER;
   334	
   335		switch (event) {
   336		case DEVFREQ_GOV_START:
   337			if (!p_data->this)
   338				p_data->this = devfreq;
   339	
   340			/*
   341			 * If the parent device changes the their frequency before
   342			 * registering the passive device, the passive device cannot
   343			 * receive the notification from parent device and then the
   344			 * passive device cannot be able to set the proper frequency
   345			 * according to the frequency of parent device.
   346			 *
   347			 * When start the passive governor, update the frequency
   348			 * according to the frequency of parent device.
   349			 */
 > 350			if (parent->previous_freq)
   351				mutex_lock(&devfreq->lock);
   352				ret = devfreq_update_target(devfreq, parent->previous_freq);
   353				if (ret < 0) {
   354					dev_warn(&devfreq->dev,
   355					"failed to update devfreq using passive governor\n");
   356				mutex_unlock(&devfreq->lock);
   357			}
   358	
   359			if (p_data->parent_type == DEVFREQ_PARENT_DEV) {
   360				nb->notifier_call = devfreq_passive_notifier_call;
   361				ret = devfreq_register_notifier(parent, nb,
   362							DEVFREQ_TRANSITION_NOTIFIER);
   363			} else if (p_data->parent_type == CPUFREQ_PARENT_DEV) {
   364				ret = cpufreq_passive_register_notifier(devfreq);
   365			} else {
   366				ret = -EINVAL;
   367			}
   368			break;
   369		case DEVFREQ_GOV_STOP:
   370			if (p_data->parent_type == DEVFREQ_PARENT_DEV)
   371				WARN_ON(devfreq_unregister_notifier(parent, nb,
   372							DEVFREQ_TRANSITION_NOTIFIER));
   373			else if (p_data->parent_type == CPUFREQ_PARENT_DEV)
   374				WARN_ON(cpufreq_passive_unregister_notifier(devfreq));
   375			else
   376				ret = -EINVAL;
   377			break;
   378		default:
   379			break;
   380		}
   381	
   382		return ret;
   383	}
   384	

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

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

             reply	other threads:[~2021-09-16  0:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16  0:04 kernel test robot [this message]
2021-09-16  0:04 ` [chanwoo:devfreq-testing 4/4] drivers/devfreq/governor_passive.c:350:17: error: this 'if' clause does not guard kernel test robot

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=202109160813.kEdExbgm-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.