From: Akshay Joshi <me@akshayjoshi.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Akshay Joshi <me@akshayjoshi.com>,
Al Viro <viro@zeniv.linux.org.uk>, Christoph Hellwig <hch@lst.de>,
linux-kernel@vger.kernel.org
Subject: [PATCH 5/7] Kernel: add spaces where required by the coding style in acct.c.
Date: Tue, 7 Jun 2011 06:39:38 -0400 [thread overview]
Message-ID: <1307443181-22278-5-git-send-email-me@akshayjoshi.com> (raw)
In-Reply-To: <1307443181-22278-2-git-send-email-me@akshayjoshi.com>
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
next prev parent reply other threads:[~2011-06-07 10:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[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 ` Akshay Joshi [this message]
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
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=1307443181-22278-5-git-send-email-me@akshayjoshi.com \
--to=me@akshayjoshi.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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
all inboxes | Powered by JetHome®