From patchwork Wed Sep 28 16:53:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary R Hook X-Patchwork-Id: 9354345 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6272A6077B for ; Wed, 28 Sep 2016 16:54:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52D5B29604 for ; Wed, 28 Sep 2016 16:54:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46E5D29760; Wed, 28 Sep 2016 16:54:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D43029604 for ; Wed, 28 Sep 2016 16:53:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932916AbcI1Qxy (ORCPT ); Wed, 28 Sep 2016 12:53:54 -0400 Received: from mail-bl2nam02on0064.outbound.protection.outlook.com ([104.47.38.64]:60672 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932988AbcI1Qxx (ORCPT ); Wed, 28 Sep 2016 12:53:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=lOgebPDvKJFubtFh7S0tW8A+Hi34btYf5PyUWx1wQ3g=; b=aC48AluwAYsN/Ubkj88GaMV7wjncpMxVjYw70b4O501nHJJhS9Pvp69CLmuhB1srhGLGqb7MRP3TXvvQPAFB5RGNUl4zPPSKkj7UA+D1KyvJ18R2InLqtH4A/4ZVlMhLF/1sf6rKFf6oQPn1vRY9BuLsWrQnxcfjrEYdqftY1FM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gary.Hook@amd.com; Received: from [10.236.19.42] (165.204.77.1) by DM5PR12MB1401.namprd12.prod.outlook.com (10.168.238.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Wed, 28 Sep 2016 16:53:51 +0000 Subject: [PATCH v2 1/2] crypto: ccp - clean up data structure From: Gary R Hook To: CC: , , Date: Wed, 28 Sep 2016 11:53:47 -0500 Message-ID: <20160928165347.23263.45257.stgit@taos> In-Reply-To: <20160928165204.23263.77515.stgit@taos> References: <20160928165204.23263.77515.stgit@taos> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN1PR07CA0016.namprd07.prod.outlook.com (10.162.170.154) To DM5PR12MB1401.namprd12.prod.outlook.com (10.168.238.140) X-MS-Office365-Filtering-Correlation-Id: d4f920f5-704f-41c9-dac4-08d3e7c00675 X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1401; 2:PwYkEJ4YPxGKlQYSOWPcNqPG9a8myMbgw5DD4lzoGmu/INDM9jKIrskhMUE/vXQ9NW09DnwRaE4tVz3EFw/R1W23FYBlJUKDXpUXGPtuot+yZcausqE/Oz0jnOrECTDRor67r0b5HUa9xVlMYoWw/UScvgb8RApP5SxTUjT+vmRe/37VUKTJggXUXRwb2hfh; 3:SPI0y8MpPISA0P9iasQ9UR8WDeyF3z70Bph0EJJ/kAowtNNEYRX6onAUcVZcwq2MwPrV4aOjcQFV2FxVf1O7+x9t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ft-Exchange-Diagnostics: 1; DM5PR12MB1401; 20:M6iHKLZqEjhhnXMggDtNEAFpNqoF8JeBGPEgnVf1jcIU7ifV84KM0j1OLH7cvTBWgJmoUAQkIl2wvdcuWBS9hK4K1wJNh6n3KDipEt1+b1VEoh5ujcHCDRdxbJ1lgnIRj78FZrRYBbzlSviBxwwwGdE3n0MVNjNTFP4DHrPmSItpvzEdSYoJxhx1Ja2fkipFjkO8ffRdRXD+EHUxCBvXuwh7JQgu+w+mJE7/emm0IPn5n7nJy11DpO9Pcs/9hZOUhcu4ErSLu4z0zmfZDj8RHp5LIF5ezEA/5gAYoGMCRIil5Tkax2RPGdMO6Oat3ZIwWurSkaz42NO9cmDmJIhXVkTOl7CZHSGqzcz3iJ+pYWNMcKqyHne7viXtcXleIvLVs6lptf0EIrGp1DlBStBZfgaFVuk4mfYWXuSAsCJ4MDkzjOr4DcO77jIuvlmv/virdo/LpRw8BAeqYjj9p5nTN6Lwyapn0veWEfvXIIE9y+rYD/0lCng6h3y8HfMdMNgJ; 4:5rPVXryuzhSCK8dyGwoYVHra+w6I40Ph+AmnzAdk5c+Y//9pTPW2+JNHPlgRUxugD764hdXvn+447bHORwGA05PwOjRIzfhZoS5JScapMrq9ywq8m9q0kZjtI2aKl7H9yBAcJgS0+B+VyGNhAR/FRm2rhAtB9nv4IYVTm/NDNLxCmTaB/5i6yX9a0Jbvc9p/51yzabZeUFgsb20LRfvgcZkFWlrRvjkW5JcSQ3qzIjEE6bC5eFS/rNlw0PKIvbdwatDJ9y6s0ox3cAjbU/T0lNYMWphEH687Q7LB40hh24MPvqHqleg9DPgcfk3qc3iiDLNm7lsirReNDtjOrnaACHCiFp6MR0PMCQCEm4QUT8CSpiSARiddjyK8TTPpb5MkWuWAEDVBFNQONqJuyDHLXDqXGT5NPoMVNxKwPG M/h1Pe8uP7ZDSoPG09ij8USigf X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:DM5PR12MB1401; BCL:0; PCL:0; RULEID:; SRVR:DM5PR12MB1401; X-Forefront-PRVS: 0079056367 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(199003)(189002)(50986999)(97736004)(97746001)(9686002)(7736002)(230700001)(5660300001)(86362001)(33646002)(81166006)(305945005)(110136003)(50466002)(2950100002)(54356999)(19580405001)(77096005)(81156014)(7846002)(8676002)(42186005)(2351001)(76176999)(229853001)(19580395003)(101416001)(103116003)(1076002)(106356001)(66066001)(105586002)(83506001)(3846002)(6116002)(4326007)(92566002)(23676002)(4001350100001)(68736007)(586003)(33716001)(47776003)(6916009)(2906002)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1401; H:[10.236.19.42]; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxNDAxOzIzOllRT0JlU0E0SkMrOENmMWFrcmV2cGdjRUdG?= =?utf-8?B?SWR2d1JDNmpVMmhjTk1GOHp3NC92NFhCdzBpbWN4L2pxc1NwRWgrMmtuQm8z?= =?utf-8?B?b2lwaEZXaS92bHVXU2EvM1ZLeHQyNHMyWUxORGs4RUxxUTNiUm44QW1PQnRy?= =?utf-8?B?VTdNall0NUo2ZU8ybzVYUjdSczNoYi9PUFVoVGRIWFlQOXlHMkVNRnRXNFBo?= =?utf-8?B?cmdiU2RaMzFWMUZvcVJTZk8vWXFZZlJpQUhrN2dNcG9Fd3ZxSko4V3dqckg5?= =?utf-8?B?ZXJSRHQ4eXlFVGVnYzR2VFV4L3VlTVpFcTB5OXU4RzZ0WUh1WU1ZUldyOGN2?= =?utf-8?B?UmtoaDJvZ3EzM2ZyRmh6c2tjUEpxN1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7QaQHWyrDQszXU3rT4D5AAPKd/X4Rx1/4pxmARyQX1rUejN4Uofi78O+OTGyPe1F32lfl7N5PVfyjvKSVMCBG55Q17cCo=; 7:m1MhgxW1N0bucxbLQL/Rc0P+aqhNJXVuc8Gdtg56wb44OzH4iiO+13fwOxOSLJ+I6BXSw+ugx1pX3WGQZtsmaWfXDl46Zxasbjr+pGLkis/JrGSSiQXAxUsi2enY9C0lUfXUoOiaje48rsb3cS931vOATZ2XEIWZIgsrqXFPNTe4ZoWGFcVh1sxSTttor9hQWv0JxDp8fJLQdMtocMV6/wTIsmqK/SjzSuPGGClLyBW67n72jK22Ek8pE7Qm0h3s5oDSQUoZhe04pcjJozFRWNloh29KCDISWGpia4OzN337oihmtjTM3zvh8MJDPWni SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1401; 20:g6BAMMgV7Wq5q4ABjsKLFpk5M6VO1WHZrDGgq/2zW/1zitkm2IT4vhWjtTkvCr70XGOOD0UMlUM8svMg/BHPnMG62008Fzd/nbUqu3U+ph3kk6y3UfU3/sf5AEdAnnUdx/xV5+8yaazXj4AbJw6j1sfpzfAhyWvcYw91OUV88Sd62xZsLhcdQ/i87vuTjrF4DL5L4BSAXN0g40J2viqq1BA174P9XZ/xmwURqOkKcSGlZKqStqTQTgiGqWgG5/lu X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2016 16:53:51.4723 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1401 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Change names of data structure instances. Add const keyword where appropriate. Add error handling path. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev-v3.c | 2 +- drivers/crypto/ccp/ccp-dev-v5.c | 9 ++++++--- drivers/crypto/ccp/ccp-dev.h | 6 +++--- drivers/crypto/ccp/ccp-pci.c | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/crypto/ccp/ccp-dev-v3.c b/drivers/crypto/ccp/ccp-dev-v3.c index 578522d..b6615b1 100644 --- a/drivers/crypto/ccp/ccp-dev-v3.c +++ b/drivers/crypto/ccp/ccp-dev-v3.c @@ -566,7 +566,7 @@ static const struct ccp_actions ccp3_actions = { .irqhandler = ccp_irq_handler, }; -struct ccp_vdata ccpv3 = { +const struct ccp_vdata ccpv3 = { .version = CCP_VERSION(3, 0), .setup = NULL, .perform = &ccp3_actions, diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c index f499e34..a90ca9e 100644 --- a/drivers/crypto/ccp/ccp-dev-v5.c +++ b/drivers/crypto/ccp/ccp-dev-v5.c @@ -835,10 +835,13 @@ static int ccp5_init(struct ccp_device *ccp) /* Register the DMA engine support */ ret = ccp_dmaengine_register(ccp); if (ret) - goto e_kthread; + goto e_hwrng; return 0; +e_hwrng: + ccp_unregister_rng(ccp); + e_kthread: for (i = 0; i < ccp->cmd_q_count; i++) if (ccp->cmd_q[i].kthread) @@ -994,7 +997,7 @@ static const struct ccp_actions ccp5_actions = { .irqhandler = ccp5_irq_handler, }; -struct ccp_vdata ccpv5 = { +const struct ccp_vdata ccpv5a = { .version = CCP_VERSION(5, 0), .setup = ccp5_config, .perform = &ccp5_actions, @@ -1002,7 +1005,7 @@ struct ccp_vdata ccpv5 = { .offset = 0x0, }; -struct ccp_vdata ccpv5other = { +const struct ccp_vdata ccpv5b = { .version = CCP_VERSION(5, 0), .setup = ccp5other_config, .perform = &ccp5_actions, diff --git a/drivers/crypto/ccp/ccp-dev.h b/drivers/crypto/ccp/ccp-dev.h index ebc9365..08f58b0 100644 --- a/drivers/crypto/ccp/ccp-dev.h +++ b/drivers/crypto/ccp/ccp-dev.h @@ -639,8 +639,8 @@ struct ccp_vdata { const unsigned int offset; }; -extern struct ccp_vdata ccpv3; -extern struct ccp_vdata ccpv5; -extern struct ccp_vdata ccpv5other; +extern const struct ccp_vdata ccpv3; +extern const struct ccp_vdata ccpv5a; +extern const struct ccp_vdata ccpv5b; #endif diff --git a/drivers/crypto/ccp/ccp-pci.c b/drivers/crypto/ccp/ccp-pci.c index 239cbf2..28a9996 100644 --- a/drivers/crypto/ccp/ccp-pci.c +++ b/drivers/crypto/ccp/ccp-pci.c @@ -325,8 +325,8 @@ static int ccp_pci_resume(struct pci_dev *pdev) static const struct pci_device_id ccp_pci_table[] = { { PCI_VDEVICE(AMD, 0x1537), (kernel_ulong_t)&ccpv3 }, - { PCI_VDEVICE(AMD, 0x1456), (kernel_ulong_t)&ccpv5 }, - { PCI_VDEVICE(AMD, 0x1468), (kernel_ulong_t)&ccpv5other }, + { PCI_VDEVICE(AMD, 0x1456), (kernel_ulong_t)&ccpv5a }, + { PCI_VDEVICE(AMD, 0x1468), (kernel_ulong_t)&ccpv5b }, /* Last entry must be zero */ { 0, } };