cpusets: remove more casts

From: Paul Jackson
Date: Fri Sep 17 2004 - 06:28:25 EST


Remove some more casts of (void *) d_fsdata.

In gcc, unlike C++, these serve no good purpose, and can
hide valid errors if the type changes in the future.

Signed-off-by: Paul Jackson <pj@xxxxxxx>

Index: 2.6.9-rc2-mm1/kernel/cpuset.c
===================================================================
--- 2.6.9-rc2-mm1.orig/kernel/cpuset.c 2004-09-17 02:45:54.000000000 -0700
+++ 2.6.9-rc2-mm1/kernel/cpuset.c 2004-09-17 02:50:18.000000000 -0700
@@ -215,7 +215,7 @@ static void cpuset_diput(struct dentry *
{
/* is dentry a directory ? if so, kfree() associated cpuset */
if (S_ISDIR(inode->i_mode)) {
- struct cpuset *cs = (struct cpuset *)dentry->d_fsdata;
+ struct cpuset *cs = dentry->d_fsdata;
BUG_ON(!(is_removed(cs)));
kfree(cs);
}
@@ -351,12 +351,12 @@ struct cftype {

static inline struct cpuset *__d_cs(struct dentry *dentry)
{
- return (struct cpuset *)dentry->d_fsdata;
+ return dentry->d_fsdata;
}

static inline struct cftype *__d_cft(struct dentry *dentry)
{
- return (struct cftype *)dentry->d_fsdata;
+ return dentry->d_fsdata;
}

/*
@@ -1273,8 +1273,7 @@ err:

static int cpuset_mkdir(struct inode *dir, struct dentry *dentry, int mode)
{
- struct dentry *d_parent = dentry->d_parent;
- struct cpuset *c_parent = (struct cpuset *)d_parent->d_fsdata;
+ struct cpuset *c_parent = dentry->d_parent->d_fsdata;

/* the vfs holds inode->i_sem already */
return cpuset_create(c_parent, dentry->d_name.name, mode | S_IFDIR);
@@ -1282,7 +1281,7 @@ static int cpuset_mkdir(struct inode *di

static int cpuset_rmdir(struct inode *unused_dir, struct dentry *dentry)
{
- struct cpuset *cs = (struct cpuset *)dentry->d_fsdata;
+ struct cpuset *cs = dentry->d_fsdata;
struct dentry *d;
struct cpuset *parent;


--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@xxxxxxx> 1.650.933.1373
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/