From patchwork Tue Dec 6 20:52:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Cheatham X-Patchwork-Id: 13066272 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F258FC3A5A7 for ; Tue, 6 Dec 2022 20:53:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229724AbiLFUxS (ORCPT ); Tue, 6 Dec 2022 15:53:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229734AbiLFUxH (ORCPT ); Tue, 6 Dec 2022 15:53:07 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2062.outbound.protection.outlook.com [40.107.92.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 702702AC40 for ; Tue, 6 Dec 2022 12:53:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QncZRaIcDJhazSkfRfqkh6dXvprrG3f61b7RX2XXAjJ6opSOodu84jis+hdLoLl8ghcKpGhUrt0XVKATogeqI+PJwWfbaIj+Z6807fps0eVAntH5Rjh/5ZDin73QwfAoAHmXAdq4ug+48pS6mzJefzIRK1lUmjg8aRh0fuXY+0YxRK11A4zcnp0GqiFyGp2u+B6UDlLQxPia3Pw4FgYa+1mIJUIyZpyv8twQ5APHLMJGfB9X55N69TeguIiBQMif80wja/U4r6gNxvq99gf5n5qRWVgrIXk6lwh6LPJ0ctoVVy8irIaHE8CzH8iOuGv14QBCT9rOTfpgoAMgHvXVhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2tWagHjL/wHCKvP25krqJQf3A6ssjBZ9TqKb26JZQiQ=; b=MI6wHR/ADut7jmZJ2ViI6QPg0JZz7OPGVRhAPuM/5hlgRB4lflk39GZks4aHef/RUYl3olvkF9ZT7+lUI1+Gszkvd+qtIHSRGA1HbRl9yRX/QKb4iyDQ98i+UeVnClTR92x4jAcNqsN0Vyvk6VZMW7dRaZpIRVRGWqG399lr+YSaimh4SFEkgz6Ob6IVdmL3GfPaFnCZntjQtcDgR0tOTDZYUH6eskVt8p+6Z85+SYs1Mc27j+v6bN8+iBDhQk80Fj1cRyY+v1q528srsxT3CHPkW0DMdNhES1a5qeuiycKC1cl7HYWB/iOtdWvwk8vCcATJm2QK+bKuLO2ihfkYNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2tWagHjL/wHCKvP25krqJQf3A6ssjBZ9TqKb26JZQiQ=; b=0StUHVzy7Xvuzr6FkxI8ec3eH0Ysv3iRfKJ7cUj3wz6wW9bU50zBTfuuDSbDtIPAWQF0Y92HGojDBDkzLQKvqcsI+X9M7d7HZ0bM463FgtWZMGXwn6UydDxTvgkXHveXXqtyNNIZsPaiKviaXnnryRKgN0gbI83LbFJCeH0xrUA= Received: from BN9PR03CA0853.namprd03.prod.outlook.com (2603:10b6:408:13d::18) by PH7PR12MB6812.namprd12.prod.outlook.com (2603:10b6:510:1b6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Tue, 6 Dec 2022 20:53:04 +0000 Received: from BN8NAM11FT011.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13d:cafe::2a) by BN9PR03CA0853.outlook.office365.com (2603:10b6:408:13d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14 via Frontend Transport; Tue, 6 Dec 2022 20:53:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT011.mail.protection.outlook.com (10.13.176.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.14 via Frontend Transport; Tue, 6 Dec 2022 20:53:03 +0000 Received: from bcheatha-HP-EliteBook-845-G8-Notebook-PC.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 6 Dec 2022 14:53:01 -0600 From: Ben Cheatham To: , , , , CC: , , Subject: [PATCH v2 1/3] ACPI, APEI, EINJ: Fix Formatting Errors Date: Tue, 6 Dec 2022 14:52:32 -0600 Message-ID: <20221206205234.606073-2-Benjamin.Cheatham@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221206205234.606073-1-Benjamin.Cheatham@amd.com> References: <20221206205234.606073-1-Benjamin.Cheatham@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT011:EE_|PH7PR12MB6812:EE_ X-MS-Office365-Filtering-Correlation-Id: 98e60273-1b5e-4cb8-e334-08dad7cbde6a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YhzS8qRW1f8j+9m8TgLrj4HfxpHNlDXtWIDjOQr3ujRvUay5cjycKIPmfQ0hOu9coADd+Cj5+tvl04T3t5Q7VB0O5lMEOlvwr9nRHuGd9P1Fw08X5kDO3RZUd4FWBmDOJsk2Xp3tGN249GzU1kwTZJmGKilF4buMFw3SGDYcA9euoce1iijFE2qoF2MREYJKGdZhC6D6CXpaWhyeqrJqtbgvecwI0cThe/UKi9Egx1y7dzG5SM3ZhWIVoAJ3mGBYSn2Z0AhDENfz3q6pMhr6bYOtf5rf2BfP0bBqh1+wQRY52umrSeVbjIpzflhJh2RuYCYB27eBXNtGhM+Jb8Fk6jIEcvxxqhbpc+RyG6/Dp8Kler9RlkG/JVZbd4sUiqN1gC+uCk4lZNbwfk0VwpNetYDMJuxgLt8WzAJowY8fvMY3RqGZcOXENcI1qUdOov9aTGvkUpZiak2owCZ1qMfAL7a6OOmpsM5WyeNLr5VMi9S6o2gkaB000gHUvQlF+7SuWxFIC6SQOtBs0P+GjtBqme8qURyhzN+b8UQDVeaQtEQ/VPPmKgXqNdb6OKBYhenhFYNncPRSEx/BIX0CDDYDMYujlgesDbIBReXCFyqeCTacT2GqDXZBtOhOIbSl3EG0JUXTj/y8KVpTMtrwa3wWjeWmh9UFO+ZtVIf2C86RO0AEzejA5J6vx4x9YEYXIn5oaanxwfp2Yi7iWnWvwjOjxuxN5vTvLrfZboKa358RlMM= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(376002)(396003)(39860400002)(451199015)(36840700001)(46966006)(40470700004)(83380400001)(36860700001)(81166007)(2906002)(86362001)(356005)(70206006)(70586007)(8676002)(41300700001)(4326008)(8936002)(82310400005)(5660300002)(40480700001)(26005)(7696005)(6666004)(16526019)(336012)(426003)(47076005)(186003)(54906003)(316002)(2616005)(478600001)(40460700003)(110136005)(82740400003)(1076003)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2022 20:53:03.5757 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 98e60273-1b5e-4cb8-e334-08dad7cbde6a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT011.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6812 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Jay Lu Checkpatch reveals warnings and an error due to missing lines and incorrect indentations. Add the missing lines after declarations and fix the suspect indentations. Signed-off-by: Jay Lu Signed-off-by: Ben Cheatham --- drivers/acpi/apei/einj.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index 6b583373c58a..1a2641937eb6 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c @@ -358,6 +358,7 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type, */ if ((param_extension || acpi5) && (type & MEM_ERROR_MASK) && param2) { struct apei_resources addr_resources; + apei_resources_init(&addr_resources); trigger_param_region = einj_get_trigger_parameter_region( trigger_tab, param1, param2); @@ -432,11 +433,11 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, } v5param->flags = vendor_flags; } else if (flags) { - v5param->flags = flags; - v5param->memory_address = param1; - v5param->memory_address_range = param2; - v5param->apicid = param3; - v5param->pcie_sbdf = param4; + v5param->flags = flags; + v5param->memory_address = param1; + v5param->memory_address_range = param2; + v5param->apicid = param3; + v5param->pcie_sbdf = param4; } else { switch (type) { case ACPI_EINJ_PROCESSOR_CORRECTABLE: @@ -466,6 +467,7 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, return rc; if (einj_param) { struct einj_parameter *v4param = einj_param; + v4param->param1 = param1; v4param->param2 = param2; } @@ -689,8 +691,7 @@ static int __init einj_init(void) if (status == AE_NOT_FOUND) { pr_warn("EINJ table not found.\n"); return -ENODEV; - } - else if (ACPI_FAILURE(status)) { + } else if (ACPI_FAILURE(status)) { pr_err("Failed to get EINJ table: %s\n", acpi_format_exception(status)); return -EINVAL; From patchwork Tue Dec 6 20:52:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Cheatham X-Patchwork-Id: 13066273 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D24E7C3A5A7 for ; Tue, 6 Dec 2022 20:53:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229733AbiLFUx3 (ORCPT ); Tue, 6 Dec 2022 15:53:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbiLFUxW (ORCPT ); Tue, 6 Dec 2022 15:53:22 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2065.outbound.protection.outlook.com [40.107.92.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D09AD2AC49 for ; Tue, 6 Dec 2022 12:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SVJ+XkEjM6E+LxZxwaV5FhsBAfLZyX3HJ0ZT2OsAurB0bczEOAIFubfxxJKjkdEeJBAdBGmCUyXAGY5AOEBNRBiDz/QahBclSCkR2tVG0P2Do9EM5ISb07uUzxHzdWrqC2Er2YUi1w3uoUzFd4TX8WxpH+Uu1NdseHlN7dRKL/NMwXjiG0wL+uZgrjOMSVBC+WVfGY5ndPi2Fxu5nd8vdvhkkcucxO//aQFEtZD96Zuw7YfxBm0QDUIDDgpVaa+o34Ux3zvi9QPrFjgdVFfUqUwAzX7tFc+lBBP7bFs9u0i63aVK91zXacWwZJA3REjQJr7h/EJiPHkXtCk2+7DDlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ugemoZyC3JJW2RuXwkYk0SUA+nGXaEAPU53ZJuvlZpo=; b=OelWYI0XnPbE3dyP+jqI8iji4JgGCJulQTb7fk6KQw5il1s4/lv1wY6WBXtRBJeBNwA4oVTkQkWYfsxdmmyvqnl9TpTqbNWj6vqjh+ARQX4U9x3SsT0tVx9eNNhY7n8i23y+Gpx3fVtPsIB/jIWLXPZIzv8ZnB3dAuQ83OI1TlTaZdqSDJKVcbGJOm20ZTverWWIgaFQuqr+6+zej7jkMeJHciKEAlkzVEHywhZIVtJUSpa5C39a4obNqo2i8vCuur7N3IGBZm0G58hXrW8xPfIVRhQbJP9ue1ZBYmZyDUdw/zdylBnsAKb22hIo/IqNhp61NmvnhT93zg0uaLTEkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ugemoZyC3JJW2RuXwkYk0SUA+nGXaEAPU53ZJuvlZpo=; b=Gv2ad4/Fe4Ojf4Wodengv6SoiNm0Xmqxl8rXXEwj7LQ1kHIh5sH3EEb2TH6G0RG7vV1h9Y4S5iQmffTAZe0BXi2pLgucVWKn10f/68wsxrcbD1PZOzrERHhzWXTj1gbkpRzzq53X5ntIv43dsmeaa00RoMUdURasPhi1QINSc9g= Received: from BN9PR03CA0613.namprd03.prod.outlook.com (2603:10b6:408:106::18) by PH7PR12MB6489.namprd12.prod.outlook.com (2603:10b6:510:1f7::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Tue, 6 Dec 2022 20:53:17 +0000 Received: from BN8NAM11FT005.eop-nam11.prod.protection.outlook.com (2603:10b6:408:106:cafe::6) by BN9PR03CA0613.outlook.office365.com (2603:10b6:408:106::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14 via Frontend Transport; Tue, 6 Dec 2022 20:53:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT005.mail.protection.outlook.com (10.13.176.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.14 via Frontend Transport; Tue, 6 Dec 2022 20:53:17 +0000 Received: from bcheatha-HP-EliteBook-845-G8-Notebook-PC.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 6 Dec 2022 14:53:16 -0600 From: Ben Cheatham To: , , , , CC: , , Subject: [PATCH v2 2/3] ACPI, APEI, EINJ: Refactor available_error_type_show Date: Tue, 6 Dec 2022 14:52:33 -0600 Message-ID: <20221206205234.606073-3-Benjamin.Cheatham@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221206205234.606073-1-Benjamin.Cheatham@amd.com> References: <20221206205234.606073-1-Benjamin.Cheatham@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT005:EE_|PH7PR12MB6489:EE_ X-MS-Office365-Filtering-Correlation-Id: 27cf634f-2d8f-4016-e9b1-08dad7cbe6a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CGMXuN2R2WEH81gBokQSmaUlAkMlzI1nAzIYDcSOiex1ThGRuiMseH0RpARe4quuUbyPL7Er2WJXZ7yVQ/shRfzhWmdhfB2bpvDTSWUJnruiaL14f7Ko80wdXsTagWURVgOfDOo4rZtFWHRFDNDalIiVSCdk532gB+IG9zt2huEhrJwbds3B8pVfGPvLJ0xlqSHG9NoUlCmFDc8vVzdsXREY3Zr9MbaVtKOzDUwYJcDzv5ec73+PPE2bXmjcyN+xOQXFyLeF1yRDpoypG/1GL2+PrEWJ9kjrzwgnLCXLisuf+BpnMCzEA3kvrxvEmtEf1uexNlPCyfKVMoSL0oFzcyyqqRCc4EZPvk7Tj5AU3i04VQMe5TvIlc3B4VQWjWtmIOUfsZ8rEaBQfiqDNL8otdSVqLi95pBc7s/j2hamchRFBr6wvJirZ6t424kuQ8o9csDk0OfF6ubOZ+Zxf7wWASWbM5oeqaFtC90nbhXeaA6jLsK7EG/3v6Pn9nSxHN3AOmy6ZormHw8B3xZczA0XSqcQdK8RKDSCSLhuV2bySEqxtkRN10pv455snbCrEnlg4f1OhMxtRLNbgt1HaFSup1tRsfjByH3uaF3c6JTutYX3EUUOEUK1/iT+ccZ2ik9ZX4KyQhoLmDfuQvpZAWzmSXauWD7Bb6v6jrYRfxg50zBF06XxZcgWniREcxwVjhm2v9pZ33WXB8A5INEZW3QSUrEFc3bIaNRHD/QYWXqCkp8= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(136003)(346002)(39860400002)(396003)(451199015)(40470700004)(36840700001)(46966006)(36756003)(82740400003)(86362001)(81166007)(356005)(70206006)(70586007)(2906002)(8676002)(8936002)(36860700001)(83380400001)(316002)(40460700003)(110136005)(1076003)(478600001)(47076005)(426003)(186003)(336012)(54906003)(16526019)(2616005)(4326008)(40480700001)(5660300002)(82310400005)(41300700001)(7696005)(26005)(6666004)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2022 20:53:17.3581 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 27cf634f-2d8f-4016-e9b1-08dad7cbe6a1 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT005.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6489 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Jay Lu Move error type descriptions into an array and loop over error types to improve readability and maintainability. Replace seq_printf() with seq_puts() as recommended by checkpatch.pl. Signed-off-by: Jay Lu Co-developed-by: Ben Cheatham Signed-off-by: Ben Cheatham --- drivers/acpi/apei/einj.c | 41 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index 1a2641937eb6..ab86b2f4e719 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c @@ -571,6 +571,20 @@ static u64 error_param2; static u64 error_param3; static u64 error_param4; static struct dentry *einj_debug_dir; +static const char * const einj_error_type_string[] = { + "0x00000001\tProcessor Correctable\n", + "0x00000002\tProcessor Uncorrectable non-fatal\n", + "0x00000004\tProcessor Uncorrectable fatal\n", + "0x00000008\tMemory Correctable\n", + "0x00000010\tMemory Uncorrectable non-fatal\n", + "0x00000020\tMemory Uncorrectable fatal\n", + "0x00000040\tPCI Express Correctable\n", + "0x00000080\tPCI Express Uncorrectable non-fatal\n", + "0x00000100\tPCI Express Uncorrectable fatal\n", + "0x00000200\tPlatform Correctable\n", + "0x00000400\tPlatform Uncorrectable non-fatal\n", + "0x00000800\tPlatform Uncorrectable fatal\n", +}; static int available_error_type_show(struct seq_file *m, void *v) { @@ -580,30 +594,9 @@ static int available_error_type_show(struct seq_file *m, void *v) rc = einj_get_available_error_type(&available_error_type); if (rc) return rc; - if (available_error_type & 0x0001) - seq_printf(m, "0x00000001\tProcessor Correctable\n"); - if (available_error_type & 0x0002) - seq_printf(m, "0x00000002\tProcessor Uncorrectable non-fatal\n"); - if (available_error_type & 0x0004) - seq_printf(m, "0x00000004\tProcessor Uncorrectable fatal\n"); - if (available_error_type & 0x0008) - seq_printf(m, "0x00000008\tMemory Correctable\n"); - if (available_error_type & 0x0010) - seq_printf(m, "0x00000010\tMemory Uncorrectable non-fatal\n"); - if (available_error_type & 0x0020) - seq_printf(m, "0x00000020\tMemory Uncorrectable fatal\n"); - if (available_error_type & 0x0040) - seq_printf(m, "0x00000040\tPCI Express Correctable\n"); - if (available_error_type & 0x0080) - seq_printf(m, "0x00000080\tPCI Express Uncorrectable non-fatal\n"); - if (available_error_type & 0x0100) - seq_printf(m, "0x00000100\tPCI Express Uncorrectable fatal\n"); - if (available_error_type & 0x0200) - seq_printf(m, "0x00000200\tPlatform Correctable\n"); - if (available_error_type & 0x0400) - seq_printf(m, "0x00000400\tPlatform Uncorrectable non-fatal\n"); - if (available_error_type & 0x0800) - seq_printf(m, "0x00000800\tPlatform Uncorrectable fatal\n"); + for (int pos = 0; pos < ARRAY_SIZE(einj_error_type_string); pos++) + if (available_error_type & BIT(pos)) + seq_puts(m, einj_error_type_string[pos]); return 0; } From patchwork Tue Dec 6 20:52:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Cheatham X-Patchwork-Id: 13066274 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46BACC352A1 for ; Tue, 6 Dec 2022 20:53:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229500AbiLFUxi (ORCPT ); Tue, 6 Dec 2022 15:53:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbiLFUxh (ORCPT ); Tue, 6 Dec 2022 15:53:37 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 253BD2A978 for ; Tue, 6 Dec 2022 12:53:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DXMQ7TjS68/Muov6hVdvndP51+4hLCefslQvpeJJJvxHiOoAqCQo75gbK9ADfXzIrOVlshhjIlOmJHs8Uwqg6MU6APJP0oJyEwYj6XBEQuOshiA563r5KmmKd4+3Z4Ryxgd6en3q7u6MCaQLNGzbOcON0lAEDcuOxZR0cwoyE49UfCmPfQnx41LJT29oATPArD+nGV1XSfkmaFp+WwA4zyym1HeclDO+G+Cz81IvX1uk7uJP7GZ0h97pydLy2mGOl0dKF+TNkyH+2j1AApxQukLv9Vtt4poUx4I5mfruKapbP4PkaD4rQBBn+FN1IIrTCSs5s35hNPINVMP/WeCogg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mT0IEdNcvUABdk5gCPsOsw4Tx9eQ9FeKbnpnLfASHdo=; b=N9LPpVO7N5ZoAeYewv+Sf6f8dmNtzR++4IcBHC1XIl6LY2wyS7SOG821ixEXC6sKurhVql/pS6WLP4rZPoVCWCeTnpDADac5VOupOX3Ba7n1rCzzzQi9nT728bYa7nhfCgCPJxB1rcHdFIsAsWLq0fGi/6H7KERWl1Vkqktcr2YtVLQexkikY9P8kGnZ+gjV2y6CdIrhxlZh5dqYhVg8XgcI0JXdjrKX3kqJjE68ES0L16A4T1U5Ud/o718HuZMd785t0d4ZSPMJH6g36KHsXTot88/PuaAjrgu37M2D5ZgCET1xfDC/Kc39wgVEdJXsJz4pcZkLqXNv4vtX5nfwXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mT0IEdNcvUABdk5gCPsOsw4Tx9eQ9FeKbnpnLfASHdo=; b=xRkmc64tZQBOUWGNFjSx+dEjNx5phTRRYg5KMyLO6mmOPXRYl/vjmexGmEgeY3rGpRXIH/f7tt5smtEyaOYQndBKUCTwHlwDMXf+n+A6r77TApWh70NOryJBoL6URHAaiDtMku3BQTdde/ZuMTBd9EhhnMRKkt6uZhHTG4QCOPQ= Received: from BN0PR04CA0195.namprd04.prod.outlook.com (2603:10b6:408:e9::20) by CY5PR12MB6382.namprd12.prod.outlook.com (2603:10b6:930:3e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Tue, 6 Dec 2022 20:53:33 +0000 Received: from BN8NAM11FT096.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e9:cafe::90) by BN0PR04CA0195.outlook.office365.com (2603:10b6:408:e9::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14 via Frontend Transport; Tue, 6 Dec 2022 20:53:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT096.mail.protection.outlook.com (10.13.177.195) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.14 via Frontend Transport; Tue, 6 Dec 2022 20:53:33 +0000 Received: from bcheatha-HP-EliteBook-845-G8-Notebook-PC.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 6 Dec 2022 14:53:29 -0600 From: Ben Cheatham To: , , , , CC: , , Subject: [PATCH v2 3/3] ACPI, APEI, EINJ: Add support for new CXL error types Date: Tue, 6 Dec 2022 14:52:34 -0600 Message-ID: <20221206205234.606073-4-Benjamin.Cheatham@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221206205234.606073-1-Benjamin.Cheatham@amd.com> References: <20221206205234.606073-1-Benjamin.Cheatham@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT096:EE_|CY5PR12MB6382:EE_ X-MS-Office365-Filtering-Correlation-Id: 70614f95-43a9-47a6-6ea8-08dad7cbf038 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vCRRpKozQnFIMvMXgy4ylCt7xjxCpqWGbL6qUIoVFVcMp8WCJOwy7Nv5UID3Q6BGsnqW+vgYz8sK4GJ2ELX/L0lLJpx4IT1KG2Q4U9T97AsQgO5GGDtJ4rORQeIrDrEcFDfAl6R5qblTxJZugc0+Q1Qz0rkQnSthjOyhAIFiwtE5UJ6kXCXIKzvpjdmCTgDpp4Rg27kU2CFh4H70Q0Xgzij++bf6nFdbgN1x81oLUQk3ZCzJ0Ubj1QFSeVG3I7K3r7iAwFp08SNx4IqeTNW2YFhKwxA45QrqgRf6oNbVtFtUixJ9dwWp7mF5Oh8xOEQi1n5OH/ySIfuEKY58r7uoYnAanIAILdeuNbCOuE5HTu/fvd87PYxABrf8VgIe+RjUeQiDej0x6AyLG+KoXRLwBjsVZoV8gGv/ZENHLkt06ZUisE2cTIxROr3D1xU15W2yJZivv3Im8q0g7wMCFVnK0CWvMyh5vITJ0iSSFxl32ywLvM5mECP7qzF5thEW1H9UYzcitpj6WZ3AiaQR7/ulCDFAO62AaouItM0YwnRBo7KQHbUdF0FFFduYKIcRY1OGmVInpiq+8keeZ3zi5oZS/DzwK0SxtDB21VxT5RTONkkrwdxfvdlDSOuDXaLycC5OjmBi1dygDvk67uiSt5fnANCfQDDQj/qqkra5EAIOcCkObwoia8B0SNDbe8SaP7CYDS6V/ZvabtIAVOrnPzgAXylIm5fxV6DB71KCvImwhe8= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(136003)(39860400002)(396003)(451199015)(40470700004)(36840700001)(46966006)(36756003)(86362001)(81166007)(356005)(8936002)(70586007)(2906002)(8676002)(82740400003)(36860700001)(70206006)(83380400001)(41300700001)(110136005)(40460700003)(1076003)(186003)(336012)(478600001)(2616005)(54906003)(47076005)(16526019)(4326008)(426003)(5660300002)(82310400005)(316002)(40480700001)(6666004)(7696005)(26005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2022 20:53:33.4440 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 70614f95-43a9-47a6-6ea8-08dad7cbf038 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT096.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6382 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Jay Lu EINJ module allows new CXL error types to be passed through sysfs interface, but it doesn't advertise new CXL error types in sysfs. Update EINJ so that it displays new CXL errors. Signed-off-by: Jay Lu Co-developed-by: Ben Cheatham Signed-off-by: Ben Cheatham --- drivers/acpi/apei/einj.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index ab86b2f4e719..82004abb9643 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c @@ -584,6 +584,12 @@ static const char * const einj_error_type_string[] = { "0x00000200\tPlatform Correctable\n", "0x00000400\tPlatform Uncorrectable non-fatal\n", "0x00000800\tPlatform Uncorrectable fatal\n", + "0x00001000\tCXL.cache Protocol Correctable\n", + "0x00002000\tCXL.cache Protocol Uncorrectable non-fatal\n", + "0x00004000\tCXL.cache Protocol Uncorrectable fatal\n", + "0x00008000\tCXL.mem Protocol Correctable\n", + "0x00010000\tCXL.mem Protocol Uncorrectable non-fatal\n", + "0x00020000\tCXL.mem Protocol Uncorrectable fatal\n", }; static int available_error_type_show(struct seq_file *m, void *v)