diff mbox

sparse patch v2: add noclone as an ignored attribute

Message ID 5126B9E1.1070007@infradead.org (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Randy Dunlap Feb. 22, 2013, 12:20 a.m. UTC
From: Randy Dunlap <rdunlap@infradead.org>

Add attribute "noclone" or "__noclone" or "__noclone__" as an
ignored attribute. Fixes this sparse warning:

arch/x86/kvm/vmx.c:6268:13: error: attribute '__noclone__': unknown attribute

Also add test case for 'noclone': validation/attr-noclone.c.
'make check' says for this test case:
     TEST     attribute noclone (attr-noclone.c)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
 parse.c                   |    3 +++
 validation/attr-noclone.c |    9 +++++++++
 2 files changed, 12 insertions(+)

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Christopher Li Feb. 22, 2013, 12:56 a.m. UTC | #1
On Thu, Feb 21, 2013 at 4:20 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
>
> Add attribute "noclone" or "__noclone" or "__noclone__" as an
> ignored attribute. Fixes this sparse warning:

Thanks, applied.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- sparse-2013-0210.orig/parse.c
+++ sparse-2013-0210/parse.c
@@ -541,6 +541,9 @@  const char *ignored_attributes[] = {
 	"__naked__",
 	"no_instrument_function",
 	"__no_instrument_function__",
+	"noclone",
+	"__noclone",
+	"__noclone__",
 	"noinline",
 	"__noinline__",
 	"nonnull",
--- /dev/null
+++ sparse-2013-0210/validation/attr-noclone.c
@@ -0,0 +1,9 @@ 
+#define noclone		__attribute__((__noclone__))
+
+static void noclone bar(void)
+{
+}
+
+/*
+ * check-name: attribute noclone
+ */