Re: [PATCH v2 1/3] blk-cgroup: check for pd_(alloc|free)_fn in blkcg_activate_policy()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

在 2024/07/20 0:25, Bart Van Assche 写道:
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?

I don't know, but I feel more comfortable to use '!=' myself.

Thanks,
Kuai


Thanks,

Bart.

.






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux