From patchwork Wed May 9 17:07:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 135322 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp5359lji; Wed, 9 May 2018 10:12:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoKk66w2Qlz19ABk+rj10Pp1FLv3hRjcPS7D/LkEFurRqsIqniX/hQnlN42Mhmah2jO9C1f X-Received: by 10.98.100.2 with SMTP id y2mr31160868pfb.71.1525885974918; Wed, 09 May 2018 10:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525885974; cv=none; d=google.com; s=arc-20160816; b=vm7N+5+NeseHENTn36dMGKvo07PmpbBBqKgZ9mYnEYnx/DnA6ubPPLIm/m6IJwGY3Y ulodj35ZdwYNEiJi6eYaROkIIz0YAZOiwzie7wUb/CSbb3B3hnULCJh9RO3+ElCrnwEr xOGs5pXttu/Bn8OEzaE8/KcLwODYn6bMhfGCGMG6gjVKPf13oK9BjItP6Tyd6GBQRyrj 2tHoObwSn/n0MW6Qphh3OXy+Ja4voXOH6qZ6znc7QbbBXgzVnaNpIaLuqIcIhjzS3bwd S3C9FRlOnB20kmVtNKKwGmeq8hVuQyQ9cSaYuXmdyYY0CTYZYTnMUwjj9RmaMet1i0dW 1mcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=RNd+8DxKVBWAiBqb9CX3ggAH3luC+yR7GJDmxGfQGsM=; b=Sd5acT/zI/x+hf/W8ohCt2GDZpk1kbR6c0x8ZPe1BVFeszPbVgswkY3uUn/n5reI7h VnE3nSYZA4ixSQAkMJGzJwyZ16RfL6PTTkq4KJIgZExN97Xw/PchMqFh4029lsuheRBj yIcvZeqJdE/lGRi9nTyHi6kBChZ9QmJ/f0Yhz6DmqDNHAxba2VMDulSsbHfT+Sle2afA DAtecpp8SRIBFcgTYPoM9ByxK6+gwCJjiguiPWVirMCFxVOl2whHL75KaElESTWdUeTY FCWhYh8NVQ2KMsbpP5Ru7JzWhedJeFeIJ7vCJEatjk4NY7iIprrajG6roNJyvhmVvKw7 guXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j33-v6si16858745pld.151.2018.05.09.10.12.54; Wed, 09 May 2018 10:12:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965706AbeEIRMy (ORCPT + 10 others); Wed, 9 May 2018 13:12:54 -0400 Received: from foss.arm.com ([217.140.101.70]:47336 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965594AbeEIRMx (ORCPT ); Wed, 9 May 2018 13:12:53 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 691F6168F; Wed, 9 May 2018 10:12:53 -0700 (PDT) Received: from e107155-lin.cambridge.arm.com (unknown [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 755213F592; Wed, 9 May 2018 10:12:52 -0700 (PDT) From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org, Jonathan Cameron Cc: Sudeep Holla , linux-pm@vger.kernel.org Subject: [PATCH 8/8] firmware: arm_scmi: simplify exit path by returning on error Date: Wed, 9 May 2018 18:07:14 +0100 Message-Id: <1525885634-22348-9-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525885634-22348-1-git-send-email-sudeep.holla@arm.com> References: <1525885634-22348-1-git-send-email-sudeep.holla@arm.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Yet another nasty indentation left out during code restructuring. It's must simpler to return on error instead of having unnecessary indentation. Suggested-by: Jonathan Cameron Signed-off-by: Sudeep Holla --- drivers/firmware/arm_scmi/driver.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.7.4 Reviewed-by: Jonathan Cameron diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 4087d6c50ecd..e996395af5f2 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -687,11 +687,12 @@ static int scmi_remove(struct platform_device *pdev) list_del(&info->node); mutex_unlock(&scmi_list_mutex); - if (!ret) { - /* Safe to free channels since no more users */ - ret = idr_for_each(idr, scmi_mbox_free_channel, idr); - idr_destroy(&info->tx_idr); - } + if (ret) + return ret; + + /* Safe to free channels since no more users */ + ret = idr_for_each(idr, scmi_mbox_free_channel, idr); + idr_destroy(&info->tx_idr); return ret; }