On 12/16/25 1:45 AM, Timur Tabi wrote:
On Mon, 2025-12-15 at 11:40 +0000, Gary Guo wrote:
+static mut DEBUGFS_ROOT: Option<Dir> = None;

Please don't use `static mut`. If you need anything associcated with the
lifetime of the driver, please just put it into the module.

If I do that, then how do I access it from gsp.rs (the last patch in this 
series)?

Given that the current PCI .probe() doesn't pass in module data,
I looked around and saw that Binder is using global_lock!()
instead of passing around module data. It seems like this area
is still new in Rust for Linux.

I wonder if global_lock!() is what Gary had in mind? That is still
effectively global access, but at least it's synchronized,
unlike static mut.


thanks,
--
John Hubbard

Reply via email to