From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <kuba@kernel.org>
Cc: <davem@davemloft.net>, <edumazet@google.com>,
<kuni1840@gmail.com>, <kuniyu@amazon.com>,
<netdev@vger.kernel.org>, <pabeni@redhat.com>
Subject: Re: [PATCH v1 net-next 2/6] net: Don't register pernet_operations if only one of id or size is specified.
Date: Wed, 31 Jul 2024 11:43:49 -0700 [thread overview]
Message-ID: <20240731184349.49985-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20240730185412.2a18262c@kernel.org>
From: Jakub Kicinski <kuba@kernel.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!
next prev parent reply other threads:[~2024-07-31 18:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-29 21:07 [PATCH v1 net-next 0/6] net: Random cleanup for netns initialisation Kuniyuki Iwashima
2024-07-29 21:07 ` [PATCH v1 net-next 1/6] l2tp: Don't assign net->gen->ptr[] for pppol2tp_net_ops Kuniyuki Iwashima
2024-07-31 1:52 ` Jakub Kicinski
2024-07-31 18:39 ` Kuniyuki Iwashima
2024-07-29 21:07 ` [PATCH v1 net-next 2/6] net: Don't register pernet_operations if only one of id or size is specified Kuniyuki Iwashima
2024-07-31 1:54 ` Jakub Kicinski
2024-07-31 18:43 ` Kuniyuki Iwashima [this message]
2024-07-29 21:07 ` [PATCH v1 net-next 3/6] net: Initialise net->passive once in preinit_net() Kuniyuki Iwashima
2024-07-29 21:07 ` [PATCH v1 net-next 4/6] net: Call preinit_net() without pernet_ops_rwsem Kuniyuki Iwashima
2024-07-29 21:08 ` [PATCH v1 net-next 5/6] net: Slim down setup_net() Kuniyuki Iwashima
2024-07-29 21:08 ` [PATCH v1 net-next 6/6] net: Initialise net.core sysctl defaults in preinit_net() Kuniyuki Iwashima
2024-07-31 1:52 ` [PATCH v1 net-next 0/6] net: Random cleanup for netns initialisation Jakub Kicinski
2024-07-31 18:46 ` Kuniyuki Iwashima
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=20240731184349.49985-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).