linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/7] Kernel: space and brace fixes for user_namespace.c
@ 2011-06-07 10:39 ` Akshay Joshi
  2011-06-07 10:39   ` [PATCH 3/7] Kernel: Fix trailing whitespace in user.c Akshay Joshi
                     ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Akshay Joshi @ 2011-06-07 10:39 UTC (permalink / raw)
  Cc: Akshay Joshi, Serge E. Hallyn, Andrew Morton, Eric W. Biederman,
	David S. Miller, Pavel Emelyanov, linux-kernel

Fix the space prohibitions and unnecessary braces for single statement
blocks as reported by the checkpatch.pl tool.

Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
 kernel/user_namespace.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index 9da289c..4407b8b 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -97,12 +97,10 @@ uid_t user_ns_map_uid(struct user_namespace *to, const struct cred *cred, uid_t
 	/* Is cred->user the creator of the target user_ns
 	 * or the creator of one of it's parents?
 	 */
-	for ( tmp = to; tmp != &init_user_ns;
-	      tmp = tmp->creator->user_ns ) {
-		if (cred->user == tmp->creator) {
+	for (tmp = to; tmp != &init_user_ns;
+	      tmp = tmp->creator->user_ns)
+		if (cred->user == tmp->creator)
 			return (uid_t)0;
-		}
-	}
 
 	/* No useful relationship so no mapping */
 	return overflowuid;
@@ -118,12 +116,10 @@ gid_t user_ns_map_gid(struct user_namespace *to, const struct cred *cred, gid_t
 	/* Is cred->user the creator of the target user_ns
 	 * or the creator of one of it's parents?
 	 */
-	for ( tmp = to; tmp != &init_user_ns;
-	      tmp = tmp->creator->user_ns ) {
-		if (cred->user == tmp->creator) {
+	for (tmp = to; tmp != &init_user_ns;
+	      tmp = tmp->creator->user_ns)
+		if (cred->user == tmp->creator)
 			return (gid_t)0;
-		}
-	}
 
 	/* No useful relationship so no mapping */
 	return overflowgid;
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/7] Kernel: Fix trailing whitespace in user.c.
  2011-06-07 10:39 ` [PATCH 2/7] Kernel: space and brace fixes for user_namespace.c Akshay Joshi
@ 2011-06-07 10:39   ` Akshay Joshi
  2011-06-07 10:39   ` [PATCH 4/7] Kernel: convert leading spaces to tabs in uid16.c Akshay Joshi
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Akshay Joshi @ 2011-06-07 10:39 UTC (permalink / raw)
  Cc: Akshay Joshi, Andrew Morton, Namhyung Kim, Eric W. Biederman,
	David Howells, Hillf Danton, linux-kernel

Remove trailing whitespace, as reported by checkpatch.pl, in the user.c
file.

Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
 kernel/user.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/user.c b/kernel/user.c
index 9e03e9c..94b4686 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -5,7 +5,7 @@
  *
  * We have a per-user structure to keep track of how many
  * processes, files etc the user has claimed, in order to be
- * able to have per-user limits for system resources. 
+ * able to have per-user limits for system resources.
  */
 
 #include <linux/init.h>
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/7] Kernel: convert leading spaces to tabs in uid16.c.
  2011-06-07 10:39 ` [PATCH 2/7] Kernel: space and brace fixes for user_namespace.c Akshay Joshi
  2011-06-07 10:39   ` [PATCH 3/7] Kernel: Fix trailing whitespace in user.c Akshay Joshi
@ 2011-06-07 10:39   ` Akshay Joshi
  2011-06-07 15:43     ` Akshay Joshi
  2011-06-07 10:39   ` [PATCH 5/7] Kernel: add spaces where required by the coding style in acct.c Akshay Joshi
                     ` (4 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: Akshay Joshi @ 2011-06-07 10:39 UTC (permalink / raw)
  Cc: Akshay Joshi, Andrew Morton, Serge E. Hallyn, Eric W. Biederman,
	David Howells, Daniel Lezcano, linux-kernel

Convert the leading indentations for long function declarations to use
tabs.

Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
 kernel/uid16.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/uid16.c b/kernel/uid16.c
index 51c6e89..8c3fbfc 100644
--- a/kernel/uid16.c
+++ b/kernel/uid16.c
@@ -132,7 +132,7 @@ SYSCALL_DEFINE1(setfsgid16, old_gid_t, gid)
 }
 
 static int groups16_to_user(old_gid_t __user *grouplist,
-    struct group_info *group_info)
+	struct group_info *group_info)
 {
 	int i;
 	old_gid_t group;
@@ -147,7 +147,7 @@ static int groups16_to_user(old_gid_t __user *grouplist,
 }
 
 static int groups16_from_user(struct group_info *group_info,
-    old_gid_t __user *grouplist)
+	old_gid_t __user *grouplist)
 {
 	int i;
 	old_gid_t group;
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/7] Kernel: add spaces where required by the coding style in acct.c.
  2011-06-07 10:39 ` [PATCH 2/7] Kernel: space and brace fixes for user_namespace.c Akshay Joshi
  2011-06-07 10:39   ` [PATCH 3/7] Kernel: Fix trailing whitespace in user.c Akshay Joshi
  2011-06-07 10:39   ` [PATCH 4/7] Kernel: convert leading spaces to tabs in uid16.c Akshay Joshi
@ 2011-06-07 10:39   ` Akshay Joshi
  2011-06-07 10:39   ` [PATCH 6/7] Kernel: fix spaces with respect to the coding style in sys.c Akshay Joshi
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Akshay Joshi @ 2011-06-07 10:39 UTC (permalink / raw)
  Cc: Akshay Joshi, Al Viro, Christoph Hellwig, linux-kernel

This patch adds spaces where required by the kernel coding style. Most
of these changes are for precompiler statements.

Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
 kernel/acct.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/kernel/acct.c b/kernel/acct.c
index fa7eb3d..c946fdc 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -144,7 +144,7 @@ static int check_free_space(struct bsd_acct_struct *acct, struct file *file)
 	spin_lock(&acct_lock);
 	if (file != acct->file) {
 		if (act)
-			res = act>0;
+			res = act > 0;
 		goto out;
 	}
 
@@ -396,7 +396,7 @@ static comp_t encode_comp_t(unsigned long value)
 	return exp;
 }
 
-#if ACCT_VERSION==1 || ACCT_VERSION==2
+#if ACCT_VERSION == 1 || ACCT_VERSION == 2
 /*
  * encode an u64 into a comp2_t (24 bits)
  *
@@ -440,7 +440,7 @@ static comp2_t encode_comp2_t(u64 value)
 }
 #endif
 
-#if ACCT_VERSION==3
+#if ACCT_VERSION == 3
 /*
  * encode an u64 into a 32 bit IEEE float
  */
@@ -449,8 +449,9 @@ static u32 encode_float(u64 value)
 	unsigned exp = 190;
 	unsigned u;
 
-	if (value==0) return 0;
-	while ((s64)value > 0){
+	if (value == 0)
+		return 0;
+	while ((s64)value > 0) {
 		value <<= 1;
 		exp--;
 	}
@@ -510,13 +511,13 @@ static void do_acct_process(struct bsd_acct_struct *acct,
 		       + current->group_leader->start_time.tv_nsec;
 	/* convert nsec -> AHZ */
 	elapsed = nsec_to_AHZ(run_time);
-#if ACCT_VERSION==3
+#if ACCT_VERSION == 3
 	ac.ac_etime = encode_float(elapsed);
 #else
 	ac.ac_etime = encode_comp_t(elapsed < (unsigned long) -1l ?
 	                       (unsigned long) elapsed : (unsigned long) -1l);
 #endif
-#if ACCT_VERSION==1 || ACCT_VERSION==2
+#if ACCT_VERSION == 1 || ACCT_VERSION == 2
 	{
 		/* new enlarged etime field */
 		comp2_t etime = encode_comp2_t(elapsed);
@@ -529,15 +530,15 @@ static void do_acct_process(struct bsd_acct_struct *acct,
 	/* we really need to bite the bullet and change layout */
 	ac.ac_uid = orig_cred->uid;
 	ac.ac_gid = orig_cred->gid;
-#if ACCT_VERSION==2
+#if ACCT_VERSION == 2
 	ac.ac_ahz = AHZ;
 #endif
-#if ACCT_VERSION==1 || ACCT_VERSION==2
+#if ACCT_VERSION == 1 || ACCT_VERSION == 2
 	/* backward-compatible 16 bit fields */
 	ac.ac_uid16 = ac.ac_uid;
 	ac.ac_gid16 = ac.ac_gid;
 #endif
-#if ACCT_VERSION==3
+#if ACCT_VERSION == 3
 	ac.ac_pid = task_tgid_nr_ns(current, ns);
 	rcu_read_lock();
 	ac.ac_ppid = task_tgid_nr_ns(rcu_dereference(current->real_parent), ns);
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/7] Kernel: fix spaces with respect to the coding style in sys.c.
  2011-06-07 10:39 ` [PATCH 2/7] Kernel: space and brace fixes for user_namespace.c Akshay Joshi
                     ` (2 preceding siblings ...)
  2011-06-07 10:39   ` [PATCH 5/7] Kernel: add spaces where required by the coding style in acct.c Akshay Joshi
@ 2011-06-07 10:39   ` Akshay Joshi
  2011-06-07 10:39   ` [PATCH 7/7] Kernel: style fixes to spaces for sysctl.c Akshay Joshi
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Akshay Joshi @ 2011-06-07 10:39 UTC (permalink / raw)
  Cc: Akshay Joshi, Jiri Slaby, Andrew Morton, Greg Kroah-Hartman,
	David Howells, James Morris, linux-kernel

Fixed trailing spaces, spaces around the ternary operators and in the
pre-processor function declarations with the help of the checkpatch.pl
tool.

Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
 kernel/sys.c |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index e4128b2..94f02f5 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -51,28 +51,28 @@
 #include <asm/unistd.h>
 
 #ifndef SET_UNALIGN_CTL
-# define SET_UNALIGN_CTL(a,b)	(-EINVAL)
+# define SET_UNALIGN_CTL(a, b)	(-EINVAL)
 #endif
 #ifndef GET_UNALIGN_CTL
-# define GET_UNALIGN_CTL(a,b)	(-EINVAL)
+# define GET_UNALIGN_CTL(a, b)	(-EINVAL)
 #endif
 #ifndef SET_FPEMU_CTL
-# define SET_FPEMU_CTL(a,b)	(-EINVAL)
+# define SET_FPEMU_CTL(a, b)	(-EINVAL)
 #endif
 #ifndef GET_FPEMU_CTL
-# define GET_FPEMU_CTL(a,b)	(-EINVAL)
+# define GET_FPEMU_CTL(a, b)	(-EINVAL)
 #endif
 #ifndef SET_FPEXC_CTL
-# define SET_FPEXC_CTL(a,b)	(-EINVAL)
+# define SET_FPEXC_CTL(a, b)	(-EINVAL)
 #endif
 #ifndef GET_FPEXC_CTL
-# define GET_FPEXC_CTL(a,b)	(-EINVAL)
+# define GET_FPEXC_CTL(a, b)	(-EINVAL)
 #endif
 #ifndef GET_ENDIAN
-# define GET_ENDIAN(a,b)	(-EINVAL)
+# define GET_ENDIAN(a, b)	(-EINVAL)
 #endif
 #ifndef SET_ENDIAN
-# define SET_ENDIAN(a,b)	(-EINVAL)
+# define SET_ENDIAN(a, b)	(-EINVAL)
 #endif
 #ifndef GET_TSC_CTL
 # define GET_TSC_CTL(a)		(-EINVAL)
@@ -342,7 +342,7 @@ EXPORT_SYMBOL_GPL(kernel_restart);
 static void kernel_shutdown_prepare(enum system_states state)
 {
 	blocking_notifier_call_chain(&reboot_notifier_list,
-		(state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL);
+		(state == SYSTEM_HALT) ? SYS_HALT : SYS_POWER_OFF, NULL);
 	system_state = state;
 	usermodehelper_disable();
 	device_shutdown();
@@ -488,7 +488,7 @@ void ctrl_alt_del(void)
 	else
 		kill_cad_pid(SIGINT, 1);
 }
-	
+
 /*
  * Unprivileged users may change the real gid to the effective gid
  * or vice versa.  (BSD-style)
@@ -502,7 +502,7 @@ void ctrl_alt_del(void)
  *
  * The general idea is that a program which uses just setregid() will be
  * 100% compatible with BSD.  A program which uses just setgid() will be
- * 100% compatible with POSIX with saved IDs. 
+ * 100% compatible with POSIX with saved IDs.
  *
  * SMP: There are not races, the GIDs are checked only by filesystem
  *      operations (as far as semantic preservation is concerned).
@@ -550,7 +550,7 @@ error:
 }
 
 /*
- * setgid() is implemented like SysV w/ SAVED_IDS 
+ * setgid() is implemented like SysV w/ SAVED_IDS
  *
  * SMP: Same implicit races as above.
  */
@@ -615,7 +615,7 @@ static int set_user(struct cred *new)
  *
  * The general idea is that a program which uses just setreuid() will be
  * 100% compatible with BSD.  A program which uses just setuid() will be
- * 100% compatible with POSIX with saved IDs. 
+ * 100% compatible with POSIX with saved IDs.
  */
 SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid)
 {
@@ -666,17 +666,17 @@ error:
 	abort_creds(new);
 	return retval;
 }
-		
+
 /*
- * setuid() is implemented like SysV with SAVED_IDS 
- * 
+ * setuid() is implemented like SysV with SAVED_IDS
+ *
  * Note that SAVED_ID's is deficient in that a setuid root program
- * like sendmail, for example, cannot set its uid to be a normal 
+ * like sendmail, for example, cannot set its uid to be a normal
  * user and then switch back, because if you're root, setuid() sets
  * the saved uid too.  If you don't like this, blame the bright people
  * in the POSIX committee and/or USG.  Note that the BSD-style setreuid()
  * will allow a root program to temporarily drop privileges and be able to
- * regain them by swapping the real and effective uid.  
+ * regain them by swapping the real and effective uid.
  */
 SYSCALL_DEFINE1(setuid, uid_t, uid)
 {
@@ -1282,7 +1282,7 @@ SYSCALL_DEFINE2(getrlimit, unsigned int, resource, struct rlimit __user *, rlim)
 /*
  *	Back compatibility for getrlimit. Needed for some apps.
  */
- 
+
 SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
 		struct rlimit __user *, rlim)
 {
@@ -1297,7 +1297,7 @@ SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
 		x.rlim_cur = 0x7FFFFFFF;
 	if (x.rlim_max > 0x7FFFFFFF)
 		x.rlim_max = 0x7FFFFFFF;
-	return copy_to_user(rlim, &x, sizeof(x))?-EFAULT:0;
+	return copy_to_user(rlim, &x, sizeof(x)) ? -EFAULT : 0;
 }
 
 #endif
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 7/7] Kernel: style fixes to spaces for sysctl.c.
  2011-06-07 10:39 ` [PATCH 2/7] Kernel: space and brace fixes for user_namespace.c Akshay Joshi
                     ` (3 preceding siblings ...)
  2011-06-07 10:39   ` [PATCH 6/7] Kernel: fix spaces with respect to the coding style in sys.c Akshay Joshi
@ 2011-06-07 10:39   ` Akshay Joshi
  2011-06-07 13:30   ` [PATCH 6/7] Kernel: fix spaces with respect to the coding style in sys.c David Howells
  2011-06-07 15:41   ` [PATCH 3/7] Kernel: Fix trailing whitespace in user.c Akshay Joshi
  6 siblings, 0 replies; 11+ messages in thread
From: Akshay Joshi @ 2011-06-07 10:39 UTC (permalink / raw)
  Cc: Akshay Joshi, Ingo Molnar, Andrew Morton, Peter Zijlstra,
	Eric Paris, Al Viro, linux-kernel

Changed various things to fit the code style of the kernel, including
removing trailing whitespace, removing spaces between function calls and
their arguments and adding spaces between function arguments in function
definitions.

Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
---
 kernel/sysctl.c |   96 +++++++++++++++++++++++++++---------------------------
 1 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 4fc9244..2bf9080 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -469,14 +469,14 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname	= "stop-a",
 		.data		= &stop_a_enabled,
-		.maxlen		= sizeof (int),
+		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
 	{
 		.procname	= "scons-poweroff",
 		.data		= &scons_pwroff,
-		.maxlen		= sizeof (int),
+		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
@@ -485,7 +485,7 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname	= "tsb-ratio",
 		.data		= &sysctl_tsb_ratio,
-		.maxlen		= sizeof (int),
+		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
@@ -494,14 +494,14 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname	= "soft-power",
 		.data		= &pwrsw_enabled,
-		.maxlen		= sizeof (int),
-	 	.mode		= 0644,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
 	{
 		.procname	= "unaligned-trap",
 		.data		= &unaligned_enabled,
-		.maxlen		= sizeof (int),
+		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
@@ -572,7 +572,7 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname	= "sg-big-buff",
 		.data		= &sg_big_buff,
-		.maxlen		= sizeof (int),
+		.maxlen		= sizeof(int),
 		.mode		= 0444,
 		.proc_handler	= proc_dointvec,
 	},
@@ -590,7 +590,7 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname	= "sysrq",
 		.data		= &__sysrq_enabled,
-		.maxlen		= sizeof (int),
+		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= sysrq_sysctl_handler,
 	},
@@ -599,7 +599,7 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname	= "cad_pid",
 		.data		= NULL,
-		.maxlen		= sizeof (int),
+		.maxlen		= sizeof(int),
 		.mode		= 0600,
 		.proc_handler	= proc_do_cad_pid,
 	},
@@ -660,7 +660,7 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname	= "pid_max",
 		.data		= &pid_max,
-		.maxlen		= sizeof (int),
+		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec_minmax,
 		.extra1		= &pid_max_min,
@@ -726,7 +726,7 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname	= "ngroups_max",
 		.data		= &ngroups_max,
-		.maxlen		= sizeof (int),
+		.maxlen		= sizeof(int),
 		.mode		= 0444,
 		.proc_handler	= proc_dointvec,
 	},
@@ -734,7 +734,7 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname       = "watchdog",
 		.data           = &watchdog_enabled,
-		.maxlen         = sizeof (int),
+		.maxlen         = sizeof(int),
 		.mode           = 0644,
 		.proc_handler   = proc_dowatchdog,
 		.extra1		= &zero,
@@ -761,7 +761,7 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname       = "nmi_watchdog",
 		.data           = &watchdog_enabled,
-		.maxlen         = sizeof (int),
+		.maxlen         = sizeof(int),
 		.mode           = 0644,
 		.proc_handler   = proc_dowatchdog,
 		.extra1		= &zero,
@@ -772,7 +772,7 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname       = "unknown_nmi_panic",
 		.data           = &unknown_nmi_panic,
-		.maxlen         = sizeof (int),
+		.maxlen         = sizeof(int),
 		.mode           = 0644,
 		.proc_handler   = proc_dointvec,
 	},
@@ -795,14 +795,14 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname	= "bootloader_type",
 		.data		= &bootloader_type,
-		.maxlen		= sizeof (int),
+		.maxlen		= sizeof(int),
 		.mode		= 0444,
 		.proc_handler	= proc_dointvec,
 	},
 	{
 		.procname	= "bootloader_version",
 		.data		= &bootloader_version,
-		.maxlen		= sizeof (int),
+		.maxlen		= sizeof(int),
 		.mode		= 0444,
 		.proc_handler	= proc_dointvec,
 	},
@@ -834,7 +834,7 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname	= "spin_retry",
 		.data		= &spin_retry,
-		.maxlen		= sizeof (int),
+		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
@@ -843,7 +843,7 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname	= "acpi_video_flags",
 		.data		= &acpi_realmode_flags,
-		.maxlen		= sizeof (unsigned long),
+		.maxlen		= sizeof(unsigned long),
 		.mode		= 0644,
 		.proc_handler	= proc_doulongvec_minmax,
 	},
@@ -852,14 +852,14 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname	= "ignore-unaligned-usertrap",
 		.data		= &no_unaligned_warning,
-		.maxlen		= sizeof (int),
-	 	.mode		= 0644,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
 	{
 		.procname	= "unaligned-dump-stack",
 		.data		= &unaligned_dump_stack,
-		.maxlen		= sizeof (int),
+		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
@@ -900,8 +900,8 @@ static struct ctl_table kern_table[] = {
 	{
 		.procname	= "compat-log",
 		.data		= &compat_log,
-		.maxlen		= sizeof (int),
-	 	.mode		= 0644,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
 #endif
@@ -1022,7 +1022,7 @@ static struct ctl_table vm_table[] = {
 		.proc_handler	= proc_dointvec,
 	},
 	{
-		.procname	= "page-cluster", 
+		.procname	= "page-cluster",
 		.data		= &page_cluster,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
@@ -1468,7 +1468,7 @@ static struct ctl_table fs_table[] = {
 		.mode		= 0555,
 		.child		= inotify_table,
 	},
-#endif	
+#endif
 #ifdef CONFIG_EPOLL
 	{
 		.procname	= "epoll",
@@ -1829,7 +1829,7 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q)
  * cover common cases -
  *
  * proc_dostring(), proc_dointvec(), proc_dointvec_jiffies(),
- * proc_dointvec_userhz_jiffies(), proc_dointvec_minmax(), 
+ * proc_dointvec_userhz_jiffies(), proc_dointvec_minmax(),
  * proc_doulongvec_ms_jiffies_minmax(), proc_doulongvec_minmax()
  *
  * It is the handler's job to read the input buffer from user memory
@@ -2055,7 +2055,7 @@ static int _proc_do_string(void* data, int maxlen, int write,
 		}
 		if (len >= maxlen)
 			len = maxlen-1;
-		if(copy_from_user(data, buffer, len))
+		if (copy_from_user(data, buffer, len))
 			return -EFAULT;
 		((char *) data)[len] = 0;
 		*ppos += *lenp;
@@ -2075,10 +2075,10 @@ static int _proc_do_string(void* data, int maxlen, int write,
 		if (len > *lenp)
 			len = *lenp;
 		if (len)
-			if(copy_to_user(buffer, data, len))
+			if (copy_to_user(buffer, data, len))
 				return -EFAULT;
 		if (len < *lenp) {
-			if(put_user('\n', ((char __user *) buffer) + len))
+			if (put_user('\n', ((char __user *) buffer) + len))
 				return -EFAULT;
 			len++;
 		}
@@ -2269,12 +2269,12 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
 	unsigned long page = 0;
 	size_t left;
 	char *kbuf;
-	
+
 	if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) {
 		*lenp = 0;
 		return 0;
 	}
-	
+
 	i = (int *) tbl_data;
 	vleft = table->maxlen / sizeof(*i);
 	left = *lenp;
@@ -2296,7 +2296,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
 		kbuf[left] = 0;
 	}
 
-	for (; left && vleft--; i++, first=0) {
+	for (; left && vleft--; i++, first = 0) {
 		unsigned long lval;
 		bool neg;
 
@@ -2363,15 +2363,14 @@ static int do_proc_dointvec(struct ctl_table *table, int write,
  * @ppos: file position
  *
  * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
- * values from/to the user buffer, treated as an ASCII string. 
+ * values from/to the user buffer, treated as an ASCII string.
  *
  * Returns 0 on success.
  */
 int proc_dointvec(struct ctl_table *table, int write,
 		     void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-    return do_proc_dointvec(table,write,buffer,lenp,ppos,
-		    	    NULL,NULL);
+	return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL);
 }
 
 /*
@@ -2585,7 +2584,8 @@ static int do_proc_doulongvec_minmax(struct ctl_table *table, int write,
 int proc_doulongvec_minmax(struct ctl_table *table, int write,
 			   void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-    return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l);
+	return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos,
+			1l, 1l);
 }
 
 /**
@@ -2609,7 +2609,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
 				      void __user *buffer,
 				      size_t *lenp, loff_t *ppos)
 {
-    return do_proc_doulongvec_minmax(table, write, buffer,
+	return do_proc_doulongvec_minmax(table, write, buffer,
 				     lenp, ppos, HZ, 1000l);
 }
 
@@ -2690,7 +2690,7 @@ static int do_proc_dointvec_ms_jiffies_conv(bool *negp, unsigned long *lvalp,
  * @ppos: file position
  *
  * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
- * values from/to the user buffer, treated as an ASCII string. 
+ * values from/to the user buffer, treated as an ASCII string.
  * The values read are assumed to be in seconds, and are converted into
  * jiffies.
  *
@@ -2699,8 +2699,8 @@ static int do_proc_dointvec_ms_jiffies_conv(bool *negp, unsigned long *lvalp,
 int proc_dointvec_jiffies(struct ctl_table *table, int write,
 			  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-    return do_proc_dointvec(table,write,buffer,lenp,ppos,
-		    	    do_proc_dointvec_jiffies_conv,NULL);
+	return do_proc_dointvec(table, write, buffer, lenp, ppos,
+		do_proc_dointvec_jiffies_conv, NULL);
 }
 
 /**
@@ -2712,8 +2712,8 @@ int proc_dointvec_jiffies(struct ctl_table *table, int write,
  * @ppos: pointer to the file position
  *
  * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
- * values from/to the user buffer, treated as an ASCII string. 
- * The values read are assumed to be in 1/USER_HZ seconds, and 
+ * values from/to the user buffer, treated as an ASCII string.
+ * The values read are assumed to be in 1/USER_HZ seconds, and
  * are converted into jiffies.
  *
  * Returns 0 on success.
@@ -2721,8 +2721,8 @@ int proc_dointvec_jiffies(struct ctl_table *table, int write,
 int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
 				 void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-    return do_proc_dointvec(table,write,buffer,lenp,ppos,
-		    	    do_proc_dointvec_userhz_jiffies_conv,NULL);
+	return do_proc_dointvec(table, write, buffer, lenp, ppos,
+			do_proc_dointvec_userhz_jiffies_conv, NULL);
 }
 
 /**
@@ -2735,8 +2735,8 @@ int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
  * @ppos: the current position in the file
  *
  * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
- * values from/to the user buffer, treated as an ASCII string. 
- * The values read are assumed to be in 1/1000 seconds, and 
+ * values from/to the user buffer, treated as an ASCII string.
+ * The values read are assumed to be in 1/1000 seconds, and
  * are converted into jiffies.
  *
  * Returns 0 on success.
@@ -2817,7 +2817,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
 		if (copy_from_user(kbuf, buffer, left)) {
 			free_page(page);
 			return -EFAULT;
-                }
+		}
 		kbuf[left] = 0;
 
 		tmp_bitmap = kzalloc(BITS_TO_LONGS(bitmap_len) * sizeof(unsigned long),
@@ -2969,7 +2969,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
 				      void __user *buffer,
 				      size_t *lenp, loff_t *ppos)
 {
-    return -ENOSYS;
+	return -ENOSYS;
 }
 
 
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 6/7] Kernel: fix spaces with respect to the coding style in sys.c.
  2011-06-07 10:39 ` [PATCH 2/7] Kernel: space and brace fixes for user_namespace.c Akshay Joshi
                     ` (4 preceding siblings ...)
  2011-06-07 10:39   ` [PATCH 7/7] Kernel: style fixes to spaces for sysctl.c Akshay Joshi
@ 2011-06-07 13:30   ` David Howells
  2011-06-07 14:54     ` David Howells
  2011-06-07 15:44     ` Akshay Joshi
  2011-06-07 15:41   ` [PATCH 3/7] Kernel: Fix trailing whitespace in user.c Akshay Joshi
  6 siblings, 2 replies; 11+ messages in thread
From: David Howells @ 2011-06-07 13:30 UTC (permalink / raw)
  To: Akshay Joshi
  Cc: dhowells, Jiri Slaby, Andrew Morton, Greg Kroah-Hartman,
	James Morris, linux-kernel

Akshay Joshi <me@akshayjoshi.com> wrote:

>  /*
>   *	Back compatibility for getrlimit. Needed for some apps.
>   */
> - 
> +
>  SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,

You could just have deleted that blank line there.

Apart from that, feel free to add my Acked-by to the three patches you cc'd me
on.

David

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 6/7] Kernel: fix spaces with respect to the coding style in sys.c.
  2011-06-07 13:30   ` [PATCH 6/7] Kernel: fix spaces with respect to the coding style in sys.c David Howells
@ 2011-06-07 14:54     ` David Howells
  2011-06-07 15:44     ` Akshay Joshi
  1 sibling, 0 replies; 11+ messages in thread
From: David Howells @ 2011-06-07 14:54 UTC (permalink / raw)
  To: Akshay Joshi
  Cc: dhowells, Jiri Slaby, Andrew Morton, Greg Kroah-Hartman,
	James Morris, linux-kernel

Akshay Joshi <me@akshayjoshi.com> wrote:

> I am very new to submitting patches to the kernel. Do I just modify the
> patch file and add an Acked-by line to the patch notes or do I have to do
> something else?

If you've got a whole bunch of acks, then it may make sense to resubmit your
patches with them included and a note in patch 0 saying that that's all that
you've done.  This is one of the downsides of this process - it doesn't cope
so easily with additions of this type.

David

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/7] Kernel: Fix trailing whitespace in user.c.
  2011-06-07 10:39 ` [PATCH 2/7] Kernel: space and brace fixes for user_namespace.c Akshay Joshi
                     ` (5 preceding siblings ...)
  2011-06-07 13:30   ` [PATCH 6/7] Kernel: fix spaces with respect to the coding style in sys.c David Howells
@ 2011-06-07 15:41   ` Akshay Joshi
  6 siblings, 0 replies; 11+ messages in thread
From: Akshay Joshi @ 2011-06-07 15:41 UTC (permalink / raw)
  Cc: Akshay Joshi, Andrew Morton, Namhyung Kim, Eric W. Biederman,
	David Howells, Hillf Danton, linux-kernel

Remove trailing whitespace, as reported by checkpatch.pl, in the user.c
file.

Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
Acked-by: David Howells <dhowells@redhat.com>
---
 kernel/user.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/user.c b/kernel/user.c
index 9e03e9c..94b4686 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -5,7 +5,7 @@
  *
  * We have a per-user structure to keep track of how many
  * processes, files etc the user has claimed, in order to be
- * able to have per-user limits for system resources. 
+ * able to have per-user limits for system resources.
  */
 
 #include <linux/init.h>
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/7] Kernel: convert leading spaces to tabs in uid16.c.
  2011-06-07 10:39   ` [PATCH 4/7] Kernel: convert leading spaces to tabs in uid16.c Akshay Joshi
@ 2011-06-07 15:43     ` Akshay Joshi
  0 siblings, 0 replies; 11+ messages in thread
From: Akshay Joshi @ 2011-06-07 15:43 UTC (permalink / raw)
  Cc: Akshay Joshi, Andrew Morton, Serge E. Hallyn, Eric W. Biederman,
	David Howells, Daniel Lezcano, linux-kernel

Convert the leading indentations for long function declarations to use
tabs.

Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
Acked-by: David Howells <dhowells@redhat.com>
---
 kernel/uid16.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/uid16.c b/kernel/uid16.c
index 51c6e89..8c3fbfc 100644
--- a/kernel/uid16.c
+++ b/kernel/uid16.c
@@ -132,7 +132,7 @@ SYSCALL_DEFINE1(setfsgid16, old_gid_t, gid)
 }
 
 static int groups16_to_user(old_gid_t __user *grouplist,
-    struct group_info *group_info)
+	struct group_info *group_info)
 {
 	int i;
 	old_gid_t group;
@@ -147,7 +147,7 @@ static int groups16_to_user(old_gid_t __user *grouplist,
 }
 
 static int groups16_from_user(struct group_info *group_info,
-    old_gid_t __user *grouplist)
+	old_gid_t __user *grouplist)
 {
 	int i;
 	old_gid_t group;
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/7] Kernel: fix spaces with respect to the coding style in sys.c.
  2011-06-07 13:30   ` [PATCH 6/7] Kernel: fix spaces with respect to the coding style in sys.c David Howells
  2011-06-07 14:54     ` David Howells
@ 2011-06-07 15:44     ` Akshay Joshi
  1 sibling, 0 replies; 11+ messages in thread
From: Akshay Joshi @ 2011-06-07 15:44 UTC (permalink / raw)
  Cc: Akshay Joshi, Jiri Slaby, Andrew Morton, Greg Kroah-Hartman,
	David Howells, James Morris, linux-kernel

Fixed trailing spaces, spaces around the ternary operators and in the
pre-processor function declarations with the help of the checkpatch.pl
tool.

Signed-off-by: Akshay Joshi <me@akshayjoshi.com>
Acked-by: David Howells <dhowells@redhat.com>
---
 kernel/sys.c |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index e4128b2..94f02f5 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -51,28 +51,28 @@
 #include <asm/unistd.h>
 
 #ifndef SET_UNALIGN_CTL
-# define SET_UNALIGN_CTL(a,b)	(-EINVAL)
+# define SET_UNALIGN_CTL(a, b)	(-EINVAL)
 #endif
 #ifndef GET_UNALIGN_CTL
-# define GET_UNALIGN_CTL(a,b)	(-EINVAL)
+# define GET_UNALIGN_CTL(a, b)	(-EINVAL)
 #endif
 #ifndef SET_FPEMU_CTL
-# define SET_FPEMU_CTL(a,b)	(-EINVAL)
+# define SET_FPEMU_CTL(a, b)	(-EINVAL)
 #endif
 #ifndef GET_FPEMU_CTL
-# define GET_FPEMU_CTL(a,b)	(-EINVAL)
+# define GET_FPEMU_CTL(a, b)	(-EINVAL)
 #endif
 #ifndef SET_FPEXC_CTL
-# define SET_FPEXC_CTL(a,b)	(-EINVAL)
+# define SET_FPEXC_CTL(a, b)	(-EINVAL)
 #endif
 #ifndef GET_FPEXC_CTL
-# define GET_FPEXC_CTL(a,b)	(-EINVAL)
+# define GET_FPEXC_CTL(a, b)	(-EINVAL)
 #endif
 #ifndef GET_ENDIAN
-# define GET_ENDIAN(a,b)	(-EINVAL)
+# define GET_ENDIAN(a, b)	(-EINVAL)
 #endif
 #ifndef SET_ENDIAN
-# define SET_ENDIAN(a,b)	(-EINVAL)
+# define SET_ENDIAN(a, b)	(-EINVAL)
 #endif
 #ifndef GET_TSC_CTL
 # define GET_TSC_CTL(a)		(-EINVAL)
@@ -342,7 +342,7 @@ EXPORT_SYMBOL_GPL(kernel_restart);
 static void kernel_shutdown_prepare(enum system_states state)
 {
 	blocking_notifier_call_chain(&reboot_notifier_list,
-		(state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL);
+		(state == SYSTEM_HALT) ? SYS_HALT : SYS_POWER_OFF, NULL);
 	system_state = state;
 	usermodehelper_disable();
 	device_shutdown();
@@ -488,7 +488,7 @@ void ctrl_alt_del(void)
 	else
 		kill_cad_pid(SIGINT, 1);
 }
-	
+
 /*
  * Unprivileged users may change the real gid to the effective gid
  * or vice versa.  (BSD-style)
@@ -502,7 +502,7 @@ void ctrl_alt_del(void)
  *
  * The general idea is that a program which uses just setregid() will be
  * 100% compatible with BSD.  A program which uses just setgid() will be
- * 100% compatible with POSIX with saved IDs. 
+ * 100% compatible with POSIX with saved IDs.
  *
  * SMP: There are not races, the GIDs are checked only by filesystem
  *      operations (as far as semantic preservation is concerned).
@@ -550,7 +550,7 @@ error:
 }
 
 /*
- * setgid() is implemented like SysV w/ SAVED_IDS 
+ * setgid() is implemented like SysV w/ SAVED_IDS
  *
  * SMP: Same implicit races as above.
  */
@@ -615,7 +615,7 @@ static int set_user(struct cred *new)
  *
  * The general idea is that a program which uses just setreuid() will be
  * 100% compatible with BSD.  A program which uses just setuid() will be
- * 100% compatible with POSIX with saved IDs. 
+ * 100% compatible with POSIX with saved IDs.
  */
 SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid)
 {
@@ -666,17 +666,17 @@ error:
 	abort_creds(new);
 	return retval;
 }
-		
+
 /*
- * setuid() is implemented like SysV with SAVED_IDS 
- * 
+ * setuid() is implemented like SysV with SAVED_IDS
+ *
  * Note that SAVED_ID's is deficient in that a setuid root program
- * like sendmail, for example, cannot set its uid to be a normal 
+ * like sendmail, for example, cannot set its uid to be a normal
  * user and then switch back, because if you're root, setuid() sets
  * the saved uid too.  If you don't like this, blame the bright people
  * in the POSIX committee and/or USG.  Note that the BSD-style setreuid()
  * will allow a root program to temporarily drop privileges and be able to
- * regain them by swapping the real and effective uid.  
+ * regain them by swapping the real and effective uid.
  */
 SYSCALL_DEFINE1(setuid, uid_t, uid)
 {
@@ -1282,7 +1282,7 @@ SYSCALL_DEFINE2(getrlimit, unsigned int, resource, struct rlimit __user *, rlim)
 /*
  *	Back compatibility for getrlimit. Needed for some apps.
  */
- 
+
 SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
 		struct rlimit __user *, rlim)
 {
@@ -1297,7 +1297,7 @@ SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
 		x.rlim_cur = 0x7FFFFFFF;
 	if (x.rlim_max > 0x7FFFFFFF)
 		x.rlim_max = 0x7FFFFFFF;
-	return copy_to_user(rlim, &x, sizeof(x))?-EFAULT:0;
+	return copy_to_user(rlim, &x, sizeof(x)) ? -EFAULT : 0;
 }
 
 #endif
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-06-07 15:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <BANLkTikkBgYx2qPVEXyyAbr0Vsi=_vORqA@mail.gmail.com>
2011-06-07 10:39 ` [PATCH 2/7] Kernel: space and brace fixes for user_namespace.c Akshay Joshi
2011-06-07 10:39   ` [PATCH 3/7] Kernel: Fix trailing whitespace in user.c Akshay Joshi
2011-06-07 10:39   ` [PATCH 4/7] Kernel: convert leading spaces to tabs in uid16.c Akshay Joshi
2011-06-07 15:43     ` Akshay Joshi
2011-06-07 10:39   ` [PATCH 5/7] Kernel: add spaces where required by the coding style in acct.c Akshay Joshi
2011-06-07 10:39   ` [PATCH 6/7] Kernel: fix spaces with respect to the coding style in sys.c Akshay Joshi
2011-06-07 10:39   ` [PATCH 7/7] Kernel: style fixes to spaces for sysctl.c Akshay Joshi
2011-06-07 13:30   ` [PATCH 6/7] Kernel: fix spaces with respect to the coding style in sys.c David Howells
2011-06-07 14:54     ` David Howells
2011-06-07 15:44     ` Akshay Joshi
2011-06-07 15:41   ` [PATCH 3/7] Kernel: Fix trailing whitespace in user.c Akshay Joshi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).