cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Jaskaran Singh <jaskaransingh7654321@gmail.com>
To: cocci@systeme.lip6.fr
Cc: linux-kernel-mentees@lists.linuxfoundation.org
Subject: [Cocci] [PATCH v2 13/25] cocci: standard.h: Annotate attributes with MACROANNOTATION
Date: Thu, 28 May 2020 17:54:15 +0530	[thread overview]
Message-ID: <20200528122428.4212-14-jaskaransingh7654321@gmail.com> (raw)
In-Reply-To: <20200528122428.4212-1-jaskaransingh7654321@gmail.com>

Apply the MACROANNOTATION hint to select attributes in standard.h. These
hints can be replaced, removed or added by the user as their use case
demands.

Signed-off-by: Jaskaran Singh <jaskaransingh7654321@gmail.com>
---
 standard.h | 116 ++++++++++++++++++++++++++---------------------------
 1 file changed, 58 insertions(+), 58 deletions(-)

diff --git a/standard.h b/standard.h
index 7a7f96ea..a25d2ae7 100644
--- a/standard.h
+++ b/standard.h
@@ -87,46 +87,46 @@
 // ----------------------------------------------------------------------------
 // Attributes. could perhaps generalize via "__.*"
 // ----------------------------------------------------------------------------
-#define  __init
-#define  __initconst
-#define  __page_aligned_data
-#define  __page_aligned_bss
-#define  __always_unused
-#define  __visible
-#define  __exit
-#define  __user
-#define  __iomem
-#define  __initdata
-#define  __exitdata
-#define  __devinit
-#define  __devexit
-#define  __devinitdata
-#define  __cpuinit
-#define  __cpuinitdata
-#define  __init_or_module
-#define  __initdata_or_module
-#define  __pminit
-#define  __pminitdata
-#define  __irq_entry
-
-#define  __cacheline_aligned
-#define  ____cacheline_aligned
-#define  __cacheline_aligned_in_smp
-#define  ____cacheline_aligned_in_smp
-#define  ____cacheline_internodealigned_in_smp
+#define  __init MACROANNOTATION
+#define  __initconst MACROANNOTATION
+#define  __page_aligned_data MACROANNOTATION
+#define  __page_aligned_bss MACROANNOTATION
+#define  __always_unused MACROANNOTATION
+#define  __visible MACROANNOTATION
+#define  __exit MACROANNOTATION
+#define  __user MACROANNOTATION
+#define  __iomem MACROANNOTATION
+#define  __initdata MACROANNOTATION
+#define  __exitdata MACROANNOTATION
+#define  __devinit MACROANNOTATION
+#define  __devexit MACROANNOTATION
+#define  __devinitdata MACROANNOTATION
+#define  __cpuinit MACROANNOTATION
+#define  __cpuinitdata MACROANNOTATION
+#define  __init_or_module MACROANNOTATION
+#define  __initdata_or_module MACROANNOTATION
+#define  __pminit MACROANNOTATION
+#define  __pminitdata MACROANNOTATION
+#define  __irq_entry MACROANNOTATION
+
+#define  __cacheline_aligned MACROANNOTATION
+#define  ____cacheline_aligned MACROANNOTATION
+#define  __cacheline_aligned_in_smp MACROANNOTATION
+#define  ____cacheline_aligned_in_smp MACROANNOTATION
+#define  ____cacheline_internodealigned_in_smp MACROANNOTATION
 
 #define  __ALIGNED__
 #define  __3xp_aligned
 
-#define  __pmac
-#define  __force
-#define  __nocast
-#define  __read_mostly
+#define  __pmac MACROANNOTATION
+#define  __force MACROANNOTATION
+#define  __nocast MACROANNOTATION
+#define  __read_mostly MACROANNOTATION
 
-#define  __must_check
+#define  __must_check MACROANNOTATION
 // pb
-#define  __unused
-#define  __maybe_unused
+#define  __unused MACROANNOTATION
+#define  __maybe_unused MACROANNOTATION
 
 
 #define  __attribute_used__
@@ -139,27 +139,27 @@
 #define  __xipram
 
 // in the other part of the kernel, in arch/, mm/, etc
-#define  __sched
-#define  __initmv
-#define  __exception
-#define  __cpuexit
-#define  __kprobes
-#define  __meminit
-#define  __meminitdata
-#define  __nosavedata
-#define  __kernel
-#define  __nomods_init
-#define  __apicdebuginit
-#define  __ipc_init
-#define  __modinit
-#define  __lockfunc
-#define  __weak
-#define  __tlb_handler_align
-#define  __lock_aligned
-#define  __force_data
-#define  __nongprelbss
-#define  __nongpreldata
-#define  __noreturn
+#define  __sched MACROANNOTATION
+#define  __initmv MACROANNOTATION
+#define  __exception MACROANNOTATION
+#define  __cpuexit MACROANNOTATION
+#define  __kprobes MACROANNOTATION
+#define  __meminit MACROANNOTATION
+#define  __meminitdata MACROANNOTATION
+#define  __nosavedata MACROANNOTATION
+#define  __kernel MACROANNOTATION
+#define  __nomods_init MACROANNOTATION
+#define  __apicdebuginit MACROANNOTATION
+#define  __ipc_init MACROANNOTATION
+#define  __modinit MACROANNOTATION
+#define  __lockfunc MACROANNOTATION
+#define  __weak MACROANNOTATION
+#define  __tlb_handler_align MACROANNOTATION
+#define  __lock_aligned MACROANNOTATION
+#define  __force_data MACROANNOTATION
+#define  __nongprelbss MACROANNOTATION
+#define  __nongpreldata MACROANNOTATION
+#define  __noreturn MACROANNOTATION
 
 #define  __section_jiffies
 #define  __vsyscall_fn
@@ -193,9 +193,9 @@
 
 
 // last last
-#define __net_init
-#define __net_exit
-#define __net_initdata
+#define __net_init MACROANNOTATION
+#define __net_exit MACROANNOTATION
+#define __net_initdata MACROANNOTATION
 
 #define __paginginit // in mm
 
-- 
2.21.1

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

  parent reply	other threads:[~2020-05-28 12:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 12:24 [Cocci] [PATCH v2 00/25] cocci: Improve C parsing of attributes Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 01/25] parsing_c: parse_c: Ignore TMacroAttr and TMacroEndAttr in passed tokens Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 02/25] parsing_c: parsing_hacks: Label end attributes correctly Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 03/25] parsing_c: parsing_hacks: Commentize attributes before qualif/type Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 04/25] parsing_c: parser: Add rule for multiple end attributes Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 05/25] parsing_c: parser: Add expression statement attributes Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 06/25] parsing_c: parser: Add attribute production in spec_qualif_list Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 07/25] parsing_c: parser: Add init_declarator_attrs rule Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 08/25] parsing_c: parser: Add field declaration end attributes production Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 09/25] parsing_c: parser: Handle struct/union/enum end attributes Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 10/25] parsing_c: parser: Add MacroDecl end attributes production Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 11/25] parsing_c: parser: cpp_other " Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 12/25] parsing_c: cpp_token_c: Introduce MACROANNOTATION hint Jaskaran Singh
2020-05-28 12:24 ` Jaskaran Singh [this message]
2020-05-28 12:24 ` [Cocci] [PATCH v2 14/25] parsing_c: visitor_c: Add vk_attribute and vk_attribute_s Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 15/25] parsing_c: lib_parsing_c: Add ii_of_attr Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 16/25] engine: Add distrf_attr to PARAM functor Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 17/25] engine: cocci_vs_c: Add allminus argument to attribute_list Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 18/25] parsing_c: parser: Make abstract_declarator pass attributes Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 19/25] cocci: Add parameter attributes to C AST Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 20/25] parsing_c: parser: Place parameter attributes in " Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 21/25] parsing_c: visitor_c: Visit parameter attributes Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 22/25] parsing_c: unparse_hrule: Add parameter attributes in record Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 23/25] parsing_c: type_c: Add parameter attributes to record Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 24/25] engine: cocci_vs_c: "Match" parameter attributes Jaskaran Singh
2020-05-28 12:24 ` [Cocci] [PATCH v2 25/25] engine: c_vs_c: Match " Jaskaran Singh
2020-05-28 13:29 ` [Cocci] [PATCH v3 20/25] parsing_c: parser: Place parameter attributes in C AST Jaskaran Singh

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=20200528122428.4212-14-jaskaransingh7654321@gmail.com \
    --to=jaskaransingh7654321@gmail.com \
    --cc=cocci@systeme.lip6.fr \
    --cc=linux-kernel-mentees@lists.linuxfoundation.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).