[PATCH] xfs: Remove typedef xfs_uu_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The Linux kernel coding style guidelines suggest not using typedefs
for structure types. This patch gets rid of the typedef for xfs_uu_t.
Also the names of the struct is changed to drop the _t, to make the
name look less typedef-like.

The following Coccinelle semantic patch detects the case.

@tn1@
type td;
@@

typedef struct { ... } td;

@script:python tf@
td << tn1.td;
tdres;
@@

coccinelle.tdres = td;

@@
type tn1.td;
identifier tf.tdres;
@@

-typedef
 struct 
+  tdres
   { ... }
-td
 ;

@@
type tn1.td;
identifier tf.tdres;
@@

(
-td
+ struct tdres
|
 const
- td
+ struct tdres
)

Signed-off-by: Himangi Saraogi <himangi774@xxxxxxxxx>
Acked-by: Julia Lawall <julia.lawall@xxxxxxx>
---
 fs/xfs/uuid.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/xfs/uuid.c b/fs/xfs/uuid.c
index b83f76b..1f21d8f 100644
--- a/fs/xfs/uuid.c
+++ b/fs/xfs/uuid.c
@@ -18,13 +18,13 @@
 #include <xfs.h>
 
 /* IRIX interpretation of an uuid_t */
-typedef struct {
+struct xfs_uu {
 	__be32	uu_timelow;
 	__be16	uu_timemid;
 	__be16	uu_timehi;
 	__be16	uu_clockseq;
 	__be16	uu_node[3];
-} xfs_uu_t;
+};
 
 /*
  * uuid_getnodeuniq - obtain the node unique fields of a UUID.
@@ -35,7 +35,7 @@ typedef struct {
 void
 uuid_getnodeuniq(uuid_t *uuid, int fsid [2])
 {
-	xfs_uu_t *uup = (xfs_uu_t *)uuid;
+	struct xfs_uu *uup = (struct xfs_uu *)uuid;
 
 	fsid[0] = (be16_to_cpu(uup->uu_clockseq) << 16) |
 		   be16_to_cpu(uup->uu_timemid);
-- 
1.9.1

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux