From: kernel test robot <lkp@intel.com>
To: Tamir Duberstein <tamird@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Kees Cook <kees@kernel.org>, Petr Mladek <pmladek@suse.com>
Subject: lib/tests/printf_kunit.c:740:49: sparse: sparse: cast from restricted gfp_t
Date: Mon, 02 Mar 2026 16:10:11 +0800 [thread overview]
Message-ID: <202603021615.d6FkL331-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 11439c4635edd669ae435eec308f4ab8a0804808
commit: 7a79e7daa84e230266184a2018507551086c2317 printf: convert self-test to KUnit
date: 12 months ago
config: sparc64-randconfig-r132-20260302 (https://download.01.org/0day-ci/archive/20260302/202603021615.d6FkL331-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 8.5.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260302/202603021615.d6FkL331-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603021615.d6FkL331-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> lib/tests/printf_kunit.c:740:49: sparse: sparse: cast from restricted gfp_t
lib/tests/printf_kunit.c:744:58: sparse: sparse: cast from restricted gfp_t
vim +740 lib/tests/printf_kunit.c
c244297acbe51f lib/test_printf.c Yafang Shao 2021-03-19 702
7a79e7daa84e23 lib/tests/printf_kunit.c Tamir Duberstein 2025-03-07 703 static void
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 704 flags(void)
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 705 {
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 706 unsigned long flags;
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 707 char *cmp_buffer;
c244297acbe51f lib/test_printf.c Yafang Shao 2021-03-19 708 gfp_t gfp;
c244297acbe51f lib/test_printf.c Yafang Shao 2021-03-19 709
c244297acbe51f lib/test_printf.c Yafang Shao 2021-03-19 710 cmp_buffer = kmalloc(BUF_SIZE, GFP_KERNEL);
c244297acbe51f lib/test_printf.c Yafang Shao 2021-03-19 711 if (!cmp_buffer)
c244297acbe51f lib/test_printf.c Yafang Shao 2021-03-19 712 return;
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 713
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 714 flags = 0;
c244297acbe51f lib/test_printf.c Yafang Shao 2021-03-19 715 page_flags_test(0, 0, 0, 0, 0, flags, "", cmp_buffer);
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 716
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 717 flags = 1UL << NR_PAGEFLAGS;
c244297acbe51f lib/test_printf.c Yafang Shao 2021-03-19 718 page_flags_test(0, 0, 0, 0, 0, flags, "", cmp_buffer);
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 719
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 720 flags |= 1UL << PG_uptodate | 1UL << PG_dirty | 1UL << PG_lru
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 721 | 1UL << PG_active | 1UL << PG_swapbacked;
c244297acbe51f lib/test_printf.c Yafang Shao 2021-03-19 722 page_flags_test(1, 1, 1, 0x1fffff, 1, flags,
c244297acbe51f lib/test_printf.c Yafang Shao 2021-03-19 723 "uptodate|dirty|lru|active|swapbacked",
c244297acbe51f lib/test_printf.c Yafang Shao 2021-03-19 724 cmp_buffer);
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 725
8d0920bde5eb8e lib/test_printf.c David Hildenbrand 2021-04-22 726 flags = VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC;
8d0920bde5eb8e lib/test_printf.c David Hildenbrand 2021-04-22 727 test("read|exec|mayread|maywrite|mayexec", "%pGv", &flags);
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 728
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 729 gfp = GFP_TRANSHUGE;
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 730 test("GFP_TRANSHUGE", "%pGg", &gfp);
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 731
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 732 gfp = GFP_ATOMIC|__GFP_DMA;
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 733 test("GFP_ATOMIC|GFP_DMA", "%pGg", &gfp);
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 734
2973d8229b78d3 lib/test_printf.c NeilBrown 2023-01-13 735 gfp = __GFP_HIGH;
2973d8229b78d3 lib/test_printf.c NeilBrown 2023-01-13 736 test("__GFP_HIGH", "%pGg", &gfp);
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 737
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 738 /* Any flags not translated by the table should remain numeric */
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 739 gfp = ~__GFP_BITS_MASK;
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 @740 snprintf(cmp_buffer, BUF_SIZE, "%#lx", (unsigned long) gfp);
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 741 test(cmp_buffer, "%pGg", &gfp);
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 742
2973d8229b78d3 lib/test_printf.c NeilBrown 2023-01-13 743 snprintf(cmp_buffer, BUF_SIZE, "__GFP_HIGH|%#lx",
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 744 (unsigned long) gfp);
2973d8229b78d3 lib/test_printf.c NeilBrown 2023-01-13 745 gfp |= __GFP_HIGH;
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 746 test(cmp_buffer, "%pGg", &gfp);
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 747
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 748 kfree(cmp_buffer);
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 749 }
edf14cdbf9a0e5 lib/test_printf.c Vlastimil Babka 2016-03-15 750
:::::: The code at line 740 was first introduced by commit
:::::: edf14cdbf9a0e5ab52698ca66d07a76ade0d5c46 mm, printk: introduce new format string for flags
:::::: TO: Vlastimil Babka <vbabka@suse.cz>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-03-02 8:10 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=202603021615.d6FkL331-lkp@intel.com \
--to=lkp@intel.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=pmladek@suse.com \
--cc=tamird@gmail.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 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.