public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH] PCI: remove already resolved TODO
@ 2024-12-12 11:02 guilherme giacomo simoes
  2024-12-12 16:36 ` Bjorn Helgaas
  0 siblings, 1 reply; 5+ messages in thread
From: guilherme giacomo simoes @ 2024-12-12 11:02 UTC (permalink / raw)
  To: scott, bhelgaas, namcao, trintaeoitogc, ngn; +Cc: linux-pci, linux-kernel

The get_power and set_power fields is used, and only hardware_test is
really not used. So, after commit
5b036cada481a7a3bf30d333298f6d83dfb19bed ("PCI: cpcihp: Remove unused
struct cpci_hp_controller_ops.hardware_test") this TODO is completed.

Signed-off-by: guilherme giacomo simoes <trintaeoitogc@gmail.com>
---
 drivers/pci/hotplug/TODO | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/pci/hotplug/TODO b/drivers/pci/hotplug/TODO
index 92e6e20e8595..7397374af171 100644
--- a/drivers/pci/hotplug/TODO
+++ b/drivers/pci/hotplug/TODO
@@ -2,10 +2,6 @@ Contributions are solicited in particular to remedy the following issues:
 
 cpcihp:
 
-* There are no implementations of the ->hardware_test, ->get_power and
-  ->set_power callbacks in struct cpci_hp_controller_ops.  Why were they
-  introduced?  Can they be removed from the struct?
-
 * Returned code from pci_hp_add_bridge() is not checked.
 
 cpqphp:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RESEND PATCH] PCI: remove already resolved TODO
  2024-12-12 11:02 [RESEND PATCH] PCI: remove already resolved TODO guilherme giacomo simoes
@ 2024-12-12 16:36 ` Bjorn Helgaas
  2024-12-13 15:17   ` Guilherme Giacomo Simoes
  0 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2024-12-12 16:36 UTC (permalink / raw)
  To: guilherme giacomo simoes
  Cc: scott, bhelgaas, namcao, ngn, linux-pci, linux-kernel

On Thu, Dec 12, 2024 at 08:02:33AM -0300, guilherme giacomo simoes wrote:
> The get_power and set_power fields is used, and only hardware_test is
> really not used. So, after commit
> 5b036cada481a7a3bf30d333298f6d83dfb19bed ("PCI: cpcihp: Remove unused
> struct cpci_hp_controller_ops.hardware_test") this TODO is completed.

The entire 40-char SHA-1 is overkill; use 12:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/5.Posting.rst?id=v6.12#n204

I see a test and call for .get_power() and .set_power(), but no actual
implementations, so I think they can be removed as well, can't they?
If so, I'll wait for that removal before applying this patch.

> Signed-off-by: guilherme giacomo simoes <trintaeoitogc@gmail.com>

In
https://lore.kernel.org/r/20241014131917.324667-1-trintaeoitogc@gmail.com,
you capitalized your names.  What's your preference?  I'd like to use
your name correctly and consistently.

> ---
>  drivers/pci/hotplug/TODO | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/pci/hotplug/TODO b/drivers/pci/hotplug/TODO
> index 92e6e20e8595..7397374af171 100644
> --- a/drivers/pci/hotplug/TODO
> +++ b/drivers/pci/hotplug/TODO
> @@ -2,10 +2,6 @@ Contributions are solicited in particular to remedy the following issues:
>  
>  cpcihp:
>  
> -* There are no implementations of the ->hardware_test, ->get_power and
> -  ->set_power callbacks in struct cpci_hp_controller_ops.  Why were they
> -  introduced?  Can they be removed from the struct?
> -
>  * Returned code from pci_hp_add_bridge() is not checked.
>  
>  cpqphp:
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RESEND PATCH] PCI: remove already resolved TODO
  2024-12-12 16:36 ` Bjorn Helgaas
@ 2024-12-13 15:17   ` Guilherme Giacomo Simoes
  2024-12-13 16:56     ` Bjorn Helgaas
  0 siblings, 1 reply; 5+ messages in thread
From: Guilherme Giacomo Simoes @ 2024-12-13 15:17 UTC (permalink / raw)
  To: helgaas
  Cc: bhelgaas, linux-kernel, linux-pci, namcao, ngn, scott,
	trintaeoitogc

Bjorn Helgaas <helgaas@kernel.org> wrote:
> I see a test and call for .get_power() and .set_power(), but no actual
> implementations, so I think they can be removed as well, can't they?
> If so, I'll wait for that removal before applying this patch.
You are right. Both only have a check if exist the {g|s}et_power(), then this
is called.
But, as you already said, seems that really don't have a implementations for
both. So, I can work on remove this fields an tests this.  

In the cpci_hotplug.h we can crate a `flags` field in `cpci_hp_controller_ops`
struct, in addition of remove the {g|s}et_power(). In the cpci_hotplug_core.c
that the cpci_hp_controller_ops struct is in use, maybe we can create a #define
SLOT_ENABLED 0x00000001, and we can do `ops->flags |= ENABLED_SLOT` when we
need enable the slot in the enable_slot() function and `ops->flags &=
~ENABLE_SLOT` in the disable_slot() function. In the get_power() function we
only need return `ops->flags & SLOT_ENABLED`.
what do you think?

> In
> https://lore.kernel.org/r/20241014131917.324667-1-trintaeoitogc@gmail.com,
> you capitalized your names.  What's your preference?  I'd like to use
> your name correctly and consistently.
I make mistake, sorry for this. In the next commit I will send with my name
capitalized. 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RESEND PATCH] PCI: remove already resolved TODO
  2024-12-13 15:17   ` Guilherme Giacomo Simoes
@ 2024-12-13 16:56     ` Bjorn Helgaas
  2024-12-13 18:06       ` Guilherme Giacomo Simoes
  0 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2024-12-13 16:56 UTC (permalink / raw)
  To: Guilherme Giacomo Simoes
  Cc: bhelgaas, linux-kernel, linux-pci, namcao, ngn, scott

On Fri, Dec 13, 2024 at 12:17:10PM -0300, Guilherme Giacomo Simoes wrote:
> Bjorn Helgaas <helgaas@kernel.org> wrote:
> > I see a test and call for .get_power() and .set_power(), but no actual
> > implementations, so I think they can be removed as well, can't they?
> > If so, I'll wait for that removal before applying this patch.
>
> You are right. Both only have a check if exist the {g|s}et_power(),
> then this is called.
>
> But, as you already said, seems that really don't have a
> implementations for both. So, I can work on remove this fields an
> tests this.  
> 
> In the cpci_hotplug.h we can create a `flags` field in
> `cpci_hp_controller_ops` struct, in addition of remove the
> {g|s}et_power(). In the cpci_hotplug_core.c that the
> cpci_hp_controller_ops struct is in use, maybe we can create a
> #define SLOT_ENABLED 0x00000001, and we can do `ops->flags |=
> ENABLED_SLOT` when we need enable the slot in the enable_slot()
> function and `ops->flags &= ~ENABLE_SLOT` in the disable_slot()
> function. In the get_power() function we only need return
> `ops->flags & SLOT_ENABLED`.  what do you think?

I don't quite see what you have in mind; a patch would make it clear.

But the cpci hotplug driver is basically dead.  I don't think it's
worth doing anything more than the most trivial cleanups to it.

Bjorn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [RESEND PATCH] PCI: remove already resolved TODO
  2024-12-13 16:56     ` Bjorn Helgaas
@ 2024-12-13 18:06       ` Guilherme Giacomo Simoes
  0 siblings, 0 replies; 5+ messages in thread
From: Guilherme Giacomo Simoes @ 2024-12-13 18:06 UTC (permalink / raw)
  To: helgaas
  Cc: bhelgaas, linux-kernel, linux-pci, namcao, ngn, scott,
	trintaeoitogc

Bjorn Helgaas <helgaas@kernel.org> wrote:
> I don't quite see what you have in mind; a patch would make it clear.
> 
> But the cpci hotplug driver is basically dead.  I don't think it's
> worth doing anything more than the most trivial cleanups to it.
I will make a little change, test a lot and I send a patch for this. And you
can see that this patch is good for kernel or no.

Thanks,
Guilherme

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-12-13 18:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-12 11:02 [RESEND PATCH] PCI: remove already resolved TODO guilherme giacomo simoes
2024-12-12 16:36 ` Bjorn Helgaas
2024-12-13 15:17   ` Guilherme Giacomo Simoes
2024-12-13 16:56     ` Bjorn Helgaas
2024-12-13 18:06       ` Guilherme Giacomo Simoes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox