linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kim Phillips <kim.phillips@freescale.com>
To: linux-sparse@vger.kernel.org
Cc: Christopher Li <sparse@chrisli.org>
Subject: [PATCH] sparse: add built-in byte swap identifiers
Date: Mon, 18 Feb 2013 18:36:29 -0600	[thread overview]
Message-ID: <20130218183629.d2a9238ac848758359582e28@freescale.com> (raw)

this patch stops sparse from complaining about them not being
defined:

include/uapi/linux/swab.h:60:16: error: undefined identifier '__builtin_bswap32'
include/uapi/linux/swab.h:60:33: error: not a function <noident>

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
Based on:

git://git.kernel.org/pub/scm/devel/sparse/chrisl/sparse.git

since it's more up-to-date than:

git://git.kernel.org/pub/scm/devel/sparse/sparse.git

which is what's advertised as the main sparse tree, here:

https://sparse.wiki.kernel.org/index.php/Main_Page

 lib.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib.c b/lib.c
index 6bd10d3..4f69e11 100644
--- a/lib.c
+++ b/lib.c
@@ -727,6 +727,11 @@ void declare_builtin_functions(void)
 	add_pre_buffer("extern int __builtin_popcountl(unsigned long);\n");
 	add_pre_buffer("extern int __builtin_popcountll(unsigned long long);\n");
 
+	/* And byte swaps.. */
+	add_pre_buffer("extern unsigned short __builtin_bswap16(unsigned short);\n");
+	add_pre_buffer("extern unsigned int __builtin_bswap32(unsigned int);\n");
+	add_pre_buffer("extern unsigned long long __builtin_bswap64(unsigned long long);\n");
+
 	/* And some random ones.. */
 	add_pre_buffer("extern void *__builtin_return_address(unsigned int);\n");
 	add_pre_buffer("extern void *__builtin_extract_return_addr(void *);\n");
-- 
1.7.9.7


             reply	other threads:[~2013-02-19  0:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-19  0:36 Kim Phillips [this message]
2013-02-19  5:59 ` [PATCH] sparse: add built-in byte swap identifiers Christopher Li
2013-02-19 17:41   ` [PATCH v2] " Kim Phillips
2013-02-19 19:13     ` Christopher Li

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=20130218183629.d2a9238ac848758359582e28@freescale.com \
    --to=kim.phillips@freescale.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.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;
as well as URLs for NNTP newsgroup(s).