Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp496825imw; Fri, 15 Jul 2022 07:20:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uFaDXb/6Jby65Lctbw3v3G1JG6YWi7Lru7wRS0xkTBr6wS1qG6qPb3BTC6FD6TJQRJwhTK X-Received: by 2002:a17:906:4788:b0:72e:e3fe:1772 with SMTP id cw8-20020a170906478800b0072ee3fe1772mr6614940ejc.317.1657894837484; Fri, 15 Jul 2022 07:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657894837; cv=none; d=google.com; s=arc-20160816; b=ZXc52exAMn683gB7iqq23UFTJIl0tnkPpADu18eC8iun/c0mAwxWIp0zBd9vqojLs3 R9WbESs9+WNt8nukL0m/NPffRKt90znYGnL2W8jcu7lnWpLTGZNk+F/KOUHGZ+/ivX1F /UJvzHSsotacGlwvvcsPcF9H+FxudIbuN42RSSz2+DKRkjd4ufQYg6gAO7A7Pum/toMl 794yGWf1kUIDRKiLriPkHKdllYD34Lyn0CPtMfFZayIqClsXs5c0kzQ/49nn1Kza7nCy isyHzdB5kSJnD5u5EkmV6/GBW9C53/R32HhI57Qx0wo40jTByVaf3thalcvvJJx9b96D 3aNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=x7B0/5LahJaY8GhTAUCPfeByQmd1tIrbv9+ecGfwPMM=; b=Sw0/KtBorSUvPwfOn+JCYyAreoRsqiohhwY1M8a6prKq9tKzAmWGobvaQPAeZd+nCL KZKnmVEdR5Hy66rtIB805Hc3/K4o2yredVqCuGi2AXr+7EvJ/uO65clVCGlchTmAb8/h 4B4Zwo3cxrAxXagcqJCXLLKUfQ/Ca3xe7sY42EIIGP28+ZBscUoMQKXXXQnsabvkLwkS ByhrcIeCOhRVaMVvZ3bRYlsC0MjFRewV+A2buL9w17TZj3vSE5bW+r5vg5VWqhx3rNIE LKzRw5LEDha0mt50HxhFCxdflXSUmfQDl8jjSSoLOSJh4FO3Z85UTmBr6Cl9wJ23vEM6 YG2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x2-20020a05640225c200b004356a5f330fsi5378187edb.445.2022.07.15.07.20.11; Fri, 15 Jul 2022 07:20:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232699AbiGOOD3 (ORCPT + 99 others); Fri, 15 Jul 2022 10:03:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233202AbiGOODW (ORCPT ); Fri, 15 Jul 2022 10:03:22 -0400 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1F316465 for ; Fri, 15 Jul 2022 07:03:20 -0700 (PDT) Received: from ramsan.of.borg ([84.195.186.194]) by albert.telenet-ops.be with bizsmtp id vS3K270064C55Sk06S3KUy; Fri, 15 Jul 2022 16:03:19 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oCLuY-003gpg-KX; Fri, 15 Jul 2022 16:03:18 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oCLuY-00EDeq-5w; Fri, 15 Jul 2022 16:03:18 +0200 From: Geert Uytterhoeven To: Pantelis Antoniou , Frank Rowand , Rob Herring Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 2/2] of: overlay: Simplify of_overlay_fdt_apply() tail Date: Fri, 15 Jul 2022 16:03:15 +0200 Message-Id: <6a3357a8f7f29704350e3ffae768ee8a462b54d3.1657893306.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It does not hurt to fill in the changeset id while the mutex is still held. After doing so, the function tails for the success and failure cases become identical, so they can be unified. Signed-off-by: Geert Uytterhoeven --- drivers/of/overlay.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 84a8d402009cb3b2..bd8ff4df723da217 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -1043,20 +1043,15 @@ int of_overlay_fdt_apply(const void *overlay_fdt, u32 overlay_fdt_size, * goto err_free_ovcs. Instead, the caller of of_overlay_fdt_apply() * can call of_overlay_remove(); */ - - mutex_unlock(&of_mutex); - of_overlay_mutex_unlock(); - *ret_ovcs_id = ovcs->id; - - return ret; + goto out_unlock; err_free_ovcs: free_overlay_changeset(ovcs); +out_unlock: mutex_unlock(&of_mutex); of_overlay_mutex_unlock(); - return ret; } EXPORT_SYMBOL_GPL(of_overlay_fdt_apply); -- 2.25.1