[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1268081763.3227.6.camel@localhost>
Date: Mon, 08 Mar 2010 15:56:03 -0500
From: Eric Paris <eparis@...hat.com>
To: wzt.wzt@...il.com
Cc: linux-kernel@...r.kernel.org, linux-audit@...hat.com
Subject: Re: [PATCH] Kernel: Fix coding style in kernel/audit.c
On Tue, 2010-03-09 at 06:27 +0800, wzt.wzt@...il.com wrote:
> Fix coding style in kernel/audit.c
>
> Signed-off-by: Zhitong Wang <zhitong.wangzt@...baba-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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists