All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giuseppe Scrivano <gscrivan@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Xu Wang <vulab@iscas.ac.cn>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH] hugetlb_cgroup: convert comma to semicolon
Date: Wed, 19 Aug 2020 10:14:11 +0200	[thread overview]
Message-ID: <87eeo32gto.fsf@redhat.com> (raw)
In-Reply-To: <20200818184036.d6c479446b2c3b231d1e3bff@linux-foundation.org> (Andrew Morton's message of "Tue, 18 Aug 2020 18:40:36 -0700")

Andrew Morton <akpm@linux-foundation.org> writes:

> On Tue, 18 Aug 2020 06:43:33 +0000 Xu Wang <vulab@iscas.ac.cn> wrote:
>
>> Replace a comma between expression statements by a semicolon.
>> 
>> ...
>>
>> --- a/mm/hugetlb_cgroup.c
>> +++ b/mm/hugetlb_cgroup.c
>> @@ -655,7 +655,7 @@ static void __init __hugetlb_cgroup_file_dfl_init(int idx)
>>  	snprintf(cft->name, MAX_CFTYPE_NAME, "%s.events", buf);
>>  	cft->private = MEMFILE_PRIVATE(idx, 0);
>>  	cft->seq_show = hugetlb_events_show;
>> -	cft->file_offset = offsetof(struct hugetlb_cgroup, events_file[idx]),
>> +	cft->file_offset = offsetof(struct hugetlb_cgroup, events_file[idx]);
>>  	cft->flags = CFTYPE_NOT_ON_ROOT;
>>  
>>  	/* Add the events.local file */
>> @@ -664,7 +664,7 @@ static void __init __hugetlb_cgroup_file_dfl_init(int idx)
>>  	cft->private = MEMFILE_PRIVATE(idx, 0);
>>  	cft->seq_show = hugetlb_events_local_show;
>>  	cft->file_offset = offsetof(struct hugetlb_cgroup,
>> -				    events_local_file[idx]),
>> +				    events_local_file[idx]);
>>  	cft->flags = CFTYPE_NOT_ON_ROOT;
>>  
>>  	/* NULL terminate the last cft */
>
> Fixes: faced7e0806cf4 ("mm: hugetlb controller for cgroups v2")

Xu, thanks for spotting it.  Was this code causing any issue or have you
found by inspecting it?

> Wow, why does this code even work.  Presumably the initial value of
> cft->file_offset simply doesn't matter.  Giuseppe, could you please
> check?  We might have some unneeded code in there.

I think in this case having two expressions as part of the same
statement is equivalent to having two separate statements.  Both
cft->file_offset and cft->flags get the expected value.

Regards,
Giuseppe


  reply	other threads:[~2020-08-19  8:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18  6:43 [PATCH] hugetlb_cgroup: convert comma to semicolon Xu Wang
2020-08-19  1:40 ` Andrew Morton
2020-08-19  8:14   ` Giuseppe Scrivano [this message]
2020-08-19  8:14     ` Giuseppe Scrivano
2020-08-23 15:21     ` Matthew Wilcox
2020-08-23 15:54       ` Matthew Wilcox
2020-08-23 16:04       ` Joe Perches
2020-08-23 16:04         ` Joe Perches

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=87eeo32gto.fsf@redhat.com \
    --to=gscrivan@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tj@kernel.org \
    --cc=vulab@iscas.ac.cn \
    /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.