linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Alexey Gladkov <gladkov.alexey@gmail.com>, linux-sparse@vger.kernel.org
Subject: [PATCH] dissect: use show_ident() to print dctx->ident
Date: Wed, 12 Feb 2020 10:21:40 +0100	[thread overview]
Message-ID: <20200212092140.GA21571@redhat.com> (raw)

I didn't know show_ident() uses 4 buffers for the string it returns and
thus it is safe to call it twice in a row.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 dissect.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/dissect.c b/dissect.c
index 499e0a0..6706690 100644
--- a/dissect.c
+++ b/dissect.c
@@ -617,16 +617,13 @@ static inline struct symbol *do_symbol(struct symbol *sym)
 
 	break; case SYM_FN:
 		stmt = sym->ctype.modifiers & MOD_INLINE
-			? type->inline_stmt
-			: type->stmt;
+			? type->inline_stmt : type->stmt;
 		if (!stmt)
 			break;
 
 		if (dctx)
-			sparse_error(dctx->pos,
-				"dissect_ctx change %.*s -> %s",
-				dctx->ident->len, dctx->ident->name,
-				show_ident(sym->ident));
+			sparse_error(dctx->pos, "dissect_ctx change %s -> %s",
+				show_ident(dctx->ident), show_ident(sym->ident));
 
 		dissect_ctx = sym;
 		do_sym_list(type->arguments);
-- 
2.5.0

                 reply	other threads:[~2020-02-12  9:21 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=20200212092140.GA21571@redhat.com \
    --to=oleg@redhat.com \
    --cc=gladkov.alexey@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=luc.vanoostenryck@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 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).