[Pdbg] [PATCH 02/10] libpdbg: staticify unit structs

Nicholas Piggin npiggin at gmail.com
Thu May 3 16:26:54 AEST 2018


Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 libpdbg/adu.c    | 4 ++--
 libpdbg/bmcfsi.c | 2 +-
 libpdbg/cfam.c   | 8 ++++----
 libpdbg/fake.c   | 4 ++--
 libpdbg/host.c   | 2 +-
 libpdbg/htm.c    | 4 ++--
 libpdbg/i2c.c    | 2 +-
 libpdbg/kernel.c | 2 +-
 libpdbg/p8chip.c | 4 ++--
 libpdbg/p9chip.c | 6 +++---
 10 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/libpdbg/adu.c b/libpdbg/adu.c
index 2a0b8d5..612d70a 100644
--- a/libpdbg/adu.c
+++ b/libpdbg/adu.c
@@ -384,7 +384,7 @@ retry:
 	return 0;
 }
 
-struct adu p8_adu = {
+static struct adu p8_adu = {
 	.target = {
 		.name =	"POWER8 ADU",
 		.compatible = "ibm,power8-adu",
@@ -395,7 +395,7 @@ struct adu p8_adu = {
 };
 DECLARE_HW_UNIT(p8_adu);
 
-struct adu p9_adu = {
+static struct adu p9_adu = {
 	.target = {
 		.name =	"POWER9 ADU",
 		.compatible = "ibm,power9-adu",
diff --git a/libpdbg/bmcfsi.c b/libpdbg/bmcfsi.c
index 62b96c9..8f270df 100644
--- a/libpdbg/bmcfsi.c
+++ b/libpdbg/bmcfsi.c
@@ -491,7 +491,7 @@ int bmcfsi_probe(struct pdbg_target *target)
 	return 0;
 }
 
-struct fsi bmcfsi = {
+static struct fsi bmcfsi = {
 	.target = {
 		.name = "BMC GPIO bit-banging FSI master",
 		.compatible = "ibm,bmcfsi",
diff --git a/libpdbg/cfam.c b/libpdbg/cfam.c
index 1f00b0e..41586d6 100644
--- a/libpdbg/cfam.c
+++ b/libpdbg/cfam.c
@@ -117,7 +117,7 @@ static int fsi2pib_reset(struct pdbg_target *target)
 	return 0;
 }
 
-struct pib fsi_pib = {
+static struct pib fsi_pib = {
 	.target = {
 		.name =	"POWER FSI2PIB",
 		.compatible = "ibm,fsi-pib",
@@ -228,7 +228,7 @@ static int p8_opb_write(struct opb *opb, uint32_t addr, uint32_t data)
 	return opb_poll(opb, NULL);
 }
 
-struct opb p8_opb = {
+static struct opb p8_opb = {
 	.target = {
 		.name = "POWER8 OPB",
 		.compatible = "ibm,power8-opb",
@@ -281,7 +281,7 @@ static int p8_hmfsi_probe(struct pdbg_target *target)
 	return 0;
 }
 
-struct fsi p8_opb_hmfsi = {
+static struct fsi p8_opb_hmfsi = {
 	.target = {
 		.name = "POWER8 OPB attached hMFSI",
 		.compatible = "ibm,power8-opb-hmfsi",
@@ -339,7 +339,7 @@ static int cfam_hmfsi_probe(struct pdbg_target *target)
 	return 0;
 }
 
-struct fsi cfam_hmfsi = {
+static struct fsi cfam_hmfsi = {
 	.target = {
 		.name = "CFAM hMFSI Port",
 		.compatible = "ibm,fsi-hmfsi",
diff --git a/libpdbg/fake.c b/libpdbg/fake.c
index 5e5571c..ec03ccf 100644
--- a/libpdbg/fake.c
+++ b/libpdbg/fake.c
@@ -30,7 +30,7 @@ static int fake_fsi_write(struct fsi *fsi, uint32_t addr, uint32_t value)
 	return 0;
 }
 
-struct fsi fake_fsi = {
+static struct fsi fake_fsi = {
 	.target = {
 		.name =	"Fake FSI",
 		.compatible = "ibm,fake-fsi",
@@ -54,7 +54,7 @@ static int fake_pib_write(struct pib *pib, uint64_t addr, uint64_t value)
 	return 0;
 }
 
-struct pib fake_pib = {
+static struct pib fake_pib = {
 	.target = {
 		.name =	"Fake PIB",
 		.compatible = "ibm,fake-pib",
diff --git a/libpdbg/host.c b/libpdbg/host.c
index f43b355..5e0e08f 100644
--- a/libpdbg/host.c
+++ b/libpdbg/host.c
@@ -111,7 +111,7 @@ out:
 	return -1;
 }
 
-struct pib host_pib = {
+static struct pib host_pib = {
 	.target = {
 		.name = "Host based debugfs SCOM",
 		.compatible  = "ibm,host-pib",
diff --git a/libpdbg/htm.c b/libpdbg/htm.c
index 2158846..741b39f 100644
--- a/libpdbg/htm.c
+++ b/libpdbg/htm.c
@@ -980,7 +980,7 @@ static int chtm_probe(struct pdbg_target *target)
 	return is_debugfs_memtrace_ok() && is_debugfs_scom_ok() ? 0 : -1;
 }
 
-struct htm nhtm = {
+static struct htm nhtm = {
 	.target = {
 		.name =	"Nest HTM",
 		.compatible = "ibm,power8-nhtm", "ibm,power9-nhtm",
@@ -996,7 +996,7 @@ struct htm nhtm = {
 };
 DECLARE_HW_UNIT(nhtm);
 
-struct htm chtm = {
+static struct htm chtm = {
 	.target = {
 		.name = "POWER8 Core HTM",
 		.compatible = "ibm,power8-chtm",
diff --git a/libpdbg/i2c.c b/libpdbg/i2c.c
index df5ac86..9a5c9dd 100644
--- a/libpdbg/i2c.c
+++ b/libpdbg/i2c.c
@@ -152,7 +152,7 @@ int i2c_target_probe(struct pdbg_target *target)
 	return 0;
 }
 
-struct pib p8_i2c_pib = {
+static struct pib p8_i2c_pib = {
 	.target = {
 		.name =	"POWER8 I2C Slave",
 		.compatible = "ibm,power8-i2c-slave",
diff --git a/libpdbg/kernel.c b/libpdbg/kernel.c
index c35226f..8b597ef 100644
--- a/libpdbg/kernel.c
+++ b/libpdbg/kernel.c
@@ -133,7 +133,7 @@ int kernel_fsi_probe(struct pdbg_target *target)
 	return -1;
 }
 
-struct fsi kernel_fsi = {
+static struct fsi kernel_fsi = {
 	.target = {
 		.name = "Kernel based FSI master",
 		.compatible = "ibm,kernel-fsi",
diff --git a/libpdbg/p8chip.c b/libpdbg/p8chip.c
index 0123042..6cae663 100644
--- a/libpdbg/p8chip.c
+++ b/libpdbg/p8chip.c
@@ -307,7 +307,7 @@ static int p8_thread_probe(struct pdbg_target *target)
 	return 0;
 }
 
-struct thread p8_thread = {
+static struct thread p8_thread = {
 	.target = {
 		.name = "POWER8 Thread",
 		.compatible = "ibm,power8-thread",
@@ -341,7 +341,7 @@ static int p8_core_probe(struct pdbg_target *target)
 	return 0;
 }
 
-struct core p8_core = {
+static struct core p8_core = {
 	.target = {
 		.name = "POWER8 Core",
 		.compatible = "ibm,power8-core",
diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c
index 339d2f0..e64c73c 100644
--- a/libpdbg/p9chip.c
+++ b/libpdbg/p9chip.c
@@ -340,7 +340,7 @@ static int p9_ram_destroy(struct thread *thread)
 	return 0;
 }
 
-struct thread p9_thread = {
+static struct thread p9_thread = {
 	.target = {
 		.name = "POWER9 Thread",
 		.compatible = "ibm,power9-thread",
@@ -450,7 +450,7 @@ static int p9_core_probe(struct pdbg_target *target)
 	return 0;
 }
 
-struct core p9_core = {
+static struct core p9_core = {
 	.target = {
 		.name = "POWER9 Core",
 		.compatible = "ibm,power9-core",
@@ -473,7 +473,7 @@ static int p9_chiplet_probe(struct pdbg_target *target)
         return 0;
 }
 
-struct chiplet p9_chiplet = {
+static struct chiplet p9_chiplet = {
         .target = {
                 .name = "POWER9 Chiplet",
                 .compatible = "ibm,power9-chiplet",
-- 
2.17.0



More information about the Pdbg mailing list