[Skiboot] [PATCH 09/11] fsp-sensor: cleanup unused code

Cédric Le Goater clg at fr.ibm.com
Thu Feb 5 17:30:57 AEDT 2015


The previous patches brought a large number of changes which made
some parts of the code obsolete. Remove them.

Signed-off-by: Cédric Le Goater <clg at fr.ibm.com>
---
 hw/fsp/fsp-sensor.c |   80 ++++++---------------------------------------------
 1 file changed, 8 insertions(+), 72 deletions(-)

diff --git a/hw/fsp/fsp-sensor.c b/hw/fsp/fsp-sensor.c
index 13fd5cdeb5d1..ea4a0c45330b 100644
--- a/hw/fsp/fsp-sensor.c
+++ b/hw/fsp/fsp-sensor.c
@@ -77,21 +77,9 @@ enum sensor_state {
 };
 
 enum spcn_attr {
-	/* mod 0x01, 0x02 */
 	SENSOR_STATUS,
-	SENSOR_PRESENT,
-	SENSOR_FAULTED,
-	SENSOR_AC_FAULTED,
-	SENSOR_ON,
-	SENSOR_ON_SUPPORTED,
-	/* mod 0x10, 0x11 */
 	SENSOR_THRS,
-	SENSOR_LOCATION,
-	/* mod 0x12, 0x13 */
 	SENSOR_DATA,
-	/* mod 0x1c */
-	SENSOR_POWER,
-
 	SENSOR_MAX,
 };
 
@@ -106,58 +94,23 @@ struct opal_sensor_data {
 	uint32_t	offset;		/* Offset in sensor buffer */
 };
 
-struct spcn_mod_attr {
-	const char *name;
-	enum spcn_attr val;
-};
-
 struct spcn_mod {
 	uint8_t mod;		/* Modifier code */
 	uint8_t entry_size;	/* Size of each entry in response buffer */
 	uint16_t entry_count;	/* Number of entries */
-	struct spcn_mod_attr *mod_attr;
-};
-
-static struct spcn_mod_attr prs_status_attrs[] = {
-		{"status", SENSOR_STATUS},
-		{"present", SENSOR_PRESENT},
-		{"faulted", SENSOR_FAULTED},
-		{"ac-faulted", SENSOR_AC_FAULTED},
-		{"on", SENSOR_ON},
-		{"on-supported", SENSOR_ON_SUPPORTED}
-};
-
-static struct spcn_mod_attr sensor_param_attrs[] = {
-		{"thrs", SENSOR_THRS},
-		{"loc", SENSOR_LOCATION}
-};
-
-static struct spcn_mod_attr sensor_data_attrs[] = {
-		{"data", SENSOR_DATA}
-};
-
-static struct spcn_mod_attr sensor_power_attrs[] = {
-		{"power", SENSOR_POWER}
 };
 
 static struct spcn_mod spcn_mod_data[] = {
-		{SPCN_MOD_PRS_STATUS_FIRST, PRS_STATUS_ENTRY_SZ, 0,
-				prs_status_attrs},
-		{SPCN_MOD_PRS_STATUS_SUBS, PRS_STATUS_ENTRY_SZ, 0,
-				prs_status_attrs},
-		{SPCN_MOD_SENSOR_PARAM_FIRST, SENSOR_PARAM_ENTRY_SZ, 0,
-				sensor_param_attrs},
-		{SPCN_MOD_SENSOR_PARAM_SUBS, SENSOR_PARAM_ENTRY_SZ, 0,
-				sensor_param_attrs},
-		{SPCN_MOD_SENSOR_DATA_FIRST, SENSOR_DATA_ENTRY_SZ, 0,
-				sensor_data_attrs},
-		{SPCN_MOD_SENSOR_DATA_SUBS, SENSOR_DATA_ENTRY_SZ, 0,
-				sensor_data_attrs},
+		{SPCN_MOD_PRS_STATUS_FIRST, PRS_STATUS_ENTRY_SZ, 0 },
+		{SPCN_MOD_PRS_STATUS_SUBS, PRS_STATUS_ENTRY_SZ, 0 },
+		{SPCN_MOD_SENSOR_PARAM_FIRST, SENSOR_PARAM_ENTRY_SZ, 0 },
+		{SPCN_MOD_SENSOR_PARAM_SUBS, SENSOR_PARAM_ENTRY_SZ, 0 },
+		{SPCN_MOD_SENSOR_DATA_FIRST, SENSOR_DATA_ENTRY_SZ, 0 },
+		{SPCN_MOD_SENSOR_DATA_SUBS, SENSOR_DATA_ENTRY_SZ, 0 },
 		/* TODO Support this modifier '0x14', if required */
 		/* {SPCN_MOD_PROC_JUNC_TEMP, PROC_JUNC_ENTRY_SZ, 0, NULL}, */
-		{SPCN_MOD_SENSOR_POWER, SENSOR_DATA_ENTRY_SZ, 0,
-				sensor_power_attrs},
-		{SPCN_MOD_LAST, 0xff, 0xffff, NULL}
+		{SPCN_MOD_SENSOR_POWER, SENSOR_DATA_ENTRY_SZ, 0 },
+		{SPCN_MOD_LAST, 0xff, 0xffff}
 };
 
 /* Frame resource class (FRC) names */
@@ -282,29 +235,12 @@ static void fsp_sensor_process_data(struct opal_sensor_data *attr)
 		} else if (sensor_mod_data[0] == attr->frc &&
 				sensor_mod_data[1] == attr->rid) {
 			switch (attr->spcn_attr) {
-			/* modifier 0x01, 0x02 */
 			case SENSOR_STATUS:
 				sensor_data = sensor_mod_data[3];
 				break;
-			case SENSOR_PRESENT:
-				prlog(PR_TRACE,"Not exported to device tree\n");
-				break;
-			case SENSOR_FAULTED:
-				sensor_data = sensor_mod_data[3] & 0x02;
-				break;
-			case SENSOR_AC_FAULTED:
-			case SENSOR_ON:
-			case SENSOR_ON_SUPPORTED:
-				prlog(PR_TRACE,"Not exported to device tree\n");
-				break;
-			/* modifier 0x10, 0x11 */
 			case SENSOR_THRS:
 				sensor_data = sensor_mod_data[6];
 				break;
-			case SENSOR_LOCATION:
-				prlog(PR_TRACE,"Not exported to device tree\n");
-				break;
-			/* modifier 0x12, 0x13 */
 			case SENSOR_DATA:
 				sensor_data = sensor_mod_data[2];
 				break;
-- 
1.7.10.4



More information about the Skiboot mailing list