All of lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Rongwei Wang <rongwei.wang@linux.alibaba.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, sj@kernel.org,
	akpm@linux-foundation.org
Subject: Re: [PATCH] mm/damon/dbgfs: remove unnecessary variables
Date: Wed, 13 Oct 2021 15:04:13 +0000	[thread overview]
Message-ID: <20211013150413.23027-1-sj@kernel.org> (raw)
In-Reply-To: <20211013130901.1017-1-rongwei.wang@linux.alibaba.com>

Hi Rongwei,


Thank you for this patch!  Looks good to me overall.  I left a couple of
nitpicks below, though.

On Wed, 13 Oct 2021 21:09:01 +0800 Rongwei Wang <rongwei.wang@linux.alibaba.com> wrote:

[...]
> @@ -352,7 +350,7 @@ static ssize_t dbgfs_target_ids_write(struct file *file,
>  
>  	nrs = kbuf;
>  
> -	targets = str_to_target_ids(nrs, ret, &nr_targets);
> +	targets = str_to_target_ids(nrs, count, &nr_targets);
>  	if (!targets) {
>  		ret = -ENOMEM;
>  		goto out;
> @@ -378,12 +376,12 @@ static ssize_t dbgfs_target_ids_write(struct file *file,
>  		goto unlock_out;
>  	}
>  
> -	err = damon_set_targets(ctx, targets, nr_targets);
> -	if (err) {
> +	ret = damon_set_targets(ctx, targets, nr_targets);
> +	if (ret < 0) {

I'd prefer 'if (ret) {', to be consistent with other part.

>  		if (targetid_is_pid(ctx))
>  			dbgfs_put_pids(targets, nr_targets);
> -		ret = err;
> -	}
> +	} else
> +		ret = count;

I'd prefer this to have braces:
https://docs.kernel.org/process/coding-style.html#placing-braces-and-spaces

>  
>  unlock_out:
>  	mutex_unlock(&ctx->kdamond_lock);
> @@ -548,8 +546,7 @@ static ssize_t dbgfs_mk_context_write(struct file *file,
[...]


Thanks,
SJ


  reply	other threads:[~2021-10-13 15:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13 13:09 [PATCH] mm/damon/dbgfs: remove unnecessary variables Rongwei Wang
2021-10-13 15:04 ` SeongJae Park [this message]
2021-10-13 16:27   ` Rongwei Wang

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=20211013150413.23027-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rongwei.wang@linux.alibaba.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.