Skip to contentSkip to conversation

Security: inode: Fix code style issues

PATCH In review Chihau Chau 2 participants 5 messages Apr 23, 2010 Security (LSM)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Security: inode: Fix code style issues

From: Chihau Chau <[email protected]>

This fixes two code style issues:

- A space required after that close brace '}'

- A space required after that ','

---
 security/inode.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
security/inode.c +2 -2
index c3a7938..f875f47 100644
@@ -124,7 +124,7 @@ static inline int positive(struct dentry *dentry)
 
 static int fill_super(struct super_block *sb, void *data, int silent)
 {
-	static struct tree_descr files[] = {{""}};
+	static struct tree_descr files[] = { {""} };
 
 	return simple_fill_super(sb, SECURITYFS_MAGIC, files);
 }
@@ -208,7 +208,7 @@ struct dentry *securityfs_create_file(const char *name, mode_t mode,
 	struct dentry *dentry = NULL;
 	int error;
 
-	pr_debug("securityfs: creating file '%s'\n",name);
+	pr_debug("securityfs: creating file '%s'\n", name);
 
 	error = simple_pin_fs(&fs_type, &mount, &mount_count);
 	if (error) {
Signature · 1 line
1.5.6.3
#1 lore raw
Quoted 5 lines · On Thu, 22 Apr 2010 20:37:15 -0400 Chihau Chau wrote:

From: Chihau Chau <[email protected]>

This fixes two code style issues:

- A space required after that close brace '}'

Why? do we say that somewhere?

Quoted 38 lines

- A space required after that ','

---
 security/inode.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
security/inode.c +2 -2
index c3a7938..f875f47 100644
@@ -124,7 +124,7 @@ static inline int positive(struct dentry *dentry)
 
 static int fill_super(struct super_block *sb, void *data, int silent)
 {
-	static struct tree_descr files[] = {{""}};
+	static struct tree_descr files[] = { {""} };
 
 	return simple_fill_super(sb, SECURITYFS_MAGIC, files);
 }
@@ -208,7 +208,7 @@ struct dentry *securityfs_create_file(const char *name, mode_t mode,
 	struct dentry *dentry = NULL;
 	int error;
 
-	pr_debug("securityfs: creating file '%s'\n",name);
+	pr_debug("securityfs: creating file '%s'\n", name);
 
 	error = simple_pin_fs(&fs_type, &mount, &mount_count);
 	if (error) {
Signature · 7 lines
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#2 lore raw

Hi Randy,

2010/4/23 Randy Dunlap <[email protected]>:

Quoted 10 lines · On Thu, 22 Apr 2010 20:37:15 -0400 Chihau Chau wrote:
Quoted 6 lines

From: Chihau Chau <[email protected]>

This fixes two code style issues:

- A space required after that close brace '}'

Why?  do we say that somewhere?

I was used the checkpatch.pl script written by Dave Jones, Joel Schopp and Andy Whitcroft.

Quoted 45 lines
Quoted 34 lines

- A space required after that ','

---
 security/inode.c |    4 ++--

 1 files changed, 2 insertions(+), 2 deletions(-)
security/inode.c +2 -3
index c3a7938..f875f47 100644
@@ -124,7 +124,7 @@ static inline int positive(struct dentry *dentry)
 
  static int fill_super(struct super_block *sb, void *data, int silent)
  {
-     static struct tree_descr files[] = {{""}};
+     static struct tree_descr files[] = { {""} };
 
       return simple_fill_super(sb, SECURITYFS_MAGIC, files);
  }
@@ -208,7 +208,7 @@ struct dentry *securityfs_create_file(const char *name, mode_t mode,
       struct dentry *dentry = NULL;
       int error;
 
-     pr_debug("securityfs: creating file '%s'\n",name);
+     pr_debug("securityfs: creating file '%s'\n", name);
 
       error = simple_pin_fs(&fs_type, &mount, &mount_count);
       if (error) {
--

1.5.6.3

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

Signature · 1 line
Chihau Chau
#3 lore raw
Quoted 9 lines · Chihau Chau

Hi Randy,

2010/4/23 Randy Dunlap <[email protected]>:

Quoted 6 lines · On Thu, 22 Apr 2010 20:37:15 -0400 Chihau Chau wrote:
Quoted 5 lines

From: Chihau Chau <[email protected]>

This fixes two code style issues:

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

- A space required after that close brace '}'

Why? do we say that somewhere?

I was used the checkpatch.pl script written by Dave Jones, Joel Schopp and Andy Whitcroft.

OK, thanks for the explanation.
That would be correct for something like:

	if (foo_bar) {
		do_this();
		do_that();
	} else {
		pr_err("fatal error");
		panic("help");
	}

but I don't think that it's needed for nested data structures.

Quoted 48 lines
Quoted 45 lines
Quoted 34 lines

- A space required after that ','

---
 security/inode.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
security/inode.c +2 -3
index c3a7938..f875f47 100644
@@ -124,7 +124,7 @@ static inline int positive(struct dentry *dentry)
 
 static int fill_super(struct super_block *sb, void *data, int silent)
 {
-     static struct tree_descr files[] = {{""}};
+     static struct tree_descr files[] = { {""} };
 
      return simple_fill_super(sb, SECURITYFS_MAGIC, files);
 }
@@ -208,7 +208,7 @@ struct dentry *securityfs_create_file(const char *name, mode_t mode,
      struct dentry *dentry = NULL;
      int error;
 
-     pr_debug("securityfs: creating file '%s'\n",name);
+     pr_debug("securityfs: creating file '%s'\n", name);
 
      error = simple_pin_fs(&fs_type, &mount, &mount_count);
      if (error) {
--

1.5.6.3

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

Signature · 2 lines
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
#4 lore raw

Ok

2010/4/23 Randy Dunlap <[email protected]>:

Quoted 86 lines · Chihau Chau
Quoted 9 lines

Hi Randy,

2010/4/23 Randy Dunlap <[email protected]>:

Quoted 6 lines · On Thu, 22 Apr 2010 20:37:15 -0400 Chihau Chau wrote:
Quoted 5 lines

From: Chihau Chau <[email protected]>

This fixes two code style issues:

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

- A space required after that close brace '}'

Why?  do we say that somewhere?

I was used the checkpatch.pl script written by Dave Jones, Joel Schopp and Andy Whitcroft.

OK, thanks for the explanation.
That would be correct for something like:

       if (foo_bar) {
               do_this();
               do_that();
       } else {
               pr_err("fatal error");
               panic("help");
       }

but I don't think that it's needed for nested data structures.

Quoted 34 lines
Quoted 34 lines
Quoted 34 lines

- A space required after that ','

---
 security/inode.c |    4 ++--

 1 files changed, 2 insertions(+), 2 deletions(-)
security/inode.c +2 -3
index c3a7938..f875f47 100644
@@ -124,7 +124,7 @@ static inline int positive(struct dentry *dentry)
 
  static int fill_super(struct super_block *sb, void *data, int silent)
  {
-     static struct tree_descr files[] = {{""}};
+     static struct tree_descr files[] = { {""} };
 
       return simple_fill_super(sb, SECURITYFS_MAGIC, files);
  }
@@ -208,7 +208,7 @@ struct dentry *securityfs_create_file(const char *name, mode_t mode,
       struct dentry *dentry = NULL;
       int error;
 
-     pr_debug("securityfs: creating file '%s'\n",name);
+     pr_debug("securityfs: creating file '%s'\n", name);
 
       error = simple_pin_fs(&fs_type, &mount, &mount_count);
       if (error) {
--

1.5.6.3

Quoted 14 lines
Quoted 11 lines
Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

--
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

Signature · 1 line
Chihau Chau