From patchwork Thu Sep 20 19:18:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 147159 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2376953ljw; Thu, 20 Sep 2018 12:19:32 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYiCcGorQ+aSeE1miinKynZPlN8ZRu+h0XEoXKMF2rx/ySczB9duDTWvV0mjG4yP1bspmzm X-Received: by 2002:a17:902:c85:: with SMTP id 5-v6mr40953582plt.141.1537471172680; Thu, 20 Sep 2018 12:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537471172; cv=none; d=google.com; s=arc-20160816; b=R+uTPm50lFJYpex5Ce5nj7agZBT4xuwvL4trcJh13xq0q5vhtGtsqdtN74vXQG5anp 26LHomrKIZPssZj6kcMyE0ASOQitHU+8FK89SLm91XRUzOILHNSx8Euj4/u5yxmPgsPw +lpO2RqYOiLA+w+w2RdSSGKDLGxpnF56WH9l+WbaTozR7slIjZ22LbDIv35OCoFhRSnt WW1B4hI920pQzKAYfXapAw0GWBil22ze1651b0YViL5NG7my7SBvBT282z7gvjNbZMxg aZ0Gqva5K5aGguOtOlKUbA23qZjJrRzUms0hEIKfqtYnD9TvV2OwoewifPcg9b07OcbV Et2Q== 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:dkim-signature; bh=dnhE0czpJg+XaiFH4BtekxN9pZR1jCXAxiDs2QAUsmg=; b=qqS0OywJl3gBHBDEjq+JICWujW3eA12XShar+TbIhES49UbHNVMgX9LIbX6eDb9spZ HkewKozc2iZJXIcgiJHEJW06+JNUb3NBJvIhhXXzpvZxkFDt5bKPP0ymAjx2ppLUJgC7 RSaFS6sliGA6EQ3iNfpMwO1hKxADnCM4IZMj2kNk+jFDM7kYwO8Y6ksfPhCoZPmAgCu4 2g+hd9N2ucu8qiJgP95sbpvPanbTPdzL5adR7JBBlWLgXR+KLYOe1lbexvEpFDumsM1y 4QN9/ZK4FIDGLiRtW5fsRkZMeynRk5mkUdkJh2qw40vt3p+6xiT03r/KSgSEvx6bGMAf gKrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SOxHja3K; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t23-v6si24177676pgi.301.2018.09.20.12.19.32; Thu, 20 Sep 2018 12:19:32 -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; dkim=pass header.i=@linaro.org header.s=google header.b=SOxHja3K; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389148AbeIUBE2 (ORCPT + 32 others); Thu, 20 Sep 2018 21:04:28 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:40019 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389132AbeIUBE1 (ORCPT ); Thu, 20 Sep 2018 21:04:27 -0400 Received: by mail-pg1-f194.google.com with SMTP id l63-v6so4875993pga.7 for ; Thu, 20 Sep 2018 12:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dnhE0czpJg+XaiFH4BtekxN9pZR1jCXAxiDs2QAUsmg=; b=SOxHja3KB1sWY9dO4lXhpAwTuwns7vus5Er6PolPLyezj4thRF2NKl4IdI3nLbUrxO 99GIXd7NOO9EEPe2j1Ww5pcnow5Y1pB29B5y/rlZRGGSoiFFfFbgUTgH2Fi18wQ1anwT 1SdOEZVke2l/pO9NTnRc08LVGOqAx1npStToM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dnhE0czpJg+XaiFH4BtekxN9pZR1jCXAxiDs2QAUsmg=; b=QQ1uA2G3bCncuBBwb5mhZ9h64zXQUReihcbUFZ7wfaW+XYBTl5WtWZdXmsAKvKrey4 NlRZeFUKLRl/KzWGHRk2NFBHZFLWkIxrKG8AJj9Yo/2QU/NaXq2dGoM9eBbwDXf3lU+B gC2zTsSih0iXwQ9DSh+q1yTri3D0cofrTha2/u7NFa+KbLx7BYRsz0xhe+nz9/qoAELF hbA4B3X+4QqzG44lTXkYvQmkqOMkN8mLV8rSbc8cqK4n8NQcfVzn7H3laTe9cSdOipIv /zsWs0mICA17LU8dDKpl5yFpiEOEH0NaVEIP0rPc4fr+Un14WZYUdlxLe4A8b0PewU4X Pu1A== X-Gm-Message-State: APzg51AgzyEEAbRB6mukHYI3mhpU3ThgKAatCag+lI8LotetVNa5H5f8 1IsbRo6miy6skK76I5i1LYwyZg== X-Received: by 2002:a63:6d4f:: with SMTP id i76-v6mr37804491pgc.215.1537471168725; Thu, 20 Sep 2018 12:19:28 -0700 (PDT) Received: from localhost.localdomain ([209.121.128.187]) by smtp.gmail.com with ESMTPSA id k13-v6sm4424443pgf.37.2018.09.20.12.19.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Sep 2018 12:19:27 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 44/44] coresight: Remove redundant null pointer check before of_node_put and put_device Date: Thu, 20 Sep 2018 13:18:19 -0600 Message-Id: <1537471099-19781-45-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537471099-19781-1-git-send-email-mathieu.poirier@linaro.org> References: <1537471099-19781-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: zhong jiang 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 Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/of_coresight.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/of_coresight.c b/drivers/hwtracing/coresight/of_coresight.c index da71c975e3f7..89092f83567e 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; }