[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240306231410.GA589078@bhelgaas>
Date: Wed, 6 Mar 2024 17:14:10 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: Jesse Brandeburg <jesse.brandeburg@...el.com>
Cc: intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
horms@...nel.org, pmenzel@...gen.mpg.de,
Alan Brady <alan.brady@...el.com>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Paul Cercueil <paul@...pouillou.net>
Subject: Re: [PATCH iwl-next v2 1/2] igb: simplify pci ops declaration
[+cc Paul for __maybe_unused cleanup]
On Tue, Mar 05, 2024 at 06:50:21PM -0800, Jesse Brandeburg wrote:
> The igb driver was pre-declaring tons of functions just so that it could
> have an early declaration of the pci_driver struct.
>
> Delete a bunch of the declarations and move the struct to the bottom of the
> file, after all the functions are declared.
Nice fix, that was always annoying.
Seems like there's an opportunity to drop some of the __maybe_unused
annotations:
static int __maybe_unused igb_suspend(struct device *dev)
after 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones").
I don't know if SET_RUNTIME_PM_OPS() makes __maybe_unused unnecessary
or not.
> +#ifdef CONFIG_PM
> +static const struct dev_pm_ops igb_pm_ops = {
> + SET_SYSTEM_SLEEP_PM_OPS(igb_suspend, igb_resume)
> + SET_RUNTIME_PM_OPS(igb_runtime_suspend, igb_runtime_resume,
> + igb_runtime_idle)
> +};
> +#endif
> +
> +static struct pci_driver igb_driver = {
> + .name = igb_driver_name,
> + .id_table = igb_pci_tbl,
> + .probe = igb_probe,
> + .remove = igb_remove,
> +#ifdef CONFIG_PM
> + .driver.pm = &igb_pm_ops,
> +#endif
> + .shutdown = igb_shutdown,
> + .sriov_configure = igb_pci_sriov_configure,
> + .err_handler = &igb_err_handler
> +};
> +
> /* igb_main.c */
> --
> 2.39.3
>
Powered by blists - more mailing lists