linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: Remove functions not called in include/linux/pci.h
@ 2019-07-15 17:56 Kelsey
  2019-07-15 18:13 ` [PATCH v2] " Kelsey Skunberg
  0 siblings, 1 reply; 9+ messages in thread
From: Kelsey @ 2019-07-15 17:56 UTC (permalink / raw)
  To: bhelgaas, linux-pci, linux-kernel
  Cc: skhan, linux-kernel-mentees, skunberg.kelsey

Remove the following uncalled functions from include/linux/pci.h:

	pci_block_cfg_access()
	pci_block_cfg_access_in_atomic()
	pci_unblock_cfg_access()

Functions were added in patch fb51ccbf217c "PCI: Rework config space
blocking services", though no callers were added. Code continues to be
unused and should be removed.

Signed-off-by: Kelsey <skunberg.kelsey@gmail.com>
---
 include/linux/pci.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index cf380544c700..3c9ba6133bea 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1656,11 +1656,6 @@ static inline void pci_release_regions(struct pci_dev *dev) { }
 
 static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
 
-static inline void pci_block_cfg_access(struct pci_dev *dev) { }
-static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)
-{ return 0; }
-static inline void pci_unblock_cfg_access(struct pci_dev *dev) { }
-
 static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
 { return NULL; }
 static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
-- 
2.20.1


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

* [PATCH v2] PCI: Remove functions not called in include/linux/pci.h
  2019-07-15 17:56 [PATCH] PCI: Remove functions not called in include/linux/pci.h Kelsey
@ 2019-07-15 18:13 ` Kelsey Skunberg
  2019-07-15 19:42   ` [Linux-kernel-mentees] " Lukas Bulwahn
  2019-07-15 20:34   ` [PATCH v3] " Kelsey Skunberg
  0 siblings, 2 replies; 9+ messages in thread
From: Kelsey Skunberg @ 2019-07-15 18:13 UTC (permalink / raw)
  To: bhelgaas, linux-pci, linux-kernel
  Cc: skhan, linux-kernel-mentees, skunberg.kelsey

Remove the following uncalled functions from include/linux/pci.h:

        pci_block_cfg_access()
        pci_block_cfg_access_in_atomic()
        pci_unblock_cfg_access()

Functions were added in patch fb51ccbf217c "PCI: Rework config space
blocking services", though no callers were added. Code continues to be
unused and should be removed.

Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>
---

Changes since v1:
  - Fixed Signed-off-by line to show full name

 include/linux/pci.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index cf380544c700..3c9ba6133bea 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1656,11 +1656,6 @@ static inline void pci_release_regions(struct pci_dev *dev) { }
 
 static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
 
-static inline void pci_block_cfg_access(struct pci_dev *dev) { }
-static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)
-{ return 0; }
-static inline void pci_unblock_cfg_access(struct pci_dev *dev) { }
-
 static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
 { return NULL; }
 static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
-- 
2.20.1


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

* Re: [Linux-kernel-mentees] [PATCH v2] PCI: Remove functions not called in include/linux/pci.h
  2019-07-15 18:13 ` [PATCH v2] " Kelsey Skunberg
@ 2019-07-15 19:42   ` Lukas Bulwahn
  2019-07-15 20:19     ` Kelsey Skunberg
  2019-07-15 23:37     ` Bjorn Helgaas
  2019-07-15 20:34   ` [PATCH v3] " Kelsey Skunberg
  1 sibling, 2 replies; 9+ messages in thread
From: Lukas Bulwahn @ 2019-07-15 19:42 UTC (permalink / raw)
  To: Kelsey Skunberg; +Cc: bhelgaas, linux-pci, linux-kernel, linux-kernel-mentees



On Mon, 15 Jul 2019, Kelsey Skunberg wrote:

> Remove the following uncalled functions from include/linux/pci.h:
> 
>         pci_block_cfg_access()
>         pci_block_cfg_access_in_atomic()
>         pci_unblock_cfg_access()
> 
> Functions were added in patch fb51ccbf217c "PCI: Rework config space
> blocking services", though no callers were added. Code continues to be
> unused and should be removed.
> 
> Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>
> ---
> 

Nice finding. How did you discover this issue? Did you use a tool to find 
this ununsed code or stumble over it during your code review?

Also note that commits are referred to with this format:

commit <12-character sha prefix> ("<commit message>")

So, you need to change patch to commit and include brackets around your
quoted commit message.

Lukas

> Changes since v1:
>   - Fixed Signed-off-by line to show full name
> 
>  include/linux/pci.h | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index cf380544c700..3c9ba6133bea 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1656,11 +1656,6 @@ static inline void pci_release_regions(struct pci_dev *dev) { }
>  
>  static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
>  
> -static inline void pci_block_cfg_access(struct pci_dev *dev) { }
> -static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)
> -{ return 0; }
> -static inline void pci_unblock_cfg_access(struct pci_dev *dev) { }
> -
>  static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
>  { return NULL; }
>  static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
> -- 
> 2.20.1
> 
> _______________________________________________
> Linux-kernel-mentees mailing list
> Linux-kernel-mentees@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
> 

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

* Re: [Linux-kernel-mentees] [PATCH v2] PCI: Remove functions not called in include/linux/pci.h
  2019-07-15 19:42   ` [Linux-kernel-mentees] " Lukas Bulwahn
@ 2019-07-15 20:19     ` Kelsey Skunberg
  2019-07-15 23:37     ` Bjorn Helgaas
  1 sibling, 0 replies; 9+ messages in thread
From: Kelsey Skunberg @ 2019-07-15 20:19 UTC (permalink / raw)
  To: Lukas Bulwahn; +Cc: bhelgaas, linux-pci, linux-kernel, linux-kernel-mentees

On Mon, Jul 15, 2019 at 09:42:47PM +0200, Lukas Bulwahn wrote:
> 
> 
> On Mon, 15 Jul 2019, Kelsey Skunberg wrote:
> 
> > Remove the following uncalled functions from include/linux/pci.h:
> > 
> >         pci_block_cfg_access()
> >         pci_block_cfg_access_in_atomic()
> >         pci_unblock_cfg_access()
> > 
> > Functions were added in patch fb51ccbf217c "PCI: Rework config space
> > blocking services", though no callers were added. Code continues to be
> > unused and should be removed.
> > 
> > Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>
> > ---
> > 
> 
> Nice finding. How did you discover this issue? Did you use a tool to find 
> this ununsed code or stumble over it during your code review?
>
Stumbled upon it while reviewing include/linux/pci.h to see what
could be moved to drivers/pci/pci.h.
 
> Also note that commits are referred to with this format:
> 
> commit <12-character sha prefix> ("<commit message>")
>
> So, you need to change patch to commit and include brackets around your
> quoted commit message.
> 
> Lukas

Thank you for letting me know and reviewing! I will update this now.

-Kelsey

> 
> > Changes since v1:
> >   - Fixed Signed-off-by line to show full name
> > 
> >  include/linux/pci.h | 5 -----
> >  1 file changed, 5 deletions(-)
> > 
> > diff --git a/include/linux/pci.h b/include/linux/pci.h
> > index cf380544c700..3c9ba6133bea 100644
> > --- a/include/linux/pci.h
> > +++ b/include/linux/pci.h
> > @@ -1656,11 +1656,6 @@ static inline void pci_release_regions(struct pci_dev *dev) { }
> >  
> >  static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
> >  
> > -static inline void pci_block_cfg_access(struct pci_dev *dev) { }
> > -static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)
> > -{ return 0; }
> > -static inline void pci_unblock_cfg_access(struct pci_dev *dev) { }
> > -
> >  static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
> >  { return NULL; }
> >  static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
> > -- 
> > 2.20.1
> > 
> > _______________________________________________
> > Linux-kernel-mentees mailing list
> > Linux-kernel-mentees@lists.linuxfoundation.org
> > https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
> > 

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

* [PATCH v3] PCI: Remove functions not called in include/linux/pci.h
  2019-07-15 18:13 ` [PATCH v2] " Kelsey Skunberg
  2019-07-15 19:42   ` [Linux-kernel-mentees] " Lukas Bulwahn
@ 2019-07-15 20:34   ` Kelsey Skunberg
  2019-07-16  4:58     ` [Linux-kernel-mentees] " Lukas Bulwahn
  2019-07-23 23:34     ` Bjorn Helgaas
  1 sibling, 2 replies; 9+ messages in thread
From: Kelsey Skunberg @ 2019-07-15 20:34 UTC (permalink / raw)
  To: linux-pci, bhelgaas, linux-kernel
  Cc: skhan, linux-kernel-mentees, skunberg.kelsey

Remove the following uncalled functions from include/linux/pci.h:

        pci_block_cfg_access()
        pci_block_cfg_access_in_atomic()
        pci_unblock_cfg_access()

Functions were added in commit fb51ccbf217c ("PCI: Rework config space
blocking services"), though no callers were added. Code continues to be
unused and should be removed.

Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>
---

Changes since v1:
  - Fixed Signed-off-by line to show full name

Changes since v2:
  - Change commit message to reference prior commit properly with the
    following format:
	commit <12-character sha prefix> ("<commit message>")

 include/linux/pci.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index cf380544c700..3c9ba6133bea 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1656,11 +1656,6 @@ static inline void pci_release_regions(struct pci_dev *dev) { }
 
 static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
 
-static inline void pci_block_cfg_access(struct pci_dev *dev) { }
-static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)
-{ return 0; }
-static inline void pci_unblock_cfg_access(struct pci_dev *dev) { }
-
 static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
 { return NULL; }
 static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
-- 
2.20.1


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

* Re: [Linux-kernel-mentees] [PATCH v2] PCI: Remove functions not called in include/linux/pci.h
  2019-07-15 19:42   ` [Linux-kernel-mentees] " Lukas Bulwahn
  2019-07-15 20:19     ` Kelsey Skunberg
@ 2019-07-15 23:37     ` Bjorn Helgaas
  2019-07-16  3:57       ` Kelsey Skunberg
  1 sibling, 1 reply; 9+ messages in thread
From: Bjorn Helgaas @ 2019-07-15 23:37 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: Kelsey Skunberg, linux-pci, linux-kernel-mentees, linux-kernel

On Mon, Jul 15, 2019 at 09:42:47PM +0200, Lukas Bulwahn wrote:
> On Mon, 15 Jul 2019, Kelsey Skunberg wrote:
> 
> > Remove the following uncalled functions from include/linux/pci.h:
> > 
> >         pci_block_cfg_access()
> >         pci_block_cfg_access_in_atomic()
> >         pci_unblock_cfg_access()
> > 
> > Functions were added in patch fb51ccbf217c "PCI: Rework config space
> > blocking services", ...

> Also note that commits are referred to with this format:
> 
> commit <12-character sha prefix> ("<commit message>")

FWIW, I use this shell alias to generate these references:

  gsr is aliased to `git --no-pager show -s --abbrev-commit --abbrev=12 --pretty=format:"%h (\"%s\")%n"'

  $ gsr fb51ccb
  fb51ccbf217c ("PCI: Rework config space blocking services")

Documentation/process/submitting-patches.rst mentions a 12-char (at
least) SHA-1 but the e21d2170f36 example shows a *20*-char SHA-1,
which seems excessive to me.

I personally skip the word "commit" because I figure it's pretty
obvious what it is, but it's fine either way.

Bjorn

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

* Re: [Linux-kernel-mentees] [PATCH v2] PCI: Remove functions not called in include/linux/pci.h
  2019-07-15 23:37     ` Bjorn Helgaas
@ 2019-07-16  3:57       ` Kelsey Skunberg
  0 siblings, 0 replies; 9+ messages in thread
From: Kelsey Skunberg @ 2019-07-16  3:57 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Lukas Bulwahn, linux-pci, linux-kernel-mentees, linux-kernel

On Mon, Jul 15, 2019 at 06:37:17PM -0500, Bjorn Helgaas wrote:
> On Mon, Jul 15, 2019 at 09:42:47PM +0200, Lukas Bulwahn wrote:
> > On Mon, 15 Jul 2019, Kelsey Skunberg wrote:
> > 
> > > Remove the following uncalled functions from include/linux/pci.h:
> > > 
> > >         pci_block_cfg_access()
> > >         pci_block_cfg_access_in_atomic()
> > >         pci_unblock_cfg_access()
> > > 
> > > Functions were added in patch fb51ccbf217c "PCI: Rework config space
> > > blocking services", ...
> 
> > Also note that commits are referred to with this format:
> > 
> > commit <12-character sha prefix> ("<commit message>")
> 
> FWIW, I use this shell alias to generate these references:
> 
>   gsr is aliased to `git --no-pager show -s --abbrev-commit --abbrev=12 --pretty=format:"%h (\"%s\")%n"'
> 
>   $ gsr fb51ccb
>   fb51ccbf217c ("PCI: Rework config space blocking services")
> 
> Documentation/process/submitting-patches.rst mentions a 12-char (at
> least) SHA-1 but the e21d2170f36 example shows a *20*-char SHA-1,
> which seems excessive to me.
> 
> I personally skip the word "commit" because I figure it's pretty
> obvious what it is, but it's fine either way.
> 
> Bjorn

This is very useful! I definitely like the use of the alias. Thank you!

-Kelsey

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

* Re: [Linux-kernel-mentees] [PATCH v3] PCI: Remove functions not called in include/linux/pci.h
  2019-07-15 20:34   ` [PATCH v3] " Kelsey Skunberg
@ 2019-07-16  4:58     ` Lukas Bulwahn
  2019-07-23 23:34     ` Bjorn Helgaas
  1 sibling, 0 replies; 9+ messages in thread
From: Lukas Bulwahn @ 2019-07-16  4:58 UTC (permalink / raw)
  To: Kelsey Skunberg; +Cc: linux-pci, bhelgaas, linux-kernel, linux-kernel-mentees



On Mon, 15 Jul 2019, Kelsey Skunberg wrote:

> Remove the following uncalled functions from include/linux/pci.h:
> 
>         pci_block_cfg_access()
>         pci_block_cfg_access_in_atomic()
>         pci_unblock_cfg_access()
> 
> Functions were added in commit fb51ccbf217c ("PCI: Rework config space
> blocking services"), though no callers were added. Code continues to be
> unused and should be removed.
> 
> Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>
> ---
> 
> Changes since v1:
>   - Fixed Signed-off-by line to show full name
> 
> Changes since v2:
>   - Change commit message to reference prior commit properly with the
>     following format:
> 	commit <12-character sha prefix> ("<commit message>")
> 
>  include/linux/pci.h | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index cf380544c700..3c9ba6133bea 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1656,11 +1656,6 @@ static inline void pci_release_regions(struct pci_dev *dev) { }
>  
>  static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
>  
> -static inline void pci_block_cfg_access(struct pci_dev *dev) { }
> -static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)
> -{ return 0; }
> -static inline void pci_unblock_cfg_access(struct pci_dev *dev) { }
> -
>  static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
>  { return NULL; }
>  static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
> -- 
> 2.20.1

I just checked with elixir on v5.2 that all three identifiers are never 
referenced beyond its definition in pci.h:

https://elixir.bootlin.com/linux/v5.2/ident/pci_block_cfg_access
https://elixir.bootlin.com/linux/v5.2/ident/pci_block_cfg_access_in_atomic
https://elixir.bootlin.com/linux/v5.2/ident/pci_unblock_cfg_access

So, what it is worth:

Reviewed-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>

Lukas

> 
> _______________________________________________
> Linux-kernel-mentees mailing list
> Linux-kernel-mentees@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
> 

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

* Re: [Linux-kernel-mentees] [PATCH v3] PCI: Remove functions not called in include/linux/pci.h
  2019-07-15 20:34   ` [PATCH v3] " Kelsey Skunberg
  2019-07-16  4:58     ` [Linux-kernel-mentees] " Lukas Bulwahn
@ 2019-07-23 23:34     ` Bjorn Helgaas
  1 sibling, 0 replies; 9+ messages in thread
From: Bjorn Helgaas @ 2019-07-23 23:34 UTC (permalink / raw)
  To: Kelsey Skunberg; +Cc: linux-pci, linux-kernel, linux-kernel-mentees

On Mon, Jul 15, 2019 at 02:34:16PM -0600, Kelsey Skunberg wrote:
> Remove the following uncalled functions from include/linux/pci.h:
> 
>         pci_block_cfg_access()
>         pci_block_cfg_access_in_atomic()
>         pci_unblock_cfg_access()
> 
> Functions were added in commit fb51ccbf217c ("PCI: Rework config space
> blocking services"), though no callers were added. Code continues to be
> unused and should be removed.
> 
> Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>

Applied with Lukas' reviewed-by (thank you!) to pci/hide for v5.4,
thanks!

> ---
> 
> Changes since v1:
>   - Fixed Signed-off-by line to show full name
> 
> Changes since v2:
>   - Change commit message to reference prior commit properly with the
>     following format:
> 	commit <12-character sha prefix> ("<commit message>")
> 
>  include/linux/pci.h | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index cf380544c700..3c9ba6133bea 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1656,11 +1656,6 @@ static inline void pci_release_regions(struct pci_dev *dev) { }
>  
>  static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
>  
> -static inline void pci_block_cfg_access(struct pci_dev *dev) { }
> -static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)
> -{ return 0; }
> -static inline void pci_unblock_cfg_access(struct pci_dev *dev) { }
> -
>  static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
>  { return NULL; }
>  static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
> -- 
> 2.20.1
> 
> _______________________________________________
> Linux-kernel-mentees mailing list
> Linux-kernel-mentees@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

end of thread, other threads:[~2019-07-23 23:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 17:56 [PATCH] PCI: Remove functions not called in include/linux/pci.h Kelsey
2019-07-15 18:13 ` [PATCH v2] " Kelsey Skunberg
2019-07-15 19:42   ` [Linux-kernel-mentees] " Lukas Bulwahn
2019-07-15 20:19     ` Kelsey Skunberg
2019-07-15 23:37     ` Bjorn Helgaas
2019-07-16  3:57       ` Kelsey Skunberg
2019-07-15 20:34   ` [PATCH v3] " Kelsey Skunberg
2019-07-16  4:58     ` [Linux-kernel-mentees] " Lukas Bulwahn
2019-07-23 23:34     ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).