mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>,
	Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: "Alexandre Courbot" <acourbot@nvidia.com>,
	"Joel Fernandes" <joelagnelf@nvidia.com>,
	"Timur Tabi" <ttabi@nvidia.com>,
	"Alistair Popple" <apopple@nvidia.com>,
	"Eliot Courtney" <ecourtney@nvidia.com>,
	"Shashank Sharma" <shashanks@nvidia.com>,
	"Zhi Wang" <zhiw@nvidia.com>, "David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	rust-for-linux@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpu: nova-core: fix three clippy::precedence warnings
Date: Sat, 4 Apr 2026 14:34:00 -0700	[thread overview]
Message-ID: <d6ecac3f-43f9-4830-8523-c91d29fd1416@nvidia.com> (raw)
In-Reply-To: <DHKC3P4FZHOB.1OCA9MC9ETDWG@kernel.org>

On 4/4/26 4:29 AM, Danilo Krummrich wrote:
> On Sat Apr 4, 2026 at 1:13 PM CEST, Miguel Ojeda wrote:
>> On Sat, Apr 4, 2026 at 4:58 AM John Hubbard <jhubbard@nvidia.com> wrote:
>>>
>>> Clippy warns when shifts and bitwise-OR are mixed without parentheses,
>>> because the relative precedence of << and | is easy to misread. This was
>>> causing 3 warnings in drm-rust-next.
>>>
>>> For read_sysmem_flush_page_ga100(), add explicit parentheses.
>>>
>>> For the PCI ROM header parsing, replace the manual byte-shifting with
>>> u32::from_le_bytes(), which both fixes the warning and is clearer about
>>> the intended byte order.
>>>
>>> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
>>
>> Please see:
>>
>>   https://lore.kernel.org/rust-for-linux/20260401114540.30108-34-ojeda@kernel.org/
>>
>> i.e. the plan was to allow it, since it may be a bit too annoying for
>> some. It was also the reason it was split upstream into a new lint,
>> which is why you only see it in Rust 1.85.0:
>>
>>   The Clippy `precedence` lint was extended in Rust 1.85.0 to include
>>   bitmasking and shift operations [1]. However, because it generated
>>   many hits, in Rust 1.86.0 it was split into a new `precedence_bits`
>>   lint which is not enabled by default [2].
>>
>>   In other words, only Rust 1.85 has a different behavior.
>>
>> Having said that, if people prefer to have the extra parenthesis in
>> that case, then I don't mind to keep it enabled.
> 
> I don't mind having the extra parenthesis, but I think we should disable the
> lint regardless, as I think it is a bit too much.
> 
> I also think we should drop this patch, as it is not worth the churn, if we
> disable the lint.

OK, I sent v2 out before I noticed this, but I agree. :)

thanks,
-- 
John Hubbard


      reply	other threads:[~2026-04-04 21:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-04  2:58 John Hubbard
2026-04-04  5:45 ` Alexandre Courbot
2026-04-04  6:14   ` John Hubbard
2026-04-04 11:13 ` Miguel Ojeda
2026-04-04 11:29   ` Danilo Krummrich
2026-04-04 21:34     ` John Hubbard [this message]

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=d6ecac3f-43f9-4830-8523-c91d29fd1416@nvidia.com \
    --to=jhubbard@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=apopple@nvidia.com \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=ecourtney@nvidia.com \
    --cc=gary@garyguo.net \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=shashanks@nvidia.com \
    --cc=simona@ffwll.ch \
    --cc=tmgross@umich.edu \
    --cc=ttabi@nvidia.com \
    --cc=zhiw@nvidia.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

all inboxes | Powered by JetHome®