linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jaewon Kim <jaewon31.kim@samsung.com>
To: "pmladek@suse.com" <pmladek@suse.com>,
	"senozhatsky@chromium.org" <senozhatsky@chromium.org>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jaewon31.kim@gmail.com" <jaewon31.kim@gmail.com>,
	GyeongHwan Hong <gh21.hong@samsung.com>
Subject: [RFC] vsprintf: compile error on %09pK
Date: Mon, 03 Apr 2023 19:46:17 +0900	[thread overview]
Message-ID: <20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p3> (raw)
In-Reply-To: <CGME20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p3>

Hello

I've just changed %09lx to %09pK on my driver code to hide the address, but I
faced compiler error. The %9pK without 0 worked.

Is there restriction on %pK which does now allow %0 ? I've wondered whether I
did wrong or it is a printk problem.

To show easily I tried to add pr_info("%09pK\n", nodemask); in page_alloc.c
Then here's what I did.

$ ARCH=x86 make x86_64_defconfig ; make mm/page_alloc.o
#
# No change to .config
#
  CALL    scripts/checksyscalls.sh
  DESCEND objtool
  INSTALL libsubcmd_headers
  CC      mm/page_alloc.o
In file included from ./include/asm-generic/bug.h:22:0,
                 from ./arch/x86/include/asm/bug.h:87,
                 from ./include/linux/bug.h:5,
                 from ./include/linux/mmdebug.h:5,
                 from ./include/linux/mm.h:6,
                 from mm/page_alloc.c:19:
mm/page_alloc.c: In function ‘__alloc_pages’:
./include/linux/kern_levels.h:5:18: error: '0' flag used with ‘%p’ gnu_printf format [-Werror=format=]
 #define KERN_SOH "\001"  /* ASCII Start Of Header */
                  ^
./include/linux/printk.h:427:11: note: in definition of macro ‘printk_index_wrap’
   _p_func(_fmt, ##__VA_ARGS__);    \
           ^
./include/linux/printk.h:528:2: note: in expansion of macro ‘printk’
  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
  ^
./include/linux/kern_levels.h:14:19: note: in expansion of macro ‘KERN_SOH’
 #define KERN_INFO KERN_SOH "6" /* informational */
                   ^
./include/linux/printk.h:528:9: note: in expansion of macro ‘KERN_INFO’
  printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
         ^
mm/page_alloc.c:5564:2: note: in expansion of macro ‘pr_info’
  pr_info("%09pK\n", nodemask);
  ^

Jaewon Kim


       reply	other threads:[~2023-04-03 10:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p3>
2023-04-03 10:46 ` Jaewon Kim [this message]
2023-04-03 12:18   ` Sergey Senozhatsky
2023-04-03 12:53   ` Petr Mladek
2023-04-03 14:39     ` Jaewon Kim
2023-04-03 15:34       ` Sergey Senozhatsky
2023-04-03 16:04       ` David Laight
     [not found]       ` <CGME20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p6>
2023-04-04 10:12         ` Jaewon Kim
2023-04-04 12:03           ` Petr Mladek
     [not found]           ` <CGME20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p1>
2023-04-04 12:33             ` Jaewon Kim
     [not found]       ` <CGME20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p5>
2023-04-04 10:16         ` Jaewon Kim

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=20230403104617epcms1p383bacbca705c0d7e4fffca6833050e42@epcms1p3 \
    --to=jaewon31.kim@samsung.com \
    --cc=gh21.hong@samsung.com \
    --cc=jaewon31.kim@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pmladek@suse.com \
    --cc=senozhatsky@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox