netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Petr Machata <petrm@nvidia.com>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>,
	<edumazet@google.com>, <pabeni@redhat.com>, <sdf@fomichev.me>,
	<shuah@kernel.org>
Subject: Re: [PATCH net-next v2] selftests: net: ksft: print more of the stack for checks
Date: Wed, 31 Jul 2024 07:48:14 -0700	[thread overview]
Message-ID: <20240731074814.7043d9ac@kernel.org> (raw)
In-Reply-To: <87h6c57q4b.fsf@nvidia.com>

On Wed, 31 Jul 2024 13:07:26 +0200 Petr Machata wrote:
> > +            started |= frame.function == 'ksft_run'  
> 
> Hmm, using bitwise operations on booleans is somewhat unusual in Python
> I think, especially if here the short-circuiting of "or" wouldn't be a
> problem. But it doesn't degrade to integers so I guess it's well-defined.

Right, I thought the automatic conversions to booleans are sometimes
considered in poor taste in Python, but wasn't aware that bitwise ops
may be frowned upon. IIUC the alternative would be:

	if frame.function == 'ksft_run':
		started = True

or

	started = started or frame.function == 'ksft_run'

or another way?

  reply	other threads:[~2024-07-31 14:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31  1:33 [PATCH net-next v2] selftests: net: ksft: print more of the stack for checks Jakub Kicinski
2024-07-31 11:07 ` Petr Machata
2024-07-31 14:48   ` Jakub Kicinski [this message]
2024-08-01  9:02     ` Petr Machata

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=20240731074814.7043d9ac@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    /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).