All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: pmenzel@molgen.mpg.de, netdev@vger.kernel.org,
	Paul Cercueil <paul@crapouillou.net>,
	Eric Dumazet <edumazet@google.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Alan Brady <alan.brady@intel.com>,
	horms@kernel.org, Jakub Kicinski <kuba@kernel.org>,
	intel-wired-lan@lists.osuosl.org, Paolo Abeni <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next v2 1/2] igb: simplify pci ops declaration
Date: Wed, 6 Mar 2024 17:14:10 -0600	[thread overview]
Message-ID: <20240306231410.GA589078@bhelgaas> (raw)
In-Reply-To: <20240306025023.800029-2-jesse.brandeburg@intel.com>

[+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
> 

WARNING: multiple messages have this Message-ID (diff)
From: Bjorn Helgaas <helgaas@kernel.org>
To: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	horms@kernel.org, pmenzel@molgen.mpg.de,
	Alan Brady <alan.brady@intel.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Paul Cercueil <paul@crapouillou.net>
Subject: Re: [PATCH iwl-next v2 1/2] igb: simplify pci ops declaration
Date: Wed, 6 Mar 2024 17:14:10 -0600	[thread overview]
Message-ID: <20240306231410.GA589078@bhelgaas> (raw)
In-Reply-To: <20240306025023.800029-2-jesse.brandeburg@intel.com>

[+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
> 

  parent reply	other threads:[~2024-03-06 23:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06  2:50 [Intel-wired-lan] [PATCH iwl-next v2 0/2] net: intel: cleanup power ops Jesse Brandeburg
2024-03-06  2:50 ` Jesse Brandeburg
2024-03-06  2:50 ` [Intel-wired-lan] [PATCH iwl-next v2 1/2] igb: simplify pci ops declaration Jesse Brandeburg
2024-03-06  2:50   ` Jesse Brandeburg
2024-03-06  6:24   ` [Intel-wired-lan] " Paul Menzel
2024-03-06  6:24     ` Paul Menzel
2024-03-06  6:46     ` [Intel-wired-lan] " Heiner Kallweit
2024-03-06  6:46       ` Heiner Kallweit
2024-03-06  7:36       ` [Intel-wired-lan] " Paul Menzel
2024-03-06  7:36         ` Paul Menzel
2024-03-06 14:24   ` [Intel-wired-lan] " Maciej Fijalkowski
2024-03-06 14:24     ` Maciej Fijalkowski
2024-03-06 23:14   ` Bjorn Helgaas [this message]
2024-03-06 23:14     ` Bjorn Helgaas
2024-03-06 23:15     ` [Intel-wired-lan] " Bjorn Helgaas
2024-03-06 23:15       ` Bjorn Helgaas
2024-03-13  3:53   ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2024-03-13  3:53     ` Pucha, HimasekharX Reddy
2024-03-06  2:50 ` [Intel-wired-lan] [PATCH iwl-next v2 2/2] net: intel: implement modern PM ops declarations Jesse Brandeburg
2024-03-06  2:50   ` Jesse Brandeburg
2024-03-06 14:26   ` [Intel-wired-lan] " Maciej Fijalkowski
2024-03-06 14:26     ` Maciej Fijalkowski
2024-03-13  3:55   ` [Intel-wired-lan] " Pucha, HimasekharX Reddy
2024-03-13  3:55     ` Pucha, HimasekharX Reddy

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=20240306231410.GA589078@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=alan.brady@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=paul@crapouillou.net \
    --cc=pmenzel@molgen.mpg.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.