xfs
[Top] [All Lists]

[PATCH] xfs: Remove typedef xfs_uu_t

To: Dave Chinner <david@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
Subject: [PATCH] xfs: Remove typedef xfs_uu_t
From: Himangi Saraogi <himangi774@xxxxxxxxx>
Date: Wed, 6 Aug 2014 19:43:43 +0530
Cc: Julia Lawall <julia.lawall@xxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=c8elugR/fLL34/gek8yMUE8blV1xhjhshDDoEdBvxnw=; b=R6UrhBiRYcKNPmw40nbs6ypYo4w2vhNI6xtcjRqj/bXWLYmZI+JeM2zzNDY+w5Os0X murlYTM7qb7iMjjtbPLt2K+l6+wL0R7rWwPbPurANnCS6Gs7Nd3bSnU+6b2EqGPYKwyT weOwTEXyjcyRcm3d237CaNo5Kn9WswVlsDJhAudaXp8gavwErOdvee9d7jtzqUtuNppr IoadVLszmlBejJ7RgmDEjRo0FtAU84/ii6yjcl2zyi3l4yTbCSP/FVD+nTakpccpmOGA vIK8CFu5Ky0X75ccvHZpGrCJYmEW8xhWo5BcwDpSq9s52VtJK/9xGNPm8VeuNmYv8kJm kPaw==
User-agent: Mutt/1.5.21 (2010-09-15)
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

<Prev in Thread] Current Thread [Next in Thread>