[PATCH 7/9] gpu: nova-core: firmware: fwsec: do not require bound device when unneeded

Alexandre Courbot posted 9 patches 1 week, 4 days ago
There is a newer version of this series
[PATCH 7/9] gpu: nova-core: firmware: fwsec: do not require bound device when unneeded
Posted by Alexandre Courbot 1 week, 4 days ago
`run` doesn't require a bound device as its argument.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/gpu/nova-core/firmware/fwsec.rs | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/nova-core/firmware/fwsec.rs b/drivers/gpu/nova-core/firmware/fwsec.rs
index b28e34d279f4..b98b1286dc94 100644
--- a/drivers/gpu/nova-core/firmware/fwsec.rs
+++ b/drivers/gpu/nova-core/firmware/fwsec.rs
@@ -412,12 +412,7 @@ pub(crate) fn new(
     }
 
     /// Loads the FWSEC firmware into `falcon` and execute it.
-    pub(crate) fn run(
-        &self,
-        dev: &Device<device::Bound>,
-        falcon: &Falcon<Gsp>,
-        bar: &Bar0,
-    ) -> Result<()> {
+    pub(crate) fn run(&self, dev: &Device, falcon: &Falcon<Gsp>, bar: &Bar0) -> Result<()> {
         // Reset falcon, load the firmware, and run it.
         falcon
             .reset(bar)

-- 
2.52.0
Re: [PATCH 7/9] gpu: nova-core: firmware: fwsec: do not require bound device when unneeded
Posted by lyude@redhat.com 1 week ago
Reviewed-by: Lyude Paul <lyude@redhat.com>

On Mon, 2025-12-08 at 18:26 +0900, Alexandre Courbot wrote:
> `run` doesn't require a bound device as its argument.
> 
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> ---
>  drivers/gpu/nova-core/firmware/fwsec.rs | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/nova-core/firmware/fwsec.rs
> b/drivers/gpu/nova-core/firmware/fwsec.rs
> index b28e34d279f4..b98b1286dc94 100644
> --- a/drivers/gpu/nova-core/firmware/fwsec.rs
> +++ b/drivers/gpu/nova-core/firmware/fwsec.rs
> @@ -412,12 +412,7 @@ pub(crate) fn new(
>      }
>  
>      /// Loads the FWSEC firmware into `falcon` and execute it.
> -    pub(crate) fn run(
> -        &self,
> -        dev: &Device<device::Bound>,
> -        falcon: &Falcon<Gsp>,
> -        bar: &Bar0,
> -    ) -> Result<()> {
> +    pub(crate) fn run(&self, dev: &Device, falcon: &Falcon<Gsp>,
> bar: &Bar0) -> Result<()> {
>          // Reset falcon, load the firmware, and run it.
>          falcon
>              .reset(bar)
Re: [PATCH 7/9] gpu: nova-core: firmware: fwsec: do not require bound device when unneeded
Posted by Timur Tabi 1 week, 3 days ago
On Mon, 2025-12-08 at 18:26 +0900, Alexandre Courbot wrote:
>      /// Loads the FWSEC firmware into `falcon` and execute it.
> -    pub(crate) fn run(
> -        &self,
> -        dev: &Device<device::Bound>,
> -        falcon: &Falcon<Gsp>,
> -        bar: &Bar0,
> -    ) -> Result<()> {
> +    pub(crate) fn run(&self, dev: &Device, falcon: &Falcon<Gsp>, bar: &Bar0) -> Result<()> {

I frequently see patches that, when they change the function signature, rearrange the parameters
from one line to multiple lines.  Here, you are doing the opposite.  Not only that, but it seems
unnecessary because you're actually just changing one parameter, so you should only be replacing
one line.

It seems to me that some people have their editors configured to prefer one line, and others
have their editor configured to prefer multiple lines, so whenever there's a signature change,
we get diffs like this.

Re: [PATCH 7/9] gpu: nova-core: firmware: fwsec: do not require bound device when unneeded
Posted by John Hubbard 1 week, 3 days ago
On 12/8/25 8:18 AM, Timur Tabi wrote:
> On Mon, 2025-12-08 at 18:26 +0900, Alexandre Courbot wrote:
...
> I frequently see patches that, when they change the function signature, rearrange the parameters
> from one line to multiple lines.  Here, you are doing the opposite.  Not only that, but it seems
> unnecessary because you're actually just changing one parameter, so you should only be replacing
> one line.
> 
> It seems to me that some people have their editors configured to prefer one line, and others
> have their editor configured to prefer multiple lines, so whenever there's a signature change,
> we get diffs like this.

Nope, what's actually happening is that (nearly) everyone has
their editor set up to run rustfmt(1) upon file save. That's
the convention used in Rust for Linux. (Failing that, one is
expected to run rustfmt before posting.)

It is a little jumpy, as you can see above, but it does have
the nice property of avoiding formatting discussions, since
there is only one way for things to end up.

thanks,
-- 
John Hubbard
Re: [PATCH 7/9] gpu: nova-core: firmware: fwsec: do not require bound device when unneeded
Posted by Timur Tabi 1 week, 3 days ago
On Mon, 2025-12-08 at 08:51 -0800, John Hubbard wrote:
> It is a little jumpy, as you can see above, but it does have
> the nice property of avoiding formatting discussions, 

Apparently not.

> since
> there is only one way for things to end up.

That's not my observation.  Like I said, it appears to oscillate.
Re: [PATCH 7/9] gpu: nova-core: firmware: fwsec: do not require bound device when unneeded
Posted by Alexandre Courbot 1 week, 3 days ago
On Tue Dec 9, 2025 at 2:55 AM JST, Timur Tabi wrote:
> On Mon, 2025-12-08 at 08:51 -0800, John Hubbard wrote:
>> It is a little jumpy, as you can see above, but it does have
>> the nice property of avoiding formatting discussions, 
>
> Apparently not.
>
>> since
>> there is only one way for things to end up.
>
> That's not my observation.  Like I said, it appears to oscillate.

rustfmt is a requirement for merging patches, so that's really all there
is to say on the topic.