From patchwork Thu Feb 5 06:30:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 436636 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5F46414027C for ; Thu, 5 Feb 2015 17:31:57 +1100 (AEDT) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 352781A0EAB for ; Thu, 5 Feb 2015 17:31:57 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 8479C1A0C0C for ; Thu, 5 Feb 2015 17:31:32 +1100 (AEDT) Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Feb 2015 06:31:28 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 5 Feb 2015 06:31:27 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id E14A717D8024 for ; Thu, 5 Feb 2015 06:31:34 +0000 (GMT) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t156VQHw7602522 for ; Thu, 5 Feb 2015 06:31:26 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t156VQEK022190 for ; Wed, 4 Feb 2015 23:31:26 -0700 Received: from hermes.kaod.org (sig-9-79-46-126.de.ibm.com [9.79.46.126]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t156VLDA022052; Wed, 4 Feb 2015 23:31:25 -0700 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: skiboot@lists.ozlabs.org Date: Thu, 5 Feb 2015 07:30:57 +0100 Message-Id: <1423117857-32759-10-git-send-email-clg@fr.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1423117857-32759-1-git-send-email-clg@fr.ibm.com> References: <1423117857-32759-1-git-send-email-clg@fr.ibm.com> MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15020506-0013-0000-0000-000002DC8F8B Subject: [Skiboot] [PATCH 09/11] fsp-sensor: cleanup unused code X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 --- 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;