From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Thomas Monjalon" <thomas@monjalon.net>,
"Andre Muezerie" <andremue@linux.microsoft.com>,
"Stephen Hemminger" <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, <honnappa.nagarahalli@arm.com>,
<doug.foster@arm.com>, <david.marchand@redhat.com>
Subject: RE: [PATCH v3] rcu: shift 64-bit constant to avoid implicit 32 to 64 bit conversion
Date: Tue, 19 Nov 2024 10:43:38 +0100 [thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F8D3@smartserver.smartshare.dk> (raw)
In-Reply-To: <2042671.PIDvDuAF1L@thomas>
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Tuesday, 19 November 2024 10.26
>
> 15/11/2024 17:18, Stephen Hemminger:
> > On Fri, 15 Nov 2024 07:25:30 -0800
> > Andre Muezerie <andremue@linux.microsoft.com> wrote:
> >
> > > From reading the code this is also a bugfix:
> > > (1 << id), where id = thread_id & 0x3f, was wrong when thread_id >
> 0x1f.
> >
> > Since this seems to be a common anti-pattern in DPDK,
> > I wonder if coccinelle is smart enough to be able to make a script
> for these?
>
> A simple grep '1UL << ' would do it as well.
Or more broadly:
"\D1[uU]?[lL]?[lL]?\s*<<\s*"
> We could add a checkpatch warning for this pattern.
+1
And refer to RTE_BIT32/64() macros.
next prev parent reply other threads:[~2024-11-19 9:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 22:02 [PATCH] " Andre Muezerie
2024-11-13 3:12 ` Honnappa Nagarahalli
2024-11-13 3:31 ` Morten Brørup
2024-11-13 16:23 ` [PATCH v2] " Andre Muezerie
2024-11-15 14:21 ` David Marchand
2024-11-15 14:45 ` Andre Muezerie
2024-11-15 15:25 ` [PATCH v3] " Andre Muezerie
2024-11-15 16:18 ` Stephen Hemminger
2024-11-19 9:26 ` Thomas Monjalon
2024-11-19 9:43 ` Morten Brørup [this message]
2024-11-19 9:59 ` Thomas Monjalon
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=98CBD80474FA8B44BF855DF32C47DC35E9F8D3@smartserver.smartshare.dk \
--to=mb@smartsharesystems.com \
--cc=andremue@linux.microsoft.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=doug.foster@arm.com \
--cc=honnappa.nagarahalli@arm.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/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).