LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: "Joshua I. James" <joshua@cybercrimetech.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: kernel: fixed style warnings in acct.c
Date: Fri, 5 Dec 2014 17:30:47 +0530	[thread overview]
Message-ID: <20141205120047.GB8884@sudip-PC> (raw)
In-Reply-To: <1417754854-6576-1-git-send-email-Joshua@cybercrimetech.com>

On Fri, Dec 05, 2014 at 01:47:34PM +0900, Joshua I. James wrote:
> From: "Joshua I. James" <joshua@cybercrimetech.com>
> 
> Fixed style errors identified by checkpatch.
> 
> Output of checkpatch:
> WARNING: Missing a blank line after declarations
> WARNING: line over 80 characters
> ERROR: spaces required around that '==' (ctx:VxV)
> +#if ACCT_VERSION==2
> 
> Signed-off-by: Joshua I. James <joshua@cybercrimetech.com>

1) kernel is not part of staging. Give your subject properly.
2) Do not use Initials in your From and Signed-off.

thanks
sudip

> ---
>  kernel/acct.c | 22 ++++++++++++++++------
>  1 file changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/kernel/acct.c b/kernel/acct.c
> index 33738ef..322159c 100644
> --- a/kernel/acct.c
> +++ b/kernel/acct.c
> @@ -105,6 +105,7 @@ static int check_free_space(struct bsd_acct_struct *acct)
>  
>  	if (acct->active) {
>  		u64 suspend = sbuf.f_blocks * SUSPEND;
> +
>  		do_div(suspend, 100);
>  		if (sbuf.f_bavail <= suspend) {
>  			acct->active = 0;
> @@ -112,6 +113,7 @@ static int check_free_space(struct bsd_acct_struct *acct)
>  		}
>  	} else {
>  		u64 resume = sbuf.f_blocks * RESUME;
> +
>  		do_div(resume, 100);
>  		if (sbuf.f_bavail >= resume) {
>  			acct->active = 1;
> @@ -152,8 +154,10 @@ again:
>  
>  static void close_work(struct work_struct *work)
>  {
> -	struct bsd_acct_struct *acct = container_of(work, struct bsd_acct_struct, work);
> +	struct bsd_acct_struct *acct =
> +		container_of(work, struct bsd_acct_struct, work);
>  	struct file *file = acct->file;
> +
>  	if (file->f_op->flush)
>  		file->f_op->flush(file, NULL);
>  	__fput_sync(file);
> @@ -165,6 +169,7 @@ static void acct_kill(struct bsd_acct_struct *acct,
>  {
>  	if (acct) {
>  		struct pid_namespace *ns = acct->ns;
> +
>  		do_acct_process(acct);
>  		INIT_WORK(&acct->work, close_work);
>  		init_completion(&acct->done);
> @@ -182,6 +187,7 @@ static void acct_kill(struct bsd_acct_struct *acct,
>  static void acct_pin_kill(struct fs_pin *pin)
>  {
>  	struct bsd_acct_struct *acct;
> +
>  	acct = container_of(pin, struct bsd_acct_struct, pin);
>  	mutex_lock(&acct->lock);
>  	if (!acct->ns) {
> @@ -448,15 +454,17 @@ static void fill_ac(acct_t *ac)
>  #endif
>  	do_div(elapsed, AHZ);
>  	ac->ac_btime = get_seconds() - elapsed;
> -#if ACCT_VERSION==2
> +#if ACCT_VERSION == 2
>  	ac->ac_ahz = AHZ;
>  #endif
>  
>  	spin_lock_irq(&current->sighand->siglock);
>  	tty = current->signal->tty;	/* Safe as we hold the siglock */
>  	ac->ac_tty = tty ? old_encode_dev(tty_devnum(tty)) : 0;
> -	ac->ac_utime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_utime)));
> -	ac->ac_stime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_stime)));
> +	ac->ac_utime = encode_comp_t(jiffies_to_AHZ(
> +		cputime_to_jiffies(pacct->ac_utime)));
> +	ac->ac_stime = encode_comp_t(jiffies_to_AHZ(
> +		cputime_to_jiffies(pacct->ac_stime)));
>  	ac->ac_flag = pacct->ac_flag;
>  	ac->ac_mem = encode_comp_t(pacct->ac_mem);
>  	ac->ac_minflt = encode_comp_t(pacct->ac_minflt);
> @@ -504,8 +512,8 @@ static void do_acct_process(struct bsd_acct_struct *acct)
>  
>  		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);
> +		ac.ac_ppid = task_tgid_nr_ns(rcu_dereference(
> +			current->real_parent), ns);
>  		rcu_read_unlock();
>  	}
>  #endif
> @@ -516,6 +524,7 @@ static void do_acct_process(struct bsd_acct_struct *acct)
>  	if (file_start_write_trylock(file)) {
>  		/* it's been opened O_APPEND, so position is irrelevant */
>  		loff_t pos = 0;
> +
>  		__kernel_write(file, (char *)&ac, sizeof(acct_t), &pos);
>  		file_end_write(file);
>  	}
> @@ -573,6 +582,7 @@ static void slow_acct_process(struct pid_namespace *ns)
>  {
>  	for ( ; ns; ns = ns->parent) {
>  		struct bsd_acct_struct *acct = acct_get(ns);
> +
>  		if (acct) {
>  			do_acct_process(acct);
>  			mutex_unlock(&acct->lock);
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

      parent reply	other threads:[~2014-12-05 12:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05  4:47 Joshua I. James
2014-12-05 11:04 ` Jeremiah Mahler
2014-12-05 12:00 ` Sudip Mukherjee [this message]

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=20141205120047.GB8884@sudip-PC \
    --to=sudipm.mukherjee@gmail.com \
    --cc=joshua@cybercrimetech.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] staging: kernel: fixed style warnings in acct.c' \
    /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

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).