From patchwork Tue Dec 19 21:16:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10124403 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 7F76A6019C for ; Tue, 19 Dec 2017 21:16:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DEE8294FB for ; Tue, 19 Dec 2017 21:16:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61A2F29570; Tue, 19 Dec 2017 21:16:12 +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 38232294FB for ; Tue, 19 Dec 2017 21:16:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751488AbdLSVQK (ORCPT ); Tue, 19 Dec 2017 16:16:10 -0500 Received: from mail-ve1eur01on0050.outbound.protection.outlook.com ([104.47.1.50]:62184 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751013AbdLSVQJ (ORCPT ); Tue, 19 Dec 2017 16:16:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=I4AZKVQpCZvob1/B0dXlE6FPSacE31enQI9PCb4777w=; b=NF/aSd6se9kb1h17Gm460TI8hbx8BBqmoGfsiT1mw5e8MjxlIU+rWW5u6c2atEBbTIqDZ6P6DzTg2RmnIFgdCa2uT71iKW56kCnk7bWR1S38EgC10nBSbWeTaqsOKI7WQWeDG/72OYyXumY/SlJ9IVR25sTXcx7Qhxjvv/2Vj5Q= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jgg@mellanox.com; Received: from mlx.ziepe.ca (70.74.179.152) by AM4PR0501MB2851.eurprd05.prod.outlook.com (2603:10a6:200:5c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Tue, 19 Dec 2017 21:16:06 +0000 Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eRPF3-00078e-1l; Tue, 19 Dec 2017 14:16:01 -0700 Date: Tue, 19 Dec 2017 14:16:01 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org, Bart Van Assche Subject: [PATCH rdma-core] srp_daemon: Remove duplicate sync_res shutdown Message-ID: <20171219211601.GA27412@ziepe.ca> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [70.74.179.152] X-ClientProxiedBy: DB6PR1001CA0036.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::22) To AM4PR0501MB2851.eurprd05.prod.outlook.com (2603:10a6:200:5c::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 32454a12-8962-4981-3a84-08d54725b7c6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:AM4PR0501MB2851; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0501MB2851; 3:8W/KH19Km2f0ezpEwMSfXAYqF2kpraCcG7eil2hPASgPajWj0ZMzW+lHg3u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BXv71Ce5DA4/RHzSbA5sTw3FgHZaC2SjK3wWVGucb7heUkZQ2h7Ev8W2ha+LefU6IA2lDutLDW2KNrSmz9msFGHmeGWIFxGWClvouXCgJls1nKvTYEtLXt1Ezdc1YnmMXYTDZNgoguT87v6mIyqjJ09m2K770spDTpZOzP4XpaUHxjWn75H+SACepScEiSL69JJKKffFbeSCdS9lWPcb/7ohRhxR20ps0YBF7R+940dLe2ZWqfjrvrceoLeSHYPHv4u17JTUN9UDFPdz0iuZwYesOpN50orepfgxAa4em; 4:dr8BiwdcLpNoEOqyb4w3I5xWeONJguurc0o+b5apK/HbzH//xSsX139oaOPEocdiHMiii/O9XXXV9KTgzi4NR1iWoFRbdU937lStqBBDe+DTD+Afp872yPhD8r7ghj0DT79EAYIRU7uVe65hcUu7tDdReWo4jtauTcHyrB/U+r1+lmpVQnHx5OgkR/V2hvg5PhpSNUKHZecqgvqn0Niezg5LTTxYAHrVlqNxNXuIoU/HDBmIS6vFSGw+QGhxxHG6o66Z38PAnrJCRECujFToxQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231023)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201703061421075)(201703161042150)(20161123562025)(20161123564025)(20161123560025)(20161123558100)(20161123555025)(6042181)(6072148)(201708071742011); SRVR:AM4PR0501MB2851; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM4PR0501MB2851; X-Forefront-PRVS: 052670E5A4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(346002)(366004)(189003)(199004)(36756003)(33896004)(50466002)(305945005)(83796002)(106356001)(386003)(498600001)(52116002)(59450400001)(16586007)(2906002)(7736002)(8936002)(53936002)(6916009)(105586002)(69596002)(57986006)(81166006)(83506002)(46656002)(47776003)(5660300001)(9786002)(66066001)(9746002)(6116002)(3846002)(9686003)(58126008)(8676002)(81156014)(97736004)(68736007)(575784001)(33656002)(86362001)(1076002)(122856001)(23726003)(18370500001)(24400500001)(42262002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2851; H:mlx.ziepe.ca; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR0501MB2851; 23:wGOCT2itoyTPJUOgnDlRsqAIupEhfBvrUes4dBj?= =?us-ascii?Q?f/WObG6Zt6K099Zo0CmIqERG8o10jYGbcLHXWfPBOS0qr6ct69FlSYfJI5OZ?= =?us-ascii?Q?Ub8rsYnI8vB6zrSahKRf2QqtpHYablpyaIUEnqExAjSw+baLs45bG5SmT6jb?= =?us-ascii?Q?SAal3alZjNZnzkeVr+GGCmo7Rp+QD9cWEt1PfGJ+7ZO46B84DW3BGOfcRlUz?= =?us-ascii?Q?GcMfxlya8LYy+AvwjYwRpj/Y+aRiQ84PgbQggQ3XW7Lu7GRSB94RKSZNfOBN?= =?us-ascii?Q?IaFOHUF4d+RKJe1+jdiD6oERC8zhAYknXx92uyjGuVdiToFO0f9rGUfvLuOA?= =?us-ascii?Q?3cOItlT6Mu18NvoWDtkiTfS4KZHr9Iht7S4ottbrx7e1lkQgY4nB09gtQyUe?= =?us-ascii?Q?+dLozU8ad0lspLZO79Mz4LE7LGFUpbL87htsXlWmUvA84EGRWRmbXk77fodx?= =?us-ascii?Q?WnALMQCBZ2CKrdMbyskAfj4sDJ06V2OJ46SrHBJ/qqdUR+ojd/EGSN+KeqxL?= =?us-ascii?Q?mf3dXew62nsS0OYfnqIxlVwDE8NbPHCb0BaEku0xsrPJ4FfeDvmmECHn8W/w?= =?us-ascii?Q?pmQYvQjIin2kvdBOPR050czPBxCw8JU9WL9gJ94z4CdV3y2CpqzJ0okGRh18?= =?us-ascii?Q?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e+th3sYrj4N7N7UhrgqYcUDONosag5hF45VDJ4/zvRVExNJTczGciwb3JEr7lcNZENT7KUERzfft0iCG7p04Bi8sMfeZsOq5U=; 5:bZfYKMVBBKfUR3Scgy+M41XjJMzFUZWrNSo5PXgYyd4oeQlr/02yVMKO208JSlrUFNpkFhj4QbI8bmmZwJJFkO0z+8fjd2YBPa+Jqcsf3OQssODI4kaIZCTvSoEJjxGkSS+gL0UPFs1Z60RTO5YFQtjyUWl+byqXpGX3DZtbpz8=; 24:d9ytzJ4TBsnRvAMByEh4QjC2o4X9tnIydDN0kMsB2RPr2eBIQ3O3V0K/UN3aC8fxWwNuFfoYP/+VYs0JN9vBpng5hZbRzxTeA5o8zWpUW8M=; 7:a2/SbmcODXhMmghqcv/4FkaKt82JoThUIp9Cf4ccyaRqFHxGRCYYlpzYNeLsfS/9oF/YZ3qqYQUkstKNN6DLdC6cF8v5JfWdPfAaK5/bAjM5Th0c/9ty/5AHW+1t7UDsMzYY1G/QQbO7nSvuLXAlfJzcWdew75GJkQcM5nyU4hvx53Sog0jofglnpRykjSnewKIpNcW+/Jb7rDohWOrBlYkly+HcbHZlpV1ErQ0NriFTsSg1AJBK4E8W9Ux4fwTB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 21:16:06.3658 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 32454a12-8962-4981-3a84-08d54725b7c6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2851 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The very first thing free_res does is the same lock/signal/unlock sequence, so there is no reason to open code it before calling free_res. Signed-off-by: Jason Gunthorpe --- srp_daemon/srp_daemon.c | 4 ---- 1 file changed, 4 deletions(-) Noticed while looking at honli's patch.. Didn't make a PR. diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c index cec36db2e0f12e..a1798558373490 100644 --- a/srp_daemon/srp_daemon.c +++ b/srp_daemon/srp_daemon.c @@ -2074,10 +2074,6 @@ static int ibsrpdm(int argc, char *argv[]) pr_err("Querying SRP targets failed\n"); assert(res->sync_res); - pthread_mutex_lock(&res->sync_res->retry_mutex); - res->sync_res->stop_threads = 1; - pthread_cond_signal(&res->sync_res->retry_cond); - pthread_mutex_unlock(&res->sync_res->retry_mutex); free_res(res); umad_done: