Staging: lustre: libcfs: Remove typedefs for struct
authorShraddha Barke <shraddha.6596@gmail.com>
Fri, 4 Sep 2015 06:38:40 +0000 (12:08 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 01:24:47 +0000 (18:24 -0700)
The Linux kernel coding style guidelines suggest not using typedefs for
structure and enum types. This patch gets rid of the typedefs for
cfs_wi_sched_t.

The following Coccinelle semantic patch detects the cases for struct type:

@tn@
identifier i;
type td;
@@

-typedef
 struct i { ... }
-td
 ;

@@
type tn.td;
identifier tn.i;
@@

-td
+ struct i

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/libcfs/workitem.c

index 48009b7..02d18f5 100644 (file)
@@ -45,7 +45,7 @@
 
 #define CFS_WS_NAME_LEN         16
 
-typedef struct cfs_wi_sched {
+struct cfs_wi_sched {
        struct list_head                ws_list;        /* chain on global list */
        /** serialised workitems */
        spinlock_t              ws_lock;
@@ -73,7 +73,7 @@ typedef struct cfs_wi_sched {
        unsigned int            ws_starting:1;
        /** scheduler name */
        char                    ws_name[CFS_WS_NAME_LEN];
-} cfs_wi_sched_t;
+};
 
 static struct cfs_workitem_data {
        /** serialize */
@@ -87,19 +87,19 @@ static struct cfs_workitem_data {
 } cfs_wi_data;
 
 static inline void
-cfs_wi_sched_lock(cfs_wi_sched_t *sched)
+cfs_wi_sched_lock(struct cfs_wi_sched *sched)
 {
        spin_lock(&sched->ws_lock);
 }
 
 static inline void
-cfs_wi_sched_unlock(cfs_wi_sched_t *sched)
+cfs_wi_sched_unlock(struct cfs_wi_sched *sched)
 {
        spin_unlock(&sched->ws_lock);
 }
 
 static inline int
-cfs_wi_sched_cansleep(cfs_wi_sched_t *sched)
+cfs_wi_sched_cansleep(struct cfs_wi_sched *sched)
 {
        cfs_wi_sched_lock(sched);
        if (sched->ws_stopping) {
@@ -221,7 +221,7 @@ EXPORT_SYMBOL(cfs_wi_schedule);
 static int
 cfs_wi_scheduler (void *arg)
 {
-       struct cfs_wi_sched     *sched = (cfs_wi_sched_t *)arg;
+       struct cfs_wi_sched     *sched = (struct cfs_wi_sched *)arg;
 
        cfs_block_allsigs();