cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* Re: [Cocci] [PATCH v2 2/3] parsing_hacks: Add bool to list of known typedefs
@ 2020-01-21 10:10 Markus Elfring
  2020-01-21 11:06 ` Jaskaran Singh
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Elfring @ 2020-01-21 10:10 UTC (permalink / raw)
  To: Jaskaran Singh, cocci; +Cc: linux-kernel-mentees

> Before:
>   passed:bool

I wonder if subsequent duplicate information can really help to achieve a better understanding
by the suggested description of a software situation.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Cocci] [PATCH v2 2/3] parsing_hacks: Add bool to list of known typedefs
  2020-01-21 10:10 [Cocci] [PATCH v2 2/3] parsing_hacks: Add bool to list of known typedefs Markus Elfring
@ 2020-01-21 11:06 ` Jaskaran Singh
  2020-01-21 12:05   ` Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Jaskaran Singh @ 2020-01-21 11:06 UTC (permalink / raw)
  To: Markus Elfring; +Cc: linux-kernel-mentees, cocci

On Tue, 2020-01-21 at 11:10 +0100, Markus Elfring wrote:
> > Before:
> >   passed:bool
> 
> I wonder if subsequent duplicate information can really help to
> achieve a better understanding
> by the suggested description of a software situation.
> 

Hm, I thought it would but you're probably right. Should I just remove 
the second Before/After? The text above it about trace_kprobe.c
explains things anyway.

Cheers,
Jaskaran.

> Regards,
> Markus

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Cocci] [PATCH v2 2/3] parsing_hacks: Add bool to list of known typedefs
  2020-01-21 11:06 ` Jaskaran Singh
@ 2020-01-21 12:05   ` Julia Lawall
  0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2020-01-21 12:05 UTC (permalink / raw)
  To: Jaskaran Singh; +Cc: linux-kernel-mentees, Markus Elfring, cocci



On Tue, 21 Jan 2020, Jaskaran Singh wrote:

> On Tue, 2020-01-21 at 11:10 +0100, Markus Elfring wrote:
> > > Before:
> > >   passed:bool
> >
> > I wonder if subsequent duplicate information can really help to
> > achieve a better understanding
> > by the suggested description of a software situation.
> >
>
> Hm, I thought it would but you're probably right. Should I just remove
> the second Before/After? The text above it about trace_kprobe.c
> explains things anyway.

I find it helpful as is.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Cocci] [PATCH v2 2/3] parsing_hacks: Add bool to list of known typedefs
  2020-01-21  8:04 [Cocci] [PATCH v2 0/3] cocci: Improve management of macros before typedefs Jaskaran Singh
@ 2020-01-21  8:04 ` Jaskaran Singh
  0 siblings, 0 replies; 4+ messages in thread
From: Jaskaran Singh @ 2020-01-21  8:04 UTC (permalink / raw)
  To: cocci; +Cc: linux-kernel-mentees

bool is widely used in the Linux kernel. Certain cases of
parsing_hacks.ml would mislabel bool.

Add bool to the list of known typedefs.

Stats of --parse-c on Linux v5.5-rc4 are as follows:

Before:

  nb good = 18956150,  nb passed = 134062 =========> 0.70% passed

After:

  nb good = 18956150,  nb passed = 134073 =========> 0.70% passed

The increase in passed tokens is due to functions in
kernel/trace/trace_kprobe.c using nokprobe_inline. For instances of
nokprobe_inline bool, nokprobe_inline is labeled as a CppMacro.

Examples of this in the --parse-c diff are as follows:

Before:
  passed:bool
  passed:bool
  passed:bool
  passed:bool
  passed:bool

After:
  passed:nokprobe_inline
  passed:nokprobe_inline
  passed:nokprobe_inline
  passed:nokprobe_inline
  passed:nokprobe_inline
  passed:nokprobe_inline
  passed:nokprobe_inline

Signed-off-by: Jaskaran Singh <jaskaransingh7654321@gmail.com>
---
 parsing_c/parsing_hacks.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parsing_c/parsing_hacks.ml b/parsing_c/parsing_hacks.ml
index 23d675cf..42ad9ccc 100644
--- a/parsing_c/parsing_hacks.ml
+++ b/parsing_c/parsing_hacks.ml
@@ -61,7 +61,7 @@ let is_known_typdef =
       | "u_char"   | "u_short"  | "u_int"  | "u_long"
       | "u8" | "u16" | "u32" | "u64"
       | "s8"  | "s16" | "s32" | "s64"
-      | "__u8" | "__u16" | "__u32"  | "__u64"
+      | "__u8" | "__u16" | "__u32"  | "__u64" | "bool"
         -> true
 
       | "acpi_handle"
-- 
2.21.1

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-21 12:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21 10:10 [Cocci] [PATCH v2 2/3] parsing_hacks: Add bool to list of known typedefs Markus Elfring
2020-01-21 11:06 ` Jaskaran Singh
2020-01-21 12:05   ` Julia Lawall
  -- strict thread matches above, loose matches on Subject: below --
2020-01-21  8:04 [Cocci] [PATCH v2 0/3] cocci: Improve management of macros before typedefs Jaskaran Singh
2020-01-21  8:04 ` [Cocci] [PATCH v2 2/3] parsing_hacks: Add bool to list of known typedefs Jaskaran Singh

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).