Skip to content

Constify option structures

Gargi Sharma netfilter-devel outreachy 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4extensions: libebt_limit: Constify option structextensions/libebt_limit.c+1 -10 replies
2/4extenstions: libebt_mark_m: Constify option structextensions/libebt_mark_m.c+1 -10 replies
3/4extensions: libebt_mark: Constify option structextensions/libebt_mark.c+1 -10 replies
4/4extensions: libebt_nflog: Constify option structextensions/libebt_nflog.c+1 -10 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/4] Constify option structures

The struct option is generally used only to initialise fields inside certain structs and is not modified anywhere. Done using Coccinelle:

@r1 disable optional_qualifier@
identifier s,i;
position p;
@@

static struct option i@p[] ={...};

@ok1@
identifier r1.i;
expression e;
position p;
@@
e = i@p

@bad@
position p != {r1.p,ok1.p};
identifier r1.i;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct option i[] = { ... };

Gargi Sharma (4):
extensions: libebt_limit: Constify option struct
extenstions: libebt_mark_m: Constify option struct
extensions: libebt_mark: Constify option struct
extensions: libebt_nflog: Constify option struct

 extensions/libebt_limit.c  | 2 +-
 extensions/libebt_mark.c   | 2 +-
 extensions/libebt_mark_m.c | 2 +-
 extensions/libebt_nflog.c  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.7.4