Re: [v8 3/3] PCI: amd-mdb: Add AMD MDB Root Port driver

From: Bjorn Helgaas
Date: Tue Feb 11 2025 - 18:17:05 EST


On Fri, Feb 07, 2025 at 07:39:03AM +0100, Markus Elfring wrote:
> > I don't *really* like guard() anyway because it's kind of magic in
> > that the unlock doesn't actually appear in the code, and it's kind of
> > hard to unravel what guard() is and how it works. But I guess that's
> > mostly because it's just a new idiom that takes time to internalize.
>
> How will the circumstances evolve further for growing applications of
> scope-based resource management?

I'm sure it will evolve to become the typical style. Right now, it's
not quite there yet, as evidenced by the fact that the only reference
to them in Documentation/ is this somewhat ambivalent note:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/maintainer-netdev.rst?id=v6.13#n380

We do already have a few uses of guard() and scoped_guard() in
drivers/pci, and I don't really object to more, including in this
amd-mdb case. Whatever we do, I *would* want to do it consistently
throughout the file.

Bjorn