From: Bjorn Helgaas <helgaas@kernel.org>
To: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>
Cc: christophe.jaillet@wanadoo.fr, bhelgaas@google.com,
scott@spiteful.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] PCI: cpci: remove unused fields
Date: Fri, 21 Feb 2025 16:40:48 -0600 [thread overview]
Message-ID: <20250221224048.GA369678@bhelgaas> (raw)
In-Reply-To: <20250217185638.398925-1-trintaeoitogc@gmail.com>
On Mon, Feb 17, 2025 at 03:56:38PM -0300, Guilherme Giacomo Simoes wrote:
> The `get_power()` and `set_power()` function pointers in the
> `cpci_hp_controller ops` struct were declared but never implemented by
> any driver. To improve code readability and reduce resource usage,
> remove this pointers.
>
> Signed-off-by: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>
Applied to pci/hotplug for v6.15, thanks!
> ---
> v2 changes
>
> - Remove uneccessary SLOT_ENABLE constant
> - Remove uneccessary flags fields
> ---
> drivers/pci/hotplug/cpci_hotplug.h | 2 --
> drivers/pci/hotplug/cpci_hotplug_core.c | 17 ++---------------
> 2 files changed, 2 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h
> index 03fa39ab0c88..a31d6b62f523 100644
> --- a/drivers/pci/hotplug/cpci_hotplug.h
> +++ b/drivers/pci/hotplug/cpci_hotplug.h
> @@ -44,8 +44,6 @@ struct cpci_hp_controller_ops {
> int (*enable_irq)(void);
> int (*disable_irq)(void);
> int (*check_irq)(void *dev_id);
> - u8 (*get_power)(struct slot *slot);
> - int (*set_power)(struct slot *slot, int value);
> };
>
> struct cpci_hp_controller {
> diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c
> index d0559d2faf50..dd93e53ea7c2 100644
> --- a/drivers/pci/hotplug/cpci_hotplug_core.c
> +++ b/drivers/pci/hotplug/cpci_hotplug_core.c
> @@ -71,13 +71,10 @@ static int
> enable_slot(struct hotplug_slot *hotplug_slot)
> {
> struct slot *slot = to_slot(hotplug_slot);
> - int retval = 0;
>
> dbg("%s - physical_slot = %s", __func__, slot_name(slot));
>
> - if (controller->ops->set_power)
> - retval = controller->ops->set_power(slot, 1);
> - return retval;
> + return 0;
> }
>
> static int
> @@ -109,12 +106,6 @@ disable_slot(struct hotplug_slot *hotplug_slot)
> }
> cpci_led_on(slot);
>
> - if (controller->ops->set_power) {
> - retval = controller->ops->set_power(slot, 0);
> - if (retval)
> - goto disable_error;
> - }
> -
> slot->adapter_status = 0;
>
> if (slot->extracting) {
> @@ -129,11 +120,7 @@ disable_slot(struct hotplug_slot *hotplug_slot)
> static u8
> cpci_get_power_status(struct slot *slot)
> {
> - u8 power = 1;
> -
> - if (controller->ops->get_power)
> - power = controller->ops->get_power(slot);
> - return power;
> + return 1;
> }
>
> static int
> --
> 2.34.1
>
prev parent reply other threads:[~2025-02-21 22:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-17 18:56 [PATCH V2] PCI: cpci: remove unused fields Guilherme Giacomo Simoes
2025-02-21 22:40 ` Bjorn Helgaas [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=20250221224048.GA369678@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=scott@spiteful.org \
--cc=trintaeoitogc@gmail.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