From: Himangi Saraogi <himangi774@gmail.com>
To: Dave Chinner <david@fromorbit.com>,
xfs@oss.sgi.com, linux-kernel@vger.kernel.org
Cc: Julia Lawall <julia.lawall@lip6.fr>
Subject: [PATCH] xfs: Remove typedef xfs_uu_t
Date: Wed, 6 Aug 2014 19:43:43 +0530 [thread overview]
Message-ID: <20140806141343.GA15659@himangi-Dell> (raw)
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@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
---
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@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2014-08-06 14:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-06 14:13 Himangi Saraogi [this message]
2014-08-06 14:28 ` [PATCH] xfs: Remove typedef xfs_uu_t Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140806141343.GA15659@himangi-Dell \
--to=himangi774@gmail.com \
--cc=david@fromorbit.com \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox