mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	0day robot <lkp@intel.com>, Junwen Wu <wudaemon@163.com>
Subject: drivers/thermal/thermal_sysfs.c:794:5: warning: ISO C90 forbids mixed declarations and code
Date: Mon, 9 May 2022 05:21:31 +0800	[thread overview]
Message-ID: <202205090558.EnCJkmXp-lkp@intel.com> (raw)

tree:   https://github.com/intel-lab-lkp/linux/commits/UPDATE-20220508-232600/Zhang-Rui/thermal-thermal_stats-skip-broken-trans_table/20220419-165035
head:   a9158ddd9f2a97e356583d0bdb81c4e6822e6ad7
commit: a9158ddd9f2a97e356583d0bdb81c4e6822e6ad7 thermal/core: change mm alloc method to avoid kernel warning
date:   6 hours ago
config: arc-randconfig-r032-20220508 (https://download.01.org/0day-ci/archive/20220509/202205090558.EnCJkmXp-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.3.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://github.com/intel-lab-lkp/linux/commit/a9158ddd9f2a97e356583d0bdb81c4e6822e6ad7
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review UPDATE-20220508-232600/Zhang-Rui/thermal-thermal_stats-skip-broken-trans_table/20220419-165035
        git checkout a9158ddd9f2a97e356583d0bdb81c4e6822e6ad7
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash drivers/thermal/

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

All warnings (new ones prefixed by >>):

   drivers/thermal/thermal_sysfs.c: In function 'find_show_state':
>> drivers/thermal/thermal_sysfs.c:794:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     794 |     int l = min, r = max, mid, cnt = 0;
         |     ^~~


vim +794 drivers/thermal/thermal_sysfs.c

   785	
   786	static int find_show_state( int *nums, int numsSize, int k, unsigned int *max_value)
   787	{
   788	    int i, min = INT_MAX, max = 0;
   789	    for( i = 0; i < numsSize; ++i )
   790	    {
   791	        min = nums[i] < min ? nums[i] : min;
   792	        max = nums[i] > max ? nums[i] : max;
   793	    }
 > 794	    int l = min, r = max, mid, cnt = 0;
   795	    while( l < r )
   796	    {
   797	        mid = r - (r - l) / 2;
   798	        for( i = 0; i < numsSize; ++i )
   799	        {
   800	            if( nums[i] >= mid )
   801	                ++cnt;
   802	        }
   803	        if( cnt < k )
   804	        {
   805	            r = mid - 1;
   806	            cnt = 0;
   807	        }
   808	        else
   809	        {
   810	            l = mid;
   811	            cnt = 0;
   812	        }
   813	    }
   814	     *max_value = max;
   815	    return l;
   816	}
   817	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

             reply	other threads:[~2022-05-08 21:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-08 21:21 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-05-08 18:18 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=202205090558.EnCJkmXp-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wudaemon@163.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®