Skip to content

create FLEX_ALLOC_MEM to FLEX_ALLOC_STR cocci rule

Denton Liu git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2midx.c: convert FLEX_ALLOC_MEM to FLEX_ALLOC_STRmidx.c+1 -10 replies
2/2cocci: FLEX_ALLOC_MEM to FLEX_ALLOC_STRcontrib/coccinelle/flex_alloc.cocci+13 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] create FLEX_ALLOC_MEM to FLEX_ALLOC_STR cocci rule

I was playing around with coccinelle and I noticed that we have a use of FLEX_ALLOC_MEM that could be converted into FLEX_ALLOC_STR. Convert it and write a cocci rule to prevent this from happening.

Note that this was more of an exercise to teach myself how to use coccinelle. I'm just submitting a useful patch that came as a result of this. Please let me know if this is unwelcome.

Denton Liu (2):
midx.c: convert FLEX_ALLOC_MEM to FLEX_ALLOC_STR
cocci: FLEX_ALLOC_MEM to FLEX_ALLOC_STR

 contrib/coccinelle/flex_alloc.cocci | 13 +++++++++++++
 midx.c                              |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 contrib/coccinelle/flex_alloc.cocci
Signature · 1 line
2.21.0.834.geaa57a21fa