Linux SPARSE checker discussions
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Linux-Sparse <linux-sparse@vger.kernel.org>,
	Christopher Li <sparse@chrisli.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH] sparse: ignore indirect_branch attribute
Date: Tue, 13 Feb 2018 13:52:54 -0800	[thread overview]
Message-ID: <c97d360f-a0d2-8c0d-b951-e064843ff4d8@infradead.org> (raw)

From: Randy Dunlap <rdunlap@infradead.org>

Teach sparse about the "indirect_branch" attribute as used in
Linux kernel:
#define __noretpoline __attribute__((indirect_branch("keep")))
and tell sparse to ignore it.

This eliminates over 148K warnings (which also cause the
0day bot to send error reports uselessly).

Or does sparse need to do something with it?

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
 gcc-attr-list.h |    1 +
 1 file changed, 1 insertion(+)

--- sparse-2018-02-13.orig/gcc-attr-list.h
+++ sparse-2018-02-13/gcc-attr-list.h
@@ -62,6 +62,7 @@ GCC_ATTR(hidden)
 GCC_ATTR(hot)
 GCC_ATTR(hotpatch)
 GCC_ATTR(ifunc)
+GCC_ATTR(indirect_branch)
 GCC_ATTR(init_priority)
 GCC_ATTR(interfacearm)
 GCC_ATTR(internal)



             reply	other threads:[~2018-02-13 21:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-13 21:52 Randy Dunlap [this message]
2018-02-13 22:12 ` [PATCH] sparse: ignore indirect_branch attribute Luc Van Oostenryck
2018-02-15 20:42   ` Luc Van Oostenryck

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=c97d360f-a0d2-8c0d-b951-e064843ff4d8@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.org \
    --cc=torvalds@linux-foundation.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