mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Christoph Hellwig <hch@infradead.org>, Yu Kuai <yukuai1@huaweicloud.com>
Cc: jack@suse.cz, tj@kernel.org, josef@toxicpanda.com,
	axboe@kernel.dk, cgroups@vger.kernel.org,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	yukuai3@huawei.com, yi.zhang@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH v2 1/3] blk-cgroup: check for pd_(alloc|free)_fn in blkcg_activate_policy()
Date: Fri, 19 Jul 2024 09:25:07 -0700	[thread overview]
Message-ID: <ab8f117b-0e0a-4157-b261-471328f6b4e3@acm.org> (raw)
In-Reply-To: <Zpn5zvcC4TbDxeKU@infradead.org>

On 7/18/24 10:29 PM, Christoph Hellwig wrote:
> On Fri, Jul 19, 2024 at 10:34:29AM +0800, Yu Kuai wrote:
>> +	/*
>> +	 * Make sure cpd/pd_alloc_fn and cpd/pd_free_fn in pairs, and policy
>> +	 * without pd_alloc_fn/pd_free_fn can't be activated.
>> +	 */
>>   	if ((!pol->cpd_alloc_fn ^ !pol->cpd_free_fn) ||
>>   		(!pol->pd_alloc_fn ^ !pol->pd_free_fn))
>>   		goto err_unlock;
>> -- 
> 
> I know this is existing code, but can you fix up the incorrect
> indentation while you touch this:
> 
>   	if ((!pol->cpd_alloc_fn ^ !pol->cpd_free_fn) ||
>   	    (!pol->pd_alloc_fn ^ !pol->pd_free_fn))

Using xor (^) for booleans seems weird to me. Is there any preference in
Linux kernel code whether to use ^ or != to check whether to booleans
are different?

Thanks,

Bart.


  parent reply	other threads:[~2024-07-19 16:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-19  2:34 [PATCH v2 0/3] blk-ioprio: remove per-disk structure Yu Kuai
2024-07-19  2:34 ` [PATCH v2 1/3] blk-cgroup: check for pd_(alloc|free)_fn in blkcg_activate_policy() Yu Kuai
2024-07-19  5:29   ` Christoph Hellwig
2024-07-19  7:14     ` Yu Kuai
2024-07-19 16:25     ` Bart Van Assche [this message]
2024-07-20  7:17       ` Yu Kuai
2024-07-19  2:34 ` [PATCH v2 2/3] blk-ioprio: remove ioprio_blkcg_from_bio() Yu Kuai
2024-07-19  5:30   ` Christoph Hellwig
2024-07-19 16:26   ` Bart Van Assche
2024-07-19  2:34 ` [PATCH v2 3/3] blk-ioprio: remove per-disk structure Yu Kuai
2024-07-19  5:30   ` Christoph Hellwig
2024-07-19 16:26   ` Bart Van Assche

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=ab8f117b-0e0a-4157-b261-471328f6b4e3@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=cgroups@vger.kernel.org \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai1@huaweicloud.com \
    --cc=yukuai3@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®