From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Petr Mladek <pmladek@suse.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
"Tobin C . Harding" <me@tobin.cc>,
Andrew Morton <akpm@linux-foundation.org>,
Jonathan Corbet <corbet@lwn.net>
Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH 1/3] lib/vsprintf: Prepare for more general use of ptr_to_id()
Date: Mon, 8 Oct 2018 13:05:02 +0200 [thread overview]
Message-ID: <20181008110504.25449-2-geert+renesas@glider.be> (raw)
In-Reply-To: <20181008110504.25449-1-geert+renesas@glider.be>
- Make the ptr argument const, to avoid adding casts in future
callers,
- Add a forward declaration, to avoid moving large blocks of code.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
lib/vsprintf.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 095a677f89c02442..b5bf90731c5a5277 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -407,6 +407,9 @@ struct printf_spec {
#define FIELD_WIDTH_MAX ((1 << 23) - 1)
#define PRECISION_MAX ((1 << 15) - 1)
+static char *ptr_to_id(char *buf, char *end, const void *ptr,
+ struct printf_spec spec);
+
static noinline_for_stack
char *number(char *buf, char *end, unsigned long long num,
struct printf_spec spec)
@@ -1714,7 +1717,8 @@ static int __init initialize_ptr_random(void)
early_initcall(initialize_ptr_random);
/* Maps a pointer to a 32 bit unique identifier. */
-static char *ptr_to_id(char *buf, char *end, void *ptr, struct printf_spec spec)
+static char *ptr_to_id(char *buf, char *end, const void *ptr,
+ struct printf_spec spec)
{
const char *str = sizeof(ptr) == 8 ? "(____ptrval____)" : "(ptrval)";
unsigned long hashval;
--
2.17.1
next prev parent reply other threads:[~2018-10-08 11:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-08 11:05 [PATCH 0/3] lib/vsprintf: Hash remaining raw addresses Geert Uytterhoeven
2018-10-08 11:05 ` Geert Uytterhoeven [this message]
2018-10-08 14:25 ` [PATCH 1/3] lib/vsprintf: Prepare for more general use of ptr_to_id() Andy Shevchenko
2018-10-08 14:37 ` Geert Uytterhoeven
2018-10-08 14:55 ` Andy Shevchenko
2018-10-09 13:56 ` Petr Mladek
2018-10-09 14:15 ` Geert Uytterhoeven
2018-10-08 11:05 ` [PATCH 2/3] lib/vsprintf: Hash legacy clock addresses Geert Uytterhoeven
2018-10-09 14:05 ` Petr Mladek
2018-10-08 11:05 ` [PATCH 3/3] lib/vsprintf: Hash printed address for netdev bits fallback Geert Uytterhoeven
2018-10-09 14:18 ` Petr Mladek
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=20181008110504.25449-2-geert+renesas@glider.be \
--to=geert+renesas@glider.be \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@tobin.cc \
--cc=pmladek@suse.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 NNTP newsgroup(s).