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

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
+2 −2
Original line number Diff line number Diff line
@@ -1173,7 +1173,7 @@ lstcon_rpc_trans_ndlist(struct list_head *ndlist,
static void
lstcon_rpc_pinger(void *arg)
{
	stt_timer_t *ptimer = (stt_timer_t *)arg;
	struct stt_timer *ptimer = (struct stt_timer *)arg;
	lstcon_rpc_trans_t *trans;
	lstcon_rpc_t *crpc;
	srpc_msg_t *rep;
@@ -1290,7 +1290,7 @@ lstcon_rpc_pinger(void *arg)
int
lstcon_rpc_pinger_start(void)
{
	stt_timer_t *ptimer;
	struct stt_timer *ptimer;
	int rc;

	LASSERT(list_empty(&console_session.ses_rpc_freelist));
+1 −1
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ struct lstcon_session {
	__u64               ses_id_cookie;    /* batch id cookie */
	char                ses_name[LST_NAME_SIZE];/* session name */
	lstcon_rpc_trans_t  *ses_ping;        /* session pinger */
	stt_timer_t         ses_ping_timer;   /* timer for pinger */
	struct stt_timer         ses_ping_timer;   /* timer for pinger */
	lstcon_trans_stat_t ses_trans_stat;   /* transaction stats */

	struct list_head    ses_trans_list;   /* global list of transaction */
+2 −2
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ static void
sfw_add_session_timer(void)
{
	sfw_session_t *sn = sfw_data.fw_session;
	stt_timer_t *timer = &sn->sn_timer;
	struct stt_timer *timer = &sn->sn_timer;

	LASSERT(!sfw_data.fw_shuttingdown);

@@ -261,7 +261,7 @@ static inline void
sfw_init_session(sfw_session_t *sn, lst_sid_t sid,
		 unsigned features, const char *name)
{
	stt_timer_t *timer = &sn->sn_timer;
	struct stt_timer *timer = &sn->sn_timer;

	memset(sn, 0, sizeof(sfw_session_t));
	INIT_LIST_HEAD(&sn->sn_list);
+3 −3
Original line number Diff line number Diff line
@@ -48,12 +48,12 @@ static int ping_srv_workitems = SFW_TEST_WI_MAX;
module_param(ping_srv_workitems, int, 0644);
MODULE_PARM_DESC(ping_srv_workitems, "# PING server workitems");

typedef struct {
struct lst_ping_data {
	spinlock_t	pnd_lock;	/* serialize */
	int		pnd_counter;	/* sequence counter */
} lst_ping_data_t;
};

static lst_ping_data_t  lst_ping_data;
static struct lst_ping_data  lst_ping_data;

static int
ping_client_init(sfw_test_instance_t *tsi)
+1 −1
Original line number Diff line number Diff line
@@ -1100,7 +1100,7 @@ srpc_client_rpc_expired(void *data)
static void
srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc)
{
	stt_timer_t *timer = &rpc->crpc_timer;
	struct stt_timer *timer = &rpc->crpc_timer;

	if (!rpc->crpc_timeout)
		return;
Loading