From: Andrew Morton <akpm@linux-foundation.org>
To: kernel test robot <lkp@intel.com>
Cc: Andrey Konovalov <andreyknvl@google.com>,
kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Marco Elver <elver@google.com>,
Alexander Potapenko <glider@google.com>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: lib/test_kasan_module.c:25:6: warning: variable 'unused' set but not used
Date: Mon, 5 Apr 2021 12:29:08 -0700 [thread overview]
Message-ID: <20210405122908.a478d97cdc9495638e61b566@linux-foundation.org> (raw)
In-Reply-To: <202104050216.HflRxfJm-lkp@intel.com>
On Mon, 5 Apr 2021 02:16:25 +0800 kernel test robot <lkp@intel.com> wrote:
> Hi Andrey,
>
> First bad commit (maybe != root cause):
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 2023a53bdf41b7646b1d384b6816af06309f73a5
> commit: 5d92bdffd2d53f98de683229c0ad7d028703fdba kasan: rename CONFIG_TEST_KASAN_MODULE
> date: 6 weeks ago
> config: arm-randconfig-r024-20210404 (attached as .config)
> compiler: arm-linux-gnueabi-gcc (GCC) 9.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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5d92bdffd2d53f98de683229c0ad7d028703fdba
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout 5d92bdffd2d53f98de683229c0ad7d028703fdba
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
>
> 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 >>):
>
> lib/test_kasan_module.c: In function 'copy_user_test':
> >> lib/test_kasan_module.c:25:6: warning: variable 'unused' set but not used [-Wunused-but-set-variable]
> 25 | int unused;
> | ^~~~~~
Fair enough ;)
--- a/lib/test_kasan_module.c~a
+++ a/lib/test_kasan_module.c
@@ -22,7 +22,7 @@ static noinline void __init copy_user_te
char *kmem;
char __user *usermem;
size_t size = 10;
- int unused;
+ int __maybe_unused unused;
kmem = kmalloc(size, GFP_KERNEL);
if (!kmem)
_
I guess we could test the copy_*_user return values are as expected,
but that isn't the point?
prev parent reply other threads:[~2021-04-05 19:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-04 18:16 lib/test_kasan_module.c:25:6: warning: variable 'unused' set but not used kernel test robot
2021-04-05 19:29 ` Andrew Morton [this message]
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=20210405122908.a478d97cdc9495638e61b566@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=andreyknvl@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).