Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2954156imm; Sun, 16 Sep 2018 06:41:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYrfxmGQJezOeLKQAE54RrMTEX9OYPaDIS9ZSf7w84Wdm2m+Sb7m3AqVf6SbkWquHsoluSM X-Received: by 2002:a63:fa0c:: with SMTP id y12-v6mr20107338pgh.177.1537105309868; Sun, 16 Sep 2018 06:41:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537105309; cv=none; d=google.com; s=arc-20160816; b=UmPoli1HEvUn8lbJKLMQp4MIirvQ9pKbRvK/3n2B8AiV/JO62yXT9R6Ilw+qB8+uoX +BhRgCZPo74JTSVUH5v/k09E1NBdC9NkcE8xZrtnouLOQcbjijJNKp5GtNJju2t5+zgl Gxvif70iFLD/EapI6fWengxP2n1Lvlmr0wS1V0PDhzXWJ3Zd4oV8PRgWP+dY+lbYbRjC nwEKak9hoXw2XE9yBOqE5lfxEnJiaSt+D9P7OgLvyQzdWt0GW4Hmzx581Wvq1UycaO/+ ENc8f1dFMUBe5GDjivLpAvlVXRcj63gQ/PNXzNeElHFsEZMgw4FPv7FsI/+PWMVcotpr HLhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=noaTs/8w4AT7StO94KojGBTOPWd/7pHyL4nPuCLSxLM=; b=cep2SblGbgOmaMWctvKsKq51KsYQJxuTI9mEKg/nuu2LXBWNE9bmR5YtmekF5E9JL6 tIgmcsfJJALaxMa0FDEBORmOxBqxR8irHxtjWGMOqvYyNFDnYUbH7cmxtlCNsEv8xhov V3fClSCHSUtjXSNpoDmG3K7BDVU3fFiUvJV/qZQnTXxBrrAuPRnnOqRiquPYXgSv9+6a Ls4YWydsU0besDFtma6jvdfnVIkPULs4rA7FC2IYoOZjFhJHUDrN8dFLTr2oxiE89VGi CAYP3Gnxe/MrTomf9uJH8eJNaQk1C7ut7QP+8JOhG0PJ6uRdRTUwoUU1jun3AxKGt610 I4zQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 f18-v6si12454950pgi.300.2018.09.16.06.41.34; Sun, 16 Sep 2018 06:41:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728505AbeIPTE1 (ORCPT + 99 others); Sun, 16 Sep 2018 15:04:27 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:52368 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728433AbeIPTE1 (ORCPT ); Sun, 16 Sep 2018 15:04:27 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 5AC3B28F9DA9; Sun, 16 Sep 2018 21:41:22 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.399.0; Sun, 16 Sep 2018 21:41:22 +0800 From: zhong jiang To: , CC: , Subject: [PATCH] hwtracing: coresight: remove redundant null pointer check before of_node_put and put_device Date: Sun, 16 Sep 2018 21:29:04 +0800 Message-ID: <1537104544-64355-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org of_node_put and put_device has taken the null pointer check into account. So it is safe to remove the duplicated check. Signed-off-by: zhong jiang --- drivers/hwtracing/coresight/of_coresight.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c index da71c97..89092f8 100644 --- a/drivers/hwtracing/coresight/of_coresight.c +++ b/drivers/hwtracing/coresight/of_coresight.c @@ -219,12 +219,9 @@ static int of_coresight_parse_endpoint(struct device *dev, ret = 1; } while (0); - if (rparent) - of_node_put(rparent); - if (rep) - of_node_put(rep); - if (rdev) - put_device(rdev); + of_node_put(rparent); + of_node_put(rep); + put_device(rdev); return ret; } -- 1.7.12.4