diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2016-03-03 00:46:37 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-02 15:28:13 -0800 |
commit | 27f9aea3dbfc99dcc9b1a7e043838504aaf294a4 (patch) | |
tree | bb8aab7556a74aad377bc5117f89f8cafc7719f6 /drivers/staging/lustre/lnet/selftest/timer.c | |
parent | 5210a63ad9e58139ef378bb6668f2467e307fc70 (diff) | |
download | linux-27f9aea3dbfc99dcc9b1a7e043838504aaf294a4.tar.bz2 |
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: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lnet/selftest/timer.c')
-rw-r--r-- | drivers/staging/lustre/lnet/selftest/timer.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/staging/lustre/lnet/selftest/timer.c b/drivers/staging/lustre/lnet/selftest/timer.c index c89137182eee..f9f37baa1311 100644 --- a/drivers/staging/lustre/lnet/selftest/timer.c +++ b/drivers/staging/lustre/lnet/selftest/timer.c @@ -67,7 +67,7 @@ static struct st_timer_data { } stt_data; void -stt_add_timer(stt_timer_t *timer) +stt_add_timer(struct stt_timer *timer) { struct list_head *pos; @@ -81,7 +81,8 @@ stt_add_timer(stt_timer_t *timer) /* a simple insertion sort */ list_for_each_prev(pos, STTIMER_SLOT(timer->stt_expires)) { - stt_timer_t *old = list_entry(pos, stt_timer_t, stt_list); + struct stt_timer *old = list_entry(pos, struct stt_timer, + stt_list); if (timer->stt_expires >= old->stt_expires) break; @@ -101,7 +102,7 @@ stt_add_timer(stt_timer_t *timer) * another CPU. */ int -stt_del_timer(stt_timer_t *timer) +stt_del_timer(struct stt_timer *timer) { int ret = 0; @@ -124,10 +125,10 @@ static int stt_expire_list(struct list_head *slot, time64_t now) { int expired = 0; - stt_timer_t *timer; + struct stt_timer *timer; while (!list_empty(slot)) { - timer = list_entry(slot->next, stt_timer_t, stt_list); + timer = list_entry(slot->next, struct stt_timer, stt_list); if (timer->stt_expires > now) break; |