[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240730185412.2a18262c@kernel.org>
Date: Tue, 30 Jul 2024 18:54:12 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Kuniyuki Iwashima
<kuni1840@...il.com>, <netdev@...r.kernel.org>
Subject: Re: [PATCH v1 net-next 2/6] net: Don't register pernet_operations
if only one of id or size is specified.
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..
Powered by blists - more mailing lists