From patchwork Fri Feb 25 11:24:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 12760123 X-Patchwork-Delegate: johannes@sipsolutions.net 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 6DD0DC433FE for ; Fri, 25 Feb 2022 11:25:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240107AbiBYLZ3 (ORCPT ); Fri, 25 Feb 2022 06:25:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240108AbiBYLZ0 (ORCPT ); Fri, 25 Feb 2022 06:25:26 -0500 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2068.outbound.protection.outlook.com [40.107.243.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B64811DBA97; Fri, 25 Feb 2022 03:24:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FvTp0dteQO/R5/fuvq41FnlcyCD+m9LLLPuhVrvrWoDk7y7i/FCH5Mb8zRGyTy37oaGRoH1A3TP1ExAj0UnFY+46G3BRE/pHqFduqbQKus7P5q9S79PwuT6nv6eXmu99XUAkR+s2ufU0c2TKO1kDG0V0q93ARBUPiSlYcDRsufUu9XOGMIsLXF100EYajY8HpuNQCWxtpnhzYi2VYJcVzVveZTdA9vaBxv/gVpf9w1Htbmr7ThqAbWRh/tZMX3egdCH6OnZRWV7P4+ECYuf7VsZhWJx3S4RYHKi7UlfjYlNDXsV3s7XBTx4rzMfvNGzLHBvZxOVSCcsfJ+3+3kb4MQ== 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=cPgAmOkX5sJxMaWem9w9O563KMNa+WJAEihzAKyai/c=; b=Xzb6X+UQt2gXs0nSwF+dl08tSktailfhr7dcOQ8aZ9jpL0SoJOA5X4MWnLfI/Pbnxx1YJUmoIettAGLTLtQvuOREG1+lcJ9Np7TNS9AZVNA+ml7x10H4witTnnEvG/A4Q2aUxUNZp3i7f/CUjls+n0lShOVgLDNILRBBtYTrhRje/SCD2pglF0BqpeY/hBxw4Iypym/P3f64BW5grvhLICw9an518FszNibDU9fvefNXPPnqhhifOUcgKfJkxNf3hClIwHbi6KnEXasMEky0vsEYEXry2Y5WZwcgv1HBmFVYFPyBkTv03s+ccsHOfiGBOCEOJ74ePvB+HrbpMdDypg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cPgAmOkX5sJxMaWem9w9O563KMNa+WJAEihzAKyai/c=; b=fyPnLhf5/M8AJfoWgSbKwvOMGJFuzfTBaSo5mqk4ne3EuFQJwmmlbByFFCplXEylbWb6LmyL8GktjzS5Djhz8niR0cHEA3QwZgwsLsAeRbQo/+QRTQ3APdlwkI5ech3U67pdAEGQ0Ky1QFhDBQoA+BmQtflPdmOVmTZevq+BxPo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from PH0PR11MB5657.namprd11.prod.outlook.com (2603:10b6:510:ee::19) by BN6PR11MB1428.namprd11.prod.outlook.com (2603:10b6:405:a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.24; Fri, 25 Feb 2022 11:24:48 +0000 Received: from PH0PR11MB5657.namprd11.prod.outlook.com ([fe80::dd2e:8a4e:fc77:1e66]) by PH0PR11MB5657.namprd11.prod.outlook.com ([fe80::dd2e:8a4e:fc77:1e66%5]) with mapi id 15.20.5017.023; Fri, 25 Feb 2022 11:24:48 +0000 From: Jerome Pouiller To: linux-wireless@vger.kernel.org, Kalle Valo Cc: devel@driverdev.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?b?aWxsZXI=?= Subject: [PATCH 07/10] staging: wfx: remove duplicated code in wfx_cmd_send() Date: Fri, 25 Feb 2022 12:24:02 +0100 Message-Id: <20220225112405.355599-8-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220225112405.355599-1-Jerome.Pouiller@silabs.com> References: <20220225112405.355599-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR3P189CA0052.EURP189.PROD.OUTLOOK.COM (2603:10a6:102:53::27) To PH0PR11MB5657.namprd11.prod.outlook.com (2603:10b6:510:ee::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 43e7a45a-8628-4241-6cb8-08d9f8516e71 X-MS-TrafficTypeDiagnostic: BN6PR11MB1428:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wTEU1WqzsgbmGw1BpvjM0z4lmRwqsJXEG4W3Zp86oQ2La0v70ixL6HEVZ92j2LmQtdjGugQ1sT2evV5KpADMiVRL6pZ53juADtC/kq3vINPReecHFEQQjFMXsJXIlNacjLXqfjfgu2yUV1QxWg0Vp5CD+uMPF4D3OawjsFXV4YAqZtW6/NlJo0Rpd8UvyTtqVdyCZ3oVwqQFoHEgrWjISqbNG0128YamPkyJdlDIhrCHT7sH4eor9rHThewkmxMNT3f6c/EC2+ithBIitB1nf4T0p6CI+MSOZw5BeORbIyk26Uw5EOcbqnc27+KWiyAhouMozxSL8wH9hXnh3RLsGSt05bdpxpPtelQLw69g1EY3/yrnQzdMUd40rYtRfMs/R9AN2asmYs5d0Yw+1gfi9rScsfpO6/ZniJOEMkoSICEONdNueAAm75fZr3R6ruGUczTFiemRG8A9aehjFZ+MnM8RKdPs7r9aPocOMncdwqKwxUFUGZJZzlY3ZuYvsl44dcv0izgP04/DZE9bNcCv2mKa45ylZbVoDoCPt7a9d3x9MkAa5UPpfOTaWoU6SLxyd3+QWBoZY9UmTEBPxh08IrOv0Q3pimR1Ta7zF9ORagMgdI2GWUDNNJ2xwMCb7ZFKpllnItzq1lV4cIfo5OwM5EYE9FqKSFRz89bvk0H6E5q91B/5CCUIcIxlnKlfOMoCBI/TFRuFUnkFMp6holoq0g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB5657.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(2616005)(36756003)(66574015)(107886003)(83380400001)(6506007)(6512007)(4744005)(8676002)(26005)(8936002)(2906002)(38350700002)(186003)(5660300002)(38100700002)(1076003)(508600001)(54906003)(66946007)(66556008)(6486002)(66476007)(52116002)(6916009)(86362001)(4326008)(316002)(6666004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?/GUBmEazBLsKO7rqjxwkk9OH42iR?= =?utf-8?q?xdfAwIc5eiAQ8D+J5Uj254VwLUXciHSwWZFwxbARC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jfm5NySIr?= =?utf-8?q?kzdAXL5MfQhaEHrDBQYufMIyYbhFJKOsw6IPRNj/Cccc1IrTnc2oyh9gRuC4Y22Qm?= =?utf-8?q?36HTALwCji/ea51GoVs+cNPSBDmtIvPcgVV5awCPLAJldR1z4BbLAikHbLkIPd4zr?= =?utf-8?q?MncZalL2wi+9wR6hTrmVq4a8F6iO/pmOuAsFS8/VHxvyyHYA6qCqQ29pII7hW+ynV?= =?utf-8?q?20e7wSvLZSa54CzHsZKlI/Z5hFXQAOH9MiBVGg+g/zm0ndIotTM6im9nAiekY8kRa?= =?utf-8?q?aT/ZEUzH4f3ckxjbpqCUH9mT/WAG0ihbVjOJj+kLSPkj9WgQRvQ+nRdqaC2ULG8tz?= =?utf-8?q?grzS18wzlcSWnhI3sC5rhKlqIx7n7k/BZGnjPKki6DwuZ4ZAkUKpwq/VfEPDGOnmi?= =?utf-8?q?NNVRPLolzn7sFw6rH8zMI+x2tGXr4zgutwcwu5rh4ggA/Xqxug+3gJ06Bmwp1ujFk?= =?utf-8?q?8yDwET1D53FOkR65K5ky60uPWGCyyT5k5rg4EkLlGivJtUHzW6ng13lYEqHxdkJo+?= =?utf-8?q?yEyzXfLa3JMeO/7LIzVtEJUbWRePqBnBUfLJnhY8KHdg8HrHVCQuTUQ+oZiXr95u/?= =?utf-8?q?Gs+EwaoCvPEZCrUHkLw5W649sAZQcWGJyFW572Cn/KPYuUYmFbgiYWE=3D?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43e7a45a-8628-4241-6cb8-08d9f8516e71 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5657.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 11:24:47.9695 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5jIB1XFM3XD5FOZL6SGWh0abpZd5nNzaOjsy4GseNf7qejiavaIYzY8qD9PL0GnsIdiwuPDDtJdZHJLoFC/YRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1428 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The code to execute on end of the function is the same whatever the command replies or not. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 236f9d62e3a9..0b1ed12c0e83 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -74,9 +74,8 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request, if (no_reply) { /* Chip won't reply. Give enough time to the wq to send the buffer. */ msleep(100); - wdev->hif_cmd.buf_send = NULL; - mutex_unlock(&wdev->hif_cmd.lock); - return 0; + ret = 0; + goto end; } if (wdev->poll_irq) @@ -98,6 +97,7 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request, ret = wdev->hif_cmd.ret; } +end: wdev->hif_cmd.buf_send = NULL; mutex_unlock(&wdev->hif_cmd.lock);