[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240731184349.49985-1-kuniyu@amazon.com>
Date: Wed, 31 Jul 2024 11:43:49 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <kuba@...nel.org>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <kuni1840@...il.com>,
<kuniyu@...zon.com>, <netdev@...r.kernel.org>, <pabeni@...hat.com>
Subject: Re: [PATCH v1 net-next 2/6] net: Don't register pernet_operations if only one of id or size is specified.
From: Jakub Kicinski <kuba@...nel.org>
Date: Tue, 30 Jul 2024 18:54:12 -0700
> On Mon, 29 Jul 2024 14:07:57 -0700 Kuniyuki Iwashima wrote:
> > + if (WARN_ON((ops->id && !ops->size) || (!ops->id && ops->size)))
>
> I'd write as:
>
> if (WARN_ON(!!ops->id != !!ops->size))
>
> or
>
> if (WARN_ON(!!ops->id ^ !!ops->size))
>
> but not 100% sure if it's idiomatic or just my preference..
Actually I wrote the latter first so will use it in v2.
Just not confident about which was easier to read.
Thanks!
Powered by blists - more mailing lists