Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 27f9aea3 authored by Bhumika Goyal's avatar Bhumika Goyal Committed by Greg Kroah-Hartman
Browse files

Staging: lustre: lnet: Remove and rename struct typedefs



Remove typedefs from structures stt_timer_t and lst_ping_data_t as typedef
for a structure type is not preferred. The suffix '_t' and the typedefs
are removed using coccinelle.

Script 1:
//Drop typedefs and '_t'
@r1@
type T;
@@

typedef struct { ... } T;

@script:python c1@
T2;
T << r1.T;
@@
if T[-2:] =="_t":
  coccinelle.T2 = T[:-2];
  print T
else:
  coccinelle.T2=T;

@@
type r1.T;
identifier c1.T2;
@@
-typedef
struct
+ T2
{ ... }
-T
;

Script 2:
//Replacement
@@
typedef stt_timer_t;
typedef lst_ping_data_t;
@@
(
- stt_timer_t
+ struct stt_timer
|
- lst_ping_data_t
+ struct lst_ping_data
)

Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5210a63a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment