* [PATCH] Kernel: Fix coding style in kernel/audit.c
@ 2010-03-08 22:27 wzt.wzt
2010-03-08 15:16 ` Alexey Dobriyan
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: wzt.wzt @ 2010-03-08 22:27 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-audit, eparis, faith
Fix coding style in kernel/audit.c
Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com>
---
kernel/audit.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/kernel/audit.c b/kernel/audit.c
index 5feed23..5164696 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -331,12 +331,12 @@ static int audit_set_backlog_limit(int limit, uid_t loginuid, u32 sessionid,
static int audit_set_enabled(int state, uid_t loginuid, u32 sessionid, u32 sid)
{
int rc;
+
if (state < AUDIT_OFF || state > AUDIT_LOCKED)
return -EINVAL;
rc = audit_do_config_change("audit_enabled", &audit_enabled, state,
loginuid, sessionid, sid);
-
if (!rc)
audit_ever_enabled |= !!state;
@@ -346,8 +346,8 @@ static int audit_set_enabled(int state, uid_t loginuid, u32 sessionid, u32 sid)
static int audit_set_failure(int state, uid_t loginuid, u32 sessionid, u32 sid)
{
if (state != AUDIT_FAIL_SILENT
- && state != AUDIT_FAIL_PRINTK
- && state != AUDIT_FAIL_PANIC)
+ && state != AUDIT_FAIL_PRINTK
+ && state != AUDIT_FAIL_PANIC)
return -EINVAL;
return audit_do_config_change("audit_failure", &audit_failure, state,
@@ -366,7 +366,7 @@ static int audit_set_failure(int state, uid_t loginuid, u32 sessionid, u32 sid)
static void audit_hold_skb(struct sk_buff *skb)
{
if (audit_default &&
- skb_queue_len(&audit_skb_hold_queue) < audit_backlog_limit)
+ skb_queue_len(&audit_skb_hold_queue) < audit_backlog_limit)
skb_queue_tail(&audit_skb_hold_queue, skb);
else
kfree_skb(skb);
@@ -1163,9 +1163,9 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask,
entries over the normal backlog limit */
while (audit_backlog_limit
- && skb_queue_len(&audit_skb_queue) > audit_backlog_limit + reserve) {
+ && skb_queue_len(&audit_skb_queue) > audit_backlog_limit + reserve) {
if (gfp_mask & __GFP_WAIT && audit_backlog_wait_time
- && time_before(jiffies, timeout_start + audit_backlog_wait_time)) {
+ && time_before(jiffies, timeout_start + audit_backlog_wait_time)) {
/* Wait for auditd to drain the queue a little */
DECLARE_WAITQUEUE(wait, current);
@@ -1173,7 +1173,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask,
add_wait_queue(&audit_backlog_wait, &wait);
if (audit_backlog_limit &&
- skb_queue_len(&audit_skb_queue) > audit_backlog_limit)
+ skb_queue_len(&audit_skb_queue) > audit_backlog_limit)
schedule_timeout(timeout_start + audit_backlog_wait_time - jiffies);
__set_current_state(TASK_RUNNING);
@@ -1316,18 +1316,18 @@ void audit_log_n_hex(struct audit_buffer *ab, const unsigned char *buf,
BUG_ON(!ab->skb);
skb = ab->skb;
avail = skb_tailroom(skb);
- new_len = len<<1;
+ new_len = len << 1;
if (new_len >= avail) {
/* Round the buffer request up to the next multiple */
- new_len = AUDIT_BUFSIZ*(((new_len-avail)/AUDIT_BUFSIZ) + 1);
+ new_len = AUDIT_BUFSIZ * (((new_len - avail) / AUDIT_BUFSIZ) + 1);
avail = audit_expand(ab, new_len);
if (!avail)
return;
}
ptr = skb_tail_pointer(skb);
- for (i=0; i<len; i++) {
- *ptr++ = hex[(buf[i] & 0xF0)>>4]; /* Upper nibble */
+ for (i = 0; i < len; i++) {
+ *ptr++ = hex[(buf[i] & 0xF0) >> 4]; /* Upper nibble */
*ptr++ = hex[buf[i] & 0x0F]; /* Lower nibble */
}
*ptr = 0;
--
1.6.5.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] Kernel: Fix coding style in kernel/audit.c
2010-03-08 22:27 [PATCH] Kernel: Fix coding style in kernel/audit.c wzt.wzt
@ 2010-03-08 15:16 ` Alexey Dobriyan
2010-03-08 20:44 ` Al Viro
2010-03-08 20:56 ` Eric Paris
2 siblings, 0 replies; 4+ messages in thread
From: Alexey Dobriyan @ 2010-03-08 15:16 UTC (permalink / raw)
To: wzt.wzt; +Cc: linux-kernel, linux-audit, eparis, faith
On Tue, Mar 09, 2010 at 06:27:42AM +0800, wzt.wzt@gmail.com wrote:
> @@ -346,8 +346,8 @@ static int audit_set_enabled(int state, uid_t loginuid, u32 sessionid, u32 sid)
> static int audit_set_failure(int state, uid_t loginuid, u32 sessionid, u32 sid)
> {
> if (state != AUDIT_FAIL_SILENT
> - && state != AUDIT_FAIL_PRINTK
> - && state != AUDIT_FAIL_PANIC)
> + && state != AUDIT_FAIL_PRINTK
> + && state != AUDIT_FAIL_PANIC)
Come on.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Kernel: Fix coding style in kernel/audit.c
2010-03-08 22:27 [PATCH] Kernel: Fix coding style in kernel/audit.c wzt.wzt
2010-03-08 15:16 ` Alexey Dobriyan
@ 2010-03-08 20:44 ` Al Viro
2010-03-08 20:56 ` Eric Paris
2 siblings, 0 replies; 4+ messages in thread
From: Al Viro @ 2010-03-08 20:44 UTC (permalink / raw)
To: wzt.wzt; +Cc: linux-kernel, linux-audit, eparis, faith
On Tue, Mar 09, 2010 at 06:27:42AM +0800, wzt.wzt@gmail.com wrote:
> Fix coding style in kernel/audit.c
>
> Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com>
NACKed-by: Al Viro <viro@zeniv.linux.org.uk>
NACKed-because: get a life
> static int audit_set_enabled(int state, uid_t loginuid, u32 sessionid, u32 sid)
> {
> int rc;
> +
> if (state < AUDIT_OFF || state > AUDIT_LOCKED)
> return -EINVAL;
>
> rc = audit_do_config_change("audit_enabled", &audit_enabled, state,
> loginuid, sessionid, sid);
> -
> if (!rc)
> audit_ever_enabled |= !!state;
Seriously, people, please stop that masturbation.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] Kernel: Fix coding style in kernel/audit.c
2010-03-08 22:27 [PATCH] Kernel: Fix coding style in kernel/audit.c wzt.wzt
2010-03-08 15:16 ` Alexey Dobriyan
2010-03-08 20:44 ` Al Viro
@ 2010-03-08 20:56 ` Eric Paris
2 siblings, 0 replies; 4+ messages in thread
From: Eric Paris @ 2010-03-08 20:56 UTC (permalink / raw)
To: wzt.wzt; +Cc: linux-kernel, linux-audit
On Tue, 2010-03-09 at 06:27 +0800, wzt.wzt@gmail.com wrote:
> Fix coding style in kernel/audit.c
>
> Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com>
NAK. I think you need to figure out if() statements before you try more
coding style cleanups....
-Eric
>
> ---
> kernel/audit.c | 22 +++++++++++-----------
> 1 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/kernel/audit.c b/kernel/audit.c
> index 5feed23..5164696 100644
> --- a/kernel/audit.c
> +++ b/kernel/audit.c
> @@ -331,12 +331,12 @@ static int audit_set_backlog_limit(int limit, uid_t loginuid, u32 sessionid,
> static int audit_set_enabled(int state, uid_t loginuid, u32 sessionid, u32 sid)
> {
> int rc;
> +
> if (state < AUDIT_OFF || state > AUDIT_LOCKED)
> return -EINVAL;
>
> rc = audit_do_config_change("audit_enabled", &audit_enabled, state,
> loginuid, sessionid, sid);
> -
> if (!rc)
> audit_ever_enabled |= !!state;
>
> @@ -346,8 +346,8 @@ static int audit_set_enabled(int state, uid_t loginuid, u32 sessionid, u32 sid)
> static int audit_set_failure(int state, uid_t loginuid, u32 sessionid, u32 sid)
> {
> if (state != AUDIT_FAIL_SILENT
> - && state != AUDIT_FAIL_PRINTK
> - && state != AUDIT_FAIL_PANIC)
> + && state != AUDIT_FAIL_PRINTK
> + && state != AUDIT_FAIL_PANIC)
> return -EINVAL;
>
> return audit_do_config_change("audit_failure", &audit_failure, state,
> @@ -366,7 +366,7 @@ static int audit_set_failure(int state, uid_t loginuid, u32 sessionid, u32 sid)
> static void audit_hold_skb(struct sk_buff *skb)
> {
> if (audit_default &&
> - skb_queue_len(&audit_skb_hold_queue) < audit_backlog_limit)
> + skb_queue_len(&audit_skb_hold_queue) < audit_backlog_limit)
> skb_queue_tail(&audit_skb_hold_queue, skb);
> else
> kfree_skb(skb);
> @@ -1163,9 +1163,9 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask,
> entries over the normal backlog limit */
>
> while (audit_backlog_limit
> - && skb_queue_len(&audit_skb_queue) > audit_backlog_limit + reserve) {
> + && skb_queue_len(&audit_skb_queue) > audit_backlog_limit + reserve) {
> if (gfp_mask & __GFP_WAIT && audit_backlog_wait_time
> - && time_before(jiffies, timeout_start + audit_backlog_wait_time)) {
> + && time_before(jiffies, timeout_start + audit_backlog_wait_time)) {
>
> /* Wait for auditd to drain the queue a little */
> DECLARE_WAITQUEUE(wait, current);
> @@ -1173,7 +1173,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask,
> add_wait_queue(&audit_backlog_wait, &wait);
>
> if (audit_backlog_limit &&
> - skb_queue_len(&audit_skb_queue) > audit_backlog_limit)
> + skb_queue_len(&audit_skb_queue) > audit_backlog_limit)
> schedule_timeout(timeout_start + audit_backlog_wait_time - jiffies);
>
> __set_current_state(TASK_RUNNING);
> @@ -1316,18 +1316,18 @@ void audit_log_n_hex(struct audit_buffer *ab, const unsigned char *buf,
> BUG_ON(!ab->skb);
> skb = ab->skb;
> avail = skb_tailroom(skb);
> - new_len = len<<1;
> + new_len = len << 1;
> if (new_len >= avail) {
> /* Round the buffer request up to the next multiple */
> - new_len = AUDIT_BUFSIZ*(((new_len-avail)/AUDIT_BUFSIZ) + 1);
> + new_len = AUDIT_BUFSIZ * (((new_len - avail) / AUDIT_BUFSIZ) + 1);
> avail = audit_expand(ab, new_len);
> if (!avail)
> return;
> }
>
> ptr = skb_tail_pointer(skb);
> - for (i=0; i<len; i++) {
> - *ptr++ = hex[(buf[i] & 0xF0)>>4]; /* Upper nibble */
> + for (i = 0; i < len; i++) {
> + *ptr++ = hex[(buf[i] & 0xF0) >> 4]; /* Upper nibble */
> *ptr++ = hex[buf[i] & 0x0F]; /* Lower nibble */
> }
> *ptr = 0;
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-03-08 20:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-08 22:27 [PATCH] Kernel: Fix coding style in kernel/audit.c wzt.wzt
2010-03-08 15:16 ` Alexey Dobriyan
2010-03-08 20:44 ` Al Viro
2010-03-08 20:56 ` Eric Paris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox