From patchwork Fri Mar 11 16:40:11 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: 8567551 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B2B5D9F44D for ; Fri, 11 Mar 2016 16:40:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9A6A1201F5 for ; Fri, 11 Mar 2016 16:40:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF335201B4 for ; Fri, 11 Mar 2016 16:40:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932476AbcCKQki (ORCPT ); Fri, 11 Mar 2016 11:40:38 -0500 Received: from mail-bl2on0061.outbound.protection.outlook.com ([65.55.169.61]:43108 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932372AbcCKQkh (ORCPT ); Fri, 11 Mar 2016 11:40:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=N1IWH7fvbLXIznXfXwt6YTBvU7P47+HAnJbvouImOro=; b=Bjy5kkwsxWaqcWcoIHF0AtI1kHuruuF3WGr/OW0hZqKqFpPFeMr4PvUyJ0FA/WXFvkSkqi5pWWc11q2zTc7XDjVDriaviwleILRCTT3S0eriR0hjT6EuD7BGMeIAxbSB5dYUVPc+GZOn5yvYWTaxjYGnOtz06x9/ffFwwenX0So= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from [127.0.1.1] (165.204.77.1) by CY1PR12MB0344.namprd12.prod.outlook.com (10.161.175.17) with Microsoft SMTP Server (TLS) id 15.1.427.16; Fri, 11 Mar 2016 16:40:34 +0000 Subject: [PATCH] crypto: ccp - Use different flag vars for nested locks From: Gary R Hook To: CC: , , Date: Fri, 11 Mar 2016 10:40:11 -0600 Message-ID: <20160311163942.4791.47157.stgit@taos> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BLUPR0401CA0019.namprd04.prod.outlook.com (25.162.114.157) To CY1PR12MB0344.namprd12.prod.outlook.com (25.161.175.17) X-MS-Office365-Filtering-Correlation-Id: ada62c06-47c9-477b-077e-08d349cbde5e X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0344; 2:wy3Vz487mhuFOmLC+rKN4UyDBjtKJU1KaluXIHCGb3Di5V9Q32v1Vn2HoKX2EJnL36BFqEBsoQqXfDaU3E7zoKzWLBHK5+9ECdDEdIR+4anneNXAm5vG5qOYSwVFWdKxBZI7f6yNa4VmTJh1M40Z1YKIuMYEXMtAydFoy5zbxzAFmwoBQPl4fGmivRSmvaA6; 3:XSorArZ6OBKW5HbgznJ8lJMtdfMyX7uhHp8IKLXfR6iC2oLglMuWX+mbdpLHUG8ffQ2jqudP6OfNVqo+ux0GXChZnnZmh2MQiO80NTJ4nIWII3UvUMQOhtDwXTmIThoR; 25:5FRr/lOJwau7pIYmPuIwV3ymBV6yUq+yurkS1oJE4nSS8+/T4YLiqNTbzmTLVBiipwd+x51s2o70JL/ITpO1qaproqO8YIm/8VFsK54B3QrDKwG9SGWoez88H47WyHfNCgWbtwOjQRIZn9+6eg2iVykhYFrHUI6PvYtMi/IZOUg2UNBpyzuZzuodUKoO0yzUl/Z66BkobSxbE5MO/bwOhKug6hhhPZnG+yqZ98bpABjbzHiL24ER9qR7v8S8mVgOvecMZlkFQaVh/c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-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:CY1PR12MB0344; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0344; X-Forefront-PRVS: 087894CD3C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6049001)(6009001)(4001350100001)(42186005)(86362001)(83506001)(110136002)(19580405001)(189998001)(19580395003)(97746001)(103116003)(54356999)(50986999)(586003)(47776003)(33646002)(230700001)(2351001)(229853001)(66066001)(5004730100002)(1096002)(2906002)(81166005)(1076002)(77096005)(3846002)(5008740100001)(33716001)(6116002)(4326007)(50466002)(92566002)(23676002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0344; H:[127.0.1.1]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjEyTUIwMzQ0OzIzOmRzNlhKa0tlVWhRaEw5aGNxdGcrZzh4Nm5x?= =?utf-8?B?eVloR05qRWdmU0ZCZmpjekZHY016NElrRGpTSkVuSmUxNDdtWUNpeEYzcHVo?= =?utf-8?B?ZHZEeUx2Q1lCVC9TV3pqY3NlNTRVOUo2TlVSMjdldXRkZ2lQSFYybzFXT0pz?= =?utf-8?B?SWNlWXRMZmxGSVgvdjk4dVdzMGNDWU83MnNtOWFZOEo4SjZuWHJxUmdScURy?= =?utf-8?B?bGpxdzlaWmdhNGw0ajNJbm0rbTFCcnM2ZVVtZ2pZcGRqaUMrWThvci9LQjND?= =?utf-8?B?YytLbm9hekFvMzV4cVVLcXpCVTdVRWFWbUxXSVpma2VkMVRnVjlxUk02em9q?= =?utf-8?B?c1VtQnhwc0dyK01hSTJId21ZVmNuQkJ3NkNFc2xldXlYTzgyTkVNMkUzQldz?= =?utf-8?B?bmR6UGdYVUxVT0ZCTXFRVDhyb1NYRmRWamMxbnN3VXFCUUVs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oft-Exchange-Diagnostics: 1; CY1PR12MB0344; 5:umf6MsGTRHk6vx5O504TFm7hLINIeJYnWe5VSSLDHcj8yyy5OAqXsIN5LgJJuXQ4ArF7viz2sJsy+dOdsdXhLqL5vbikxfIFkKHoArrzRNAmjb0LXeB8UsSuxt2WMR15yMLP2awwXl1CBrLNDd4Fxw==; 24:GxjWtyVvaKHHIRmVvuAfx0GefyFzjD0ghTOj/e2ElhccTxdVrTLoE3+T1lodpFc8yw2O12qPVJfSwe+3iBRFWff3H7Wtr0TsjS+MlGCgVAs=; 20:4qQawCtGPVDkboYgKtBvucpbhFoFx18eiivaLSv9CsDLb+xBFK4NDR+1XZ4TLPLNELyUD81k0kfeuLJlj3mDGvSVIzphpoAk6GNlakA3c3zenUXJOPum5lJiKFCkGvPHTiM080NC8aLSLpCfvbsRT8g8FS+MiNF5hUtGrkOL1RwR35VCmuFLkE9PLsIZUBqSNs4FBafNfoMlLhzmRYeoNMaqsrZTelhRMpSeCtenh1IOCYnogJwrttas8x/2sK3H X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2016 16:40:34.1483 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0344 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes a coccinelle warning about reusing a flags variable in nested lock acquisition. Signed-off-by: Gary R Hook Acked-by: Tom Lendacky --- drivers/crypto/ccp/ccp-dev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 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.c b/drivers/crypto/ccp/ccp-dev.c index 336e5b7..9c7bce8 100644 --- a/drivers/crypto/ccp/ccp-dev.c +++ b/drivers/crypto/ccp/ccp-dev.c @@ -120,7 +120,7 @@ void ccp_del_device(struct ccp_device *ccp) static struct ccp_device *ccp_get_device(void) { - unsigned long flags; + unsigned long flags, rrflags; struct ccp_device *dp = NULL; /* We round-robin through the unit list. @@ -128,14 +128,14 @@ static struct ccp_device *ccp_get_device(void) */ read_lock_irqsave(&ccp_unit_lock, flags); if (!list_empty(&ccp_units)) { - write_lock_irqsave(&ccp_rr_lock, flags); + write_lock_irqsave(&ccp_rr_lock, rrflags); dp = ccp_rr; if (list_is_last(&ccp_rr->entry, &ccp_units)) ccp_rr = list_first_entry(&ccp_units, struct ccp_device, entry); else ccp_rr = list_next_entry(ccp_rr, entry); - write_unlock_irqrestore(&ccp_rr_lock, flags); + write_unlock_irqrestore(&ccp_rr_lock, rrflags); } read_unlock_irqrestore(&ccp_unit_lock, flags);