All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Giuseppe Scrivano <gscrivan@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	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: Sun, 23 Aug 2020 16:21:30 +0100	[thread overview]
Message-ID: <20200823152130.GA17456@casper.infradead.org> (raw)
In-Reply-To: <87eeo32gto.fsf@redhat.com>

On Wed, Aug 19, 2020 at 10:14:11AM +0200, Giuseppe Scrivano wrote:
> >> -	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;
> 
> 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.

That's not how the comma operator works.

It will evaluate offsetof(struct hugetlb_cgroup, events_file[idx]) and
then discard the result.  Since it has no side-effects, this is effectively
doing:

	cft->file_offset = cft->flags = CFTYPE_NOT_ON_ROOT;

  reply	other threads:[~2020-08-23 15:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18  6:43 Xu Wang
2020-08-19  1:40 ` Andrew Morton
2020-08-19  8:14   ` Giuseppe Scrivano
2020-08-19  8:14     ` Giuseppe Scrivano
2020-08-23 15:21     ` Matthew Wilcox [this message]
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=20200823152130.GA17456@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=gscrivan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tj@kernel.org \
    --cc=vulab@iscas.ac.cn \
    --subject='Re: [PATCH] hugetlb_cgroup: convert comma to semicolon' \
    /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 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.