aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-21 19:28:26 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-21 19:28:26 -0400
commit1b18dc2beb31f588db1c75901b0112324c72124f (patch)
tree45050bf98417716cd934da104891ad6b403f67c1 /fs
parentab9bf4be4dd58f8ae1961180e008b7e3022f08b5 (diff)
sysfs: fix up space coding style issues
This fixes up all of the space-related coding style issues for the sysfs code. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/sysfs/bin.c4
-rw-r--r--fs/sysfs/dir.c20
-rw-r--r--fs/sysfs/file.c32
-rw-r--r--fs/sysfs/inode.c10
-rw-r--r--fs/sysfs/mount.c2
-rw-r--r--fs/sysfs/symlink.c4
6 files changed, 36 insertions, 36 deletions
diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index 745f57f7d089..26861e5a9fc4 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -391,7 +391,7 @@ out_unlock:
391 return rc; 391 return rc;
392} 392}
393 393
394static int open(struct inode * inode, struct file * file) 394static int open(struct inode *inode, struct file *file)
395{ 395{
396 struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata; 396 struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata;
397 struct bin_attribute *attr = attr_sd->s_bin_attr.bin_attr; 397 struct bin_attribute *attr = attr_sd->s_bin_attr.bin_attr;
@@ -435,7 +435,7 @@ static int open(struct inode * inode, struct file * file)
435 return error; 435 return error;
436} 436}
437 437
438static int release(struct inode * inode, struct file * file) 438static int release(struct inode *inode, struct file *file)
439{ 439{
440 struct bin_buffer *bb = file->private_data; 440 struct bin_buffer *bb = file->private_data;
441 441
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 32244cd157a7..e993133aa969 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -46,7 +46,7 @@ static unsigned int sysfs_name_hash(const void *ns, const char *name)
46 unsigned int len = strlen(name); 46 unsigned int len = strlen(name);
47 while (len--) 47 while (len--)
48 hash = partial_name_hash(*name++, hash); 48 hash = partial_name_hash(*name++, hash);
49 hash = ( end_name_hash(hash) ^ hash_ptr( (void *)ns, 31 ) ); 49 hash = (end_name_hash(hash) ^ hash_ptr((void *)ns, 31));
50 hash &= 0x7fffffffU; 50 hash &= 0x7fffffffU;
51 /* Reserve hash numbers 0, 1 and INT_MAX for magic directory entries */ 51 /* Reserve hash numbers 0, 1 and INT_MAX for magic directory entries */
52 if (hash < 1) 52 if (hash < 1)
@@ -258,7 +258,7 @@ static void sysfs_free_ino(unsigned int ino)
258 spin_unlock(&sysfs_ino_lock); 258 spin_unlock(&sysfs_ino_lock);
259} 259}
260 260
261void release_sysfs_dirent(struct sysfs_dirent * sd) 261void release_sysfs_dirent(struct sysfs_dirent *sd)
262{ 262{
263 struct sysfs_dirent *parent_sd; 263 struct sysfs_dirent *parent_sd;
264 264
@@ -451,7 +451,7 @@ int __sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd)
451 451
452 if (!!sysfs_ns_type(acxt->parent_sd) != !!sd->s_ns) { 452 if (!!sysfs_ns_type(acxt->parent_sd) != !!sd->s_ns) {
453 WARN(1, KERN_WARNING "sysfs: ns %s in '%s' for '%s'\n", 453 WARN(1, KERN_WARNING "sysfs: ns %s in '%s' for '%s'\n",
454 sysfs_ns_type(acxt->parent_sd)? "required": "invalid", 454 sysfs_ns_type(acxt->parent_sd) ? "required" : "invalid",
455 acxt->parent_sd->s_name, sd->s_name); 455 acxt->parent_sd->s_name, sd->s_name);
456 return -EINVAL; 456 return -EINVAL;
457 } 457 }
@@ -619,7 +619,7 @@ struct sysfs_dirent *sysfs_find_dirent(struct sysfs_dirent *parent_sd,
619 619
620 if (!!sysfs_ns_type(parent_sd) != !!ns) { 620 if (!!sysfs_ns_type(parent_sd) != !!ns) {
621 WARN(1, KERN_WARNING "sysfs: ns %s in '%s' for '%s'\n", 621 WARN(1, KERN_WARNING "sysfs: ns %s in '%s' for '%s'\n",
622 sysfs_ns_type(parent_sd)? "required": "invalid", 622 sysfs_ns_type(parent_sd) ? "required" : "invalid",
623 parent_sd->s_name, name); 623 parent_sd->s_name, name);
624 return NULL; 624 return NULL;
625 } 625 }
@@ -674,7 +674,7 @@ static int create_dir(struct kobject *kobj, struct sysfs_dirent *parent_sd,
674 enum kobj_ns_type type, const void *ns, const char *name, 674 enum kobj_ns_type type, const void *ns, const char *name,
675 struct sysfs_dirent **p_sd) 675 struct sysfs_dirent **p_sd)
676{ 676{
677 umode_t mode = S_IFDIR| S_IRWXU | S_IRUGO | S_IXUGO; 677 umode_t mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO;
678 struct sysfs_addrm_cxt acxt; 678 struct sysfs_addrm_cxt acxt;
679 struct sysfs_dirent *sd; 679 struct sysfs_dirent *sd;
680 int rc; 680 int rc;
@@ -737,7 +737,7 @@ static enum kobj_ns_type sysfs_read_ns_type(struct kobject *kobj)
737 * sysfs_create_dir - create a directory for an object. 737 * sysfs_create_dir - create a directory for an object.
738 * @kobj: object we're creating directory for. 738 * @kobj: object we're creating directory for.
739 */ 739 */
740int sysfs_create_dir(struct kobject * kobj) 740int sysfs_create_dir(struct kobject *kobj)
741{ 741{
742 enum kobj_ns_type type; 742 enum kobj_ns_type type;
743 struct sysfs_dirent *parent_sd, *sd; 743 struct sysfs_dirent *parent_sd, *sd;
@@ -764,8 +764,8 @@ int sysfs_create_dir(struct kobject * kobj)
764 return error; 764 return error;
765} 765}
766 766
767static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry, 767static struct dentry *sysfs_lookup(struct inode *dir, struct dentry *dentry,
768 unsigned int flags) 768 unsigned int flags)
769{ 769{
770 struct dentry *ret = NULL; 770 struct dentry *ret = NULL;
771 struct dentry *parent = dentry->d_parent; 771 struct dentry *parent = dentry->d_parent;
@@ -857,7 +857,7 @@ static void __sysfs_remove_dir(struct sysfs_dirent *dir_sd)
857 * what used to be sysfs_rmdir() below, instead of calling separately. 857 * what used to be sysfs_rmdir() below, instead of calling separately.
858 */ 858 */
859 859
860void sysfs_remove_dir(struct kobject * kobj) 860void sysfs_remove_dir(struct kobject *kobj)
861{ 861{
862 struct sysfs_dirent *sd = kobj->sd; 862 struct sysfs_dirent *sd = kobj->sd;
863 863
@@ -1001,7 +1001,7 @@ static struct sysfs_dirent *sysfs_dir_next_pos(const void *ns,
1001static int sysfs_readdir(struct file *file, struct dir_context *ctx) 1001static int sysfs_readdir(struct file *file, struct dir_context *ctx)
1002{ 1002{
1003 struct dentry *dentry = file->f_path.dentry; 1003 struct dentry *dentry = file->f_path.dentry;
1004 struct sysfs_dirent * parent_sd = dentry->d_fsdata; 1004 struct sysfs_dirent *parent_sd = dentry->d_fsdata;
1005 struct sysfs_dirent *pos = file->private_data; 1005 struct sysfs_dirent *pos = file->private_data;
1006 enum kobj_ns_type type; 1006 enum kobj_ns_type type;
1007 const void *ns; 1007 const void *ns;
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 65052df09485..1e12e07eed5e 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -45,8 +45,8 @@ struct sysfs_open_dirent {
45struct sysfs_buffer { 45struct sysfs_buffer {
46 size_t count; 46 size_t count;
47 loff_t pos; 47 loff_t pos;
48 char * page; 48 char *page;
49 const struct sysfs_ops * ops; 49 const struct sysfs_ops *ops;
50 struct mutex mutex; 50 struct mutex mutex;
51 int needs_read_fill; 51 int needs_read_fill;
52 int event; 52 int event;
@@ -64,11 +64,11 @@ struct sysfs_buffer {
64 * This is called only once, on the file's first read unless an error 64 * This is called only once, on the file's first read unless an error
65 * is returned. 65 * is returned.
66 */ 66 */
67static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer) 67static int fill_read_buffer(struct dentry *dentry, struct sysfs_buffer *buffer)
68{ 68{
69 struct sysfs_dirent *attr_sd = dentry->d_fsdata; 69 struct sysfs_dirent *attr_sd = dentry->d_fsdata;
70 struct kobject *kobj = attr_sd->s_parent->s_dir.kobj; 70 struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
71 const struct sysfs_ops * ops = buffer->ops; 71 const struct sysfs_ops *ops = buffer->ops;
72 int ret = 0; 72 int ret = 0;
73 ssize_t count; 73 ssize_t count;
74 74
@@ -127,12 +127,12 @@ static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer
127static ssize_t 127static ssize_t
128sysfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *ppos) 128sysfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *ppos)
129{ 129{
130 struct sysfs_buffer * buffer = file->private_data; 130 struct sysfs_buffer *buffer = file->private_data;
131 ssize_t retval = 0; 131 ssize_t retval = 0;
132 132
133 mutex_lock(&buffer->mutex); 133 mutex_lock(&buffer->mutex);
134 if (buffer->needs_read_fill || *ppos == 0) { 134 if (buffer->needs_read_fill || *ppos == 0) {
135 retval = fill_read_buffer(file->f_path.dentry,buffer); 135 retval = fill_read_buffer(file->f_path.dentry, buffer);
136 if (retval) 136 if (retval)
137 goto out; 137 goto out;
138 } 138 }
@@ -154,8 +154,8 @@ out:
154 * Allocate @buffer->page if it hasn't been already, then 154 * Allocate @buffer->page if it hasn't been already, then
155 * copy the user-supplied buffer into it. 155 * copy the user-supplied buffer into it.
156 */ 156 */
157static int fill_write_buffer(struct sysfs_buffer * buffer, 157static int fill_write_buffer(struct sysfs_buffer *buffer,
158 const char __user * buf, size_t count) 158 const char __user *buf, size_t count)
159{ 159{
160 int error; 160 int error;
161 161
@@ -166,7 +166,7 @@ static int fill_write_buffer(struct sysfs_buffer * buffer,
166 166
167 if (count >= PAGE_SIZE) 167 if (count >= PAGE_SIZE)
168 count = PAGE_SIZE - 1; 168 count = PAGE_SIZE - 1;
169 error = copy_from_user(buffer->page,buf,count); 169 error = copy_from_user(buffer->page, buf, count);
170 buffer->needs_read_fill = 1; 170 buffer->needs_read_fill = 1;
171 /* if buf is assumed to contain a string, terminate it by \0, 171 /* if buf is assumed to contain a string, terminate it by \0,
172 so e.g. sscanf() can scan the string easily */ 172 so e.g. sscanf() can scan the string easily */
@@ -186,11 +186,11 @@ static int fill_write_buffer(struct sysfs_buffer * buffer,
186 * passing the buffer that we acquired in fill_write_buffer(). 186 * passing the buffer that we acquired in fill_write_buffer().
187 */ 187 */
188static int 188static int
189flush_write_buffer(struct dentry * dentry, struct sysfs_buffer * buffer, size_t count) 189flush_write_buffer(struct dentry *dentry, struct sysfs_buffer *buffer, size_t count)
190{ 190{
191 struct sysfs_dirent *attr_sd = dentry->d_fsdata; 191 struct sysfs_dirent *attr_sd = dentry->d_fsdata;
192 struct kobject *kobj = attr_sd->s_parent->s_dir.kobj; 192 struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
193 const struct sysfs_ops * ops = buffer->ops; 193 const struct sysfs_ops *ops = buffer->ops;
194 int rc; 194 int rc;
195 195
196 /* need attr_sd for attr and ops, its parent for kobj */ 196 /* need attr_sd for attr and ops, its parent for kobj */
@@ -225,7 +225,7 @@ flush_write_buffer(struct dentry * dentry, struct sysfs_buffer * buffer, size_t
225static ssize_t 225static ssize_t
226sysfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t *ppos) 226sysfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
227{ 227{
228 struct sysfs_buffer * buffer = file->private_data; 228 struct sysfs_buffer *buffer = file->private_data;
229 ssize_t len; 229 ssize_t len;
230 230
231 mutex_lock(&buffer->mutex); 231 mutex_lock(&buffer->mutex);
@@ -418,7 +418,7 @@ static int sysfs_release(struct inode *inode, struct file *filp)
418 */ 418 */
419static unsigned int sysfs_poll(struct file *filp, poll_table *wait) 419static unsigned int sysfs_poll(struct file *filp, poll_table *wait)
420{ 420{
421 struct sysfs_buffer * buffer = filp->private_data; 421 struct sysfs_buffer *buffer = filp->private_data;
422 struct sysfs_dirent *attr_sd = filp->f_path.dentry->d_fsdata; 422 struct sysfs_dirent *attr_sd = filp->f_path.dentry->d_fsdata;
423 struct sysfs_open_dirent *od = attr_sd->s_attr.open; 423 struct sysfs_open_dirent *od = attr_sd->s_attr.open;
424 424
@@ -567,7 +567,7 @@ int sysfs_add_file(struct sysfs_dirent *dir_sd, const struct attribute *attr,
567 * @kobj: object we're creating for. 567 * @kobj: object we're creating for.
568 * @attr: attribute descriptor. 568 * @attr: attribute descriptor.
569 */ 569 */
570int sysfs_create_file(struct kobject * kobj, const struct attribute * attr) 570int sysfs_create_file(struct kobject *kobj, const struct attribute *attr)
571{ 571{
572 BUG_ON(!kobj || !kobj->sd || !attr); 572 BUG_ON(!kobj || !kobj->sd || !attr);
573 573
@@ -660,7 +660,7 @@ EXPORT_SYMBOL_GPL(sysfs_chmod_file);
660 * 660 *
661 * Hash the attribute name and kill the victim. 661 * Hash the attribute name and kill the victim.
662 */ 662 */
663void sysfs_remove_file(struct kobject * kobj, const struct attribute * attr) 663void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr)
664{ 664{
665 const void *ns; 665 const void *ns;
666 666
@@ -671,7 +671,7 @@ void sysfs_remove_file(struct kobject * kobj, const struct attribute * attr)
671} 671}
672EXPORT_SYMBOL_GPL(sysfs_remove_file); 672EXPORT_SYMBOL_GPL(sysfs_remove_file);
673 673
674void sysfs_remove_files(struct kobject * kobj, const struct attribute **ptr) 674void sysfs_remove_files(struct kobject *kobj, const struct attribute **ptr)
675{ 675{
676 int i; 676 int i;
677 for (i = 0; ptr[i]; i++) 677 for (i = 0; ptr[i]; i++)
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index e9f251ae7e8b..833ec9150650 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -36,7 +36,7 @@ static struct backing_dev_info sysfs_backing_dev_info = {
36 .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK, 36 .capabilities = BDI_CAP_NO_ACCT_AND_WRITEBACK,
37}; 37};
38 38
39static const struct inode_operations sysfs_inode_operations ={ 39static const struct inode_operations sysfs_inode_operations = {
40 .permission = sysfs_permission, 40 .permission = sysfs_permission,
41 .setattr = sysfs_setattr, 41 .setattr = sysfs_setattr,
42 .getattr = sysfs_getattr, 42 .getattr = sysfs_getattr,
@@ -67,7 +67,7 @@ static struct sysfs_inode_attrs *sysfs_init_inode_attrs(struct sysfs_dirent *sd)
67 return attrs; 67 return attrs;
68} 68}
69 69
70int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr * iattr) 70int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr *iattr)
71{ 71{
72 struct sysfs_inode_attrs *sd_attrs; 72 struct sysfs_inode_attrs *sd_attrs;
73 struct iattr *iattrs; 73 struct iattr *iattrs;
@@ -186,13 +186,13 @@ out:
186 return error; 186 return error;
187} 187}
188 188
189static inline void set_default_inode_attr(struct inode * inode, umode_t mode) 189static inline void set_default_inode_attr(struct inode *inode, umode_t mode)
190{ 190{
191 inode->i_mode = mode; 191 inode->i_mode = mode;
192 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 192 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
193} 193}
194 194
195static inline void set_inode_attr(struct inode * inode, struct iattr * iattr) 195static inline void set_inode_attr(struct inode *inode, struct iattr *iattr)
196{ 196{
197 inode->i_uid = iattr->ia_uid; 197 inode->i_uid = iattr->ia_uid;
198 inode->i_gid = iattr->ia_gid; 198 inode->i_gid = iattr->ia_gid;
@@ -285,7 +285,7 @@ static void sysfs_init_inode(struct sysfs_dirent *sd, struct inode *inode)
285 * RETURNS: 285 * RETURNS:
286 * Pointer to allocated inode on success, NULL on failure. 286 * Pointer to allocated inode on success, NULL on failure.
287 */ 287 */
288struct inode * sysfs_get_inode(struct super_block *sb, struct sysfs_dirent *sd) 288struct inode *sysfs_get_inode(struct super_block *sb, struct sysfs_dirent *sd)
289{ 289{
290 struct inode *inode; 290 struct inode *inode;
291 291
diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index afd83273e6ce..fd7ce7a39f91 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -64,7 +64,7 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent)
64 /* instantiate and link root dentry */ 64 /* instantiate and link root dentry */
65 root = d_make_root(inode); 65 root = d_make_root(inode);
66 if (!root) { 66 if (!root) {
67 pr_debug("%s: could not get root dentry!\n",__func__); 67 pr_debug("%s: could not get root dentry!\n", __func__);
68 return -ENOMEM; 68 return -ENOMEM;
69 } 69 }
70 root->d_fsdata = &sysfs_root; 70 root->d_fsdata = &sysfs_root;
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
index 9fab2e7f7357..c6d815653125 100644
--- a/fs/sysfs/symlink.c
+++ b/fs/sysfs/symlink.c
@@ -167,7 +167,7 @@ void sysfs_delete_link(struct kobject *kobj, struct kobject *targ,
167 * @kobj: object we're acting for. 167 * @kobj: object we're acting for.
168 * @name: name of the symlink to remove. 168 * @name: name of the symlink to remove.
169 */ 169 */
170void sysfs_remove_link(struct kobject * kobj, const char * name) 170void sysfs_remove_link(struct kobject *kobj, const char *name)
171{ 171{
172 struct sysfs_dirent *parent_sd = NULL; 172 struct sysfs_dirent *parent_sd = NULL;
173 173
@@ -278,7 +278,7 @@ static int sysfs_get_target_path(struct sysfs_dirent *parent_sd,
278 return 0; 278 return 0;
279} 279}
280 280
281static int sysfs_getlink(struct dentry *dentry, char * path) 281static int sysfs_getlink(struct dentry *dentry, char *path)
282{ 282{
283 struct sysfs_dirent *sd = dentry->d_fsdata; 283 struct sysfs_dirent *sd = dentry->d_fsdata;
284 struct sysfs_dirent *parent_sd = sd->s_parent; 284 struct sysfs_dirent *parent_sd = sd->s_parent;