linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/amd_nb: Rename amd_get_node_id
@ 2015-10-13 13:19 Aravind Gopalakrishnan
  2015-10-14 13:42 ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Aravind Gopalakrishnan @ 2015-10-13 13:19 UTC (permalink / raw)
  To: tglx, mingo, hpa, dougthompson, bp; +Cc: x86, linux-kernel, linux-edac

This function doesn't give us the "Node ID" as the function
name suggests. Rather- it receives a PCI device as argument,
checks the available F3 PCI device IDs in the system
and returns the index of the matching Bus/Device IDs

Renaming it accordingly in this patch.
No functional change is introduced.

Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
---
 arch/x86/include/asm/amd_nb.h | 2 +-
 drivers/edac/amd64_edac.c     | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd_nb.h
index 1a5da2e..319843d 100644
--- a/arch/x86/include/asm/amd_nb.h
+++ b/arch/x86/include/asm/amd_nb.h
@@ -81,7 +81,7 @@ static inline struct amd_northbridge *node_to_amd_nb(int node)
 	return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] : NULL;
 }
 
-static inline u16 amd_get_node_id(struct pci_dev *pdev)
+static inline u16 amd_get_node_id_from_pci_dev(struct pci_dev *pdev)
 {
 	struct pci_dev *misc;
 	int i;
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 73aea40..896cf1f 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -2770,7 +2770,7 @@ static int init_one_instance(struct pci_dev *F2)
 	struct mem_ctl_info *mci = NULL;
 	struct edac_mc_layer layers[2];
 	int err = 0, ret;
-	u16 nid = amd_get_node_id(F2);
+	u16 nid = amd_get_node_id_from_pci_dev(F2);
 
 	ret = -ENOMEM;
 	pvt = kzalloc(sizeof(struct amd64_pvt), GFP_KERNEL);
@@ -2860,7 +2860,7 @@ err_ret:
 static int probe_one_instance(struct pci_dev *pdev,
 			      const struct pci_device_id *mc_type)
 {
-	u16 nid = amd_get_node_id(pdev);
+	u16 nid = amd_get_node_id_from_pci_dev(pdev);
 	struct pci_dev *F3 = node_to_amd_nb(nid)->misc;
 	struct ecc_settings *s;
 	int ret = 0;
@@ -2910,7 +2910,7 @@ static void remove_one_instance(struct pci_dev *pdev)
 {
 	struct mem_ctl_info *mci;
 	struct amd64_pvt *pvt;
-	u16 nid = amd_get_node_id(pdev);
+	u16 nid = amd_get_node_id_from_pci_dev(pdev);
 	struct pci_dev *F3 = node_to_amd_nb(nid)->misc;
 	struct ecc_settings *s = ecc_stngs[nid];
 
-- 
2.5.0


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

* Re: [PATCH] x86/amd_nb: Rename amd_get_node_id
  2015-10-13 13:19 [PATCH] x86/amd_nb: Rename amd_get_node_id Aravind Gopalakrishnan
@ 2015-10-14 13:42 ` Ingo Molnar
  2015-10-14 13:51   ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2015-10-14 13:42 UTC (permalink / raw)
  To: Aravind Gopalakrishnan
  Cc: tglx, mingo, hpa, dougthompson, bp, x86, linux-kernel, linux-edac


* Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com> wrote:

> This function doesn't give us the "Node ID" as the function
> name suggests. Rather- it receives a PCI device as argument,
> checks the available F3 PCI device IDs in the system
> and returns the index of the matching Bus/Device IDs
> 
> Renaming it accordingly in this patch.
> No functional change is introduced.
> 
> Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
> ---
>  arch/x86/include/asm/amd_nb.h | 2 +-
>  drivers/edac/amd64_edac.c     | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd_nb.h
> index 1a5da2e..319843d 100644
> --- a/arch/x86/include/asm/amd_nb.h
> +++ b/arch/x86/include/asm/amd_nb.h
> @@ -81,7 +81,7 @@ static inline struct amd_northbridge *node_to_amd_nb(int node)
>  	return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] : NULL;
>  }
>  
> -static inline u16 amd_get_node_id(struct pci_dev *pdev)
> +static inline u16 amd_get_node_id_from_pci_dev(struct pci_dev *pdev)

So if we go to the trouble of naming things properly, I guess that function should 
be named:

	amd_pci_dev_to_node_id()

or so.

Thanks,

	Ingo

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

* Re: [PATCH] x86/amd_nb: Rename amd_get_node_id
  2015-10-14 13:42 ` Ingo Molnar
@ 2015-10-14 13:51   ` Borislav Petkov
  2015-10-14 14:48     ` Aravind Gopalakrishnan
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2015-10-14 13:51 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Aravind Gopalakrishnan, tglx, mingo, hpa, dougthompson, x86,
	linux-kernel, linux-edac

On Wed, Oct 14, 2015 at 03:42:49PM +0200, Ingo Molnar wrote:
> 
> * Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com> wrote:
> 
> > This function doesn't give us the "Node ID" as the function
> > name suggests. Rather- it receives a PCI device as argument,
> > checks the available F3 PCI device IDs in the system
> > and returns the index of the matching Bus/Device IDs
> > 
> > Renaming it accordingly in this patch.
> > No functional change is introduced.
> > 
> > Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
> > ---
> >  arch/x86/include/asm/amd_nb.h | 2 +-
> >  drivers/edac/amd64_edac.c     | 6 +++---
> >  2 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd_nb.h
> > index 1a5da2e..319843d 100644
> > --- a/arch/x86/include/asm/amd_nb.h
> > +++ b/arch/x86/include/asm/amd_nb.h
> > @@ -81,7 +81,7 @@ static inline struct amd_northbridge *node_to_amd_nb(int node)
> >  	return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] : NULL;
> >  }
> >  
> > -static inline u16 amd_get_node_id(struct pci_dev *pdev)
> > +static inline u16 amd_get_node_id_from_pci_dev(struct pci_dev *pdev)
> 
> So if we go to the trouble of naming things properly, I guess that function should 
> be named:
> 
> 	amd_pci_dev_to_node_id()
> 
> or so.

Or so.

This is in preparation for future changes anyway so the name had to
be not so generic and hint at the PCI dev argument. I'll change it to
amd_pci_dev_to_node_id() when applying.

Thanks.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

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

* Re: [PATCH] x86/amd_nb: Rename amd_get_node_id
  2015-10-14 13:51   ` Borislav Petkov
@ 2015-10-14 14:48     ` Aravind Gopalakrishnan
  0 siblings, 0 replies; 4+ messages in thread
From: Aravind Gopalakrishnan @ 2015-10-14 14:48 UTC (permalink / raw)
  To: Borislav Petkov, Ingo Molnar
  Cc: tglx, mingo, hpa, dougthompson, x86, linux-kernel, linux-edac

On 10/14/2015 8:51 AM, Borislav Petkov wrote:
>
>
>
> This is in preparation for future changes anyway so the name had to
> be not so generic and hint at the PCI dev argument. I'll change it to
> amd_pci_dev_to_node_id() when applying.
>
>

Thanks Boris.

-Aravind.

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

end of thread, other threads:[~2015-10-14 14:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-13 13:19 [PATCH] x86/amd_nb: Rename amd_get_node_id Aravind Gopalakrishnan
2015-10-14 13:42 ` Ingo Molnar
2015-10-14 13:51   ` Borislav Petkov
2015-10-14 14:48     ` Aravind Gopalakrishnan

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).