public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Howells <dhowells@redhat.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	Johannes Weiner <hannes@cmpxchg.org>, Ingo Molnar <mingo@elte.hu>,
	Adrian Bunk <bunk@stusta.de>, Randy Dunlap <rdunlap@xenotime.net>,
	Michel Lespinasse <walken@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [hnaz-mm:master 478/481] kernel/synchro-test.c:393:49: warning: variable 'zeros' set but not used
Date: Tue, 29 Mar 2022 22:02:34 +0800	[thread overview]
Message-ID: <202203292115.plWUiMYU-lkp@intel.com> (raw)

tree:   https://github.com/hnaz/linux-mm master
head:   673977c1d5c4c5bc15abf8f01ebaddc66116a9cd
commit: 52880bd2b8272052d5ccf95f94704a959796c9f6 [478/481] mutex subsystem, synchro-test module
config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20220329/202203292115.plWUiMYU-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0f6d9501cf49ce02937099350d08f20c4af86f3d)
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/hnaz/linux-mm/commit/52880bd2b8272052d5ccf95f94704a959796c9f6
        git remote add hnaz-mm https://github.com/hnaz/linux-mm
        git fetch --no-tags hnaz-mm master
        git checkout 52880bd2b8272052d5ccf95f94704a959796c9f6
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash

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 >>):

   kernel/synchro-test.c:267:2: error: implicit declaration of function 'complete_and_exit' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           complete_and_exit(&sp_comp[N], 0);
           ^
   kernel/synchro-test.c:268:1: error: non-void function does not return a value [-Werror,-Wreturn-type]
   }
   ^
   kernel/synchro-test.c:288:2: error: implicit declaration of function 'complete_and_exit' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           complete_and_exit(&mx_comp[N], 0);
           ^
   kernel/synchro-test.c:289:1: error: non-void function does not return a value [-Werror,-Wreturn-type]
   }
   ^
   kernel/synchro-test.c:309:2: error: implicit declaration of function 'complete_and_exit' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           complete_and_exit(&sm_comp[N], 0);
           ^
   kernel/synchro-test.c:310:1: error: non-void function does not return a value [-Werror,-Wreturn-type]
   }
   ^
   kernel/synchro-test.c:332:2: error: implicit declaration of function 'complete_and_exit' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           complete_and_exit(&rd_comp[N], 0);
           ^
   kernel/synchro-test.c:333:1: error: non-void function does not return a value [-Werror,-Wreturn-type]
   }
   ^
   kernel/synchro-test.c:355:2: error: implicit declaration of function 'complete_and_exit' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           complete_and_exit(&wr_comp[N], 0);
           ^
   kernel/synchro-test.c:356:1: error: non-void function does not return a value [-Werror,-Wreturn-type]
   }
   ^
   kernel/synchro-test.c:383:2: error: implicit declaration of function 'complete_and_exit' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           complete_and_exit(&dg_comp[N], 0);
           ^
   kernel/synchro-test.c:384:1: error: non-void function does not return a value [-Werror,-Wreturn-type]
   }
   ^
>> kernel/synchro-test.c:393:49: warning: variable 'zeros' set but not used [-Wunused-but-set-variable]
           unsigned int tot = 0, max = 0, min = UINT_MAX, zeros = 0, cnt;
                                                          ^
   1 warning and 12 errors generated.


vim +/zeros +393 kernel/synchro-test.c

   390	
   391	static unsigned int total(const char *what, unsigned int counts[], int num)
   392	{
 > 393		unsigned int tot = 0, max = 0, min = UINT_MAX, zeros = 0, cnt;
   394		int loop;
   395	
   396		for (loop = 0; loop < num; loop++) {
   397			cnt = counts[loop];
   398	
   399			if (cnt == 0) {
   400				zeros++;
   401				min = 0;
   402				continue;
   403			}
   404	
   405			tot += cnt;
   406			if (tot > max)
   407				max = tot;
   408			if (tot < min)
   409				min = tot;
   410		}
   411	
   412		if (verbose && tot > 0) {
   413			printk("%s:", what);
   414	
   415			for (loop = 0; loop < num; loop++) {
   416				cnt = counts[loop];
   417	
   418				if (cnt == 0)
   419					printk(" zzz");
   420				else
   421					printk(" %d%%", cnt * 100 / tot);
   422			}
   423	
   424			printk("\n");
   425		}
   426	
   427		return tot;
   428	}
   429	

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

                 reply	other threads:[~2022-03-29 14:03 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=202203292115.plWUiMYU-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=bunk@stusta.de \
    --cc=dhowells@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=mingo@elte.hu \
    --cc=rdunlap@xenotime.net \
    --cc=walken@google.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