Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp2074103ybj; Wed, 6 May 2020 10:08:00 -0700 (PDT) X-Google-Smtp-Source: APiQypI2Bu9k/pX77kl8m0tO+ZLE5cENT0K3QbYlwwoNU4a/Qs3RCSLntJEdIivtSNczlXocgORo X-Received: by 2002:a05:6402:221b:: with SMTP id cq27mr8261740edb.65.1588784879893; Wed, 06 May 2020 10:07:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588784879; cv=none; d=google.com; s=arc-20160816; b=Ohp7B+XErFzQ0PgPxtcYOmj5/3SHLC7w6GiFBZbrvzpvJDUCRCJM+d1vETC87REkqX bdbUd0+tYb26uWTlhgeJYzNT4WoQN6ykj2aFSiff6wR9jEFzE3GRsWkbD6AwfFBIuIS2 k0UDcg6FpR//iXV35s1uqLUQS4VBqTCtUda5IdwKmI46qVqsPCfmIAp3x5bN7ry+VXD3 +7lCJUQ91JDw+kpm/nSxFHpstBHj75M4mmGVpXLulNwkagNKZPrx7WGYlCCdWFCO5Xmq 1GZvIH343Fsw9XTlZbrO/VaPCzxzUHU+2afMx7nyHyA5wxK2cor4Lp8FUsO4hwKl77MA DZgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DMnyBszh3UeqCW7qnMo/FE+1JsfaybooXYVovwSgOU0=; b=rMl2YTdn2oF40KhpDUWf7YRoLFBuzOwUFj4otK9VbEDJtpCELy37T4/VAYrV3VYCvd RDGeSZ91NCb+Bry7+JFj5ae49AT0RMCPH20D0KLA8ugBtZRwxz1Fvf6FmvkCSDJ3BnZE txXExaND1OtTmCFSjn2c3JuZRcAFV85mmomprg3UpGlQpi4J6Q5izTDe5Lnd8oUTfgTI xb+PZA20sfvUGxQvry0tFhRXjsAdguXVnVn+GnFDtKhyL/FiqpR5be84IQiN0F7lKBRV ylKrfuaA/jJL/DSXS0DZs7OtysymX+ir3FUu5XEwGhGVl508YPx4kuMxxVW8h+twdbt1 IVCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wjhas/C5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id b14si1328622edf.212.2020.05.06.10.07.34; Wed, 06 May 2020 10:07:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wjhas/C5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1730071AbgEFRFg (ORCPT + 99 others); Wed, 6 May 2020 13:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729414AbgEFRFf (ORCPT ); Wed, 6 May 2020 13:05:35 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E52CC061A0F for ; Wed, 6 May 2020 10:05:34 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id s20so751886plp.6 for ; Wed, 06 May 2020 10:05:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DMnyBszh3UeqCW7qnMo/FE+1JsfaybooXYVovwSgOU0=; b=wjhas/C5XrWq/GRzJ4L46JpN7TUl0HXRUyZEsSzcWYeqGm9ZWRwPt0cEIEw0dCoSdb Iw0vL4CDm9Epsb/REyfTG9hBsoSsTZKoEQyF69k4zEFXVBGhIid6m/jF5dgZYRAAWSI/ C5R39aUHUdZIbMP33F9OlS6WodCxw1qsn2vPWDvmDY8FIwxBqRUuIZpYMrUzS3W9oON4 qM8qoDs5UKsVV4xib4qu8XVUgue+qyZFoBKZV0WTvxnACEMi+AxAaZfN36t2ZXjiN7R7 iGqwNP0ZfXeq/S52cO2caUXfiPCWnuisC0/nydPMT6OHOufwNh4qUVvnyeC8+3wyt1Vl HR6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=DMnyBszh3UeqCW7qnMo/FE+1JsfaybooXYVovwSgOU0=; b=MEockjP5Jo3/w9/GP+r+K6J6+2yngJYNhMQhWBLjsKm1DrbgGoERMO0T+o6eC0gyIs Rm/nM7E36ljb6i1a4aZXtdRjQUCRuVNxbuX31bSxDZH16YwFQTU8Ka8IpiYg8wHKB+Yn zs22kQYp5IXwwpNh8+D4OaGNpUiCRVsm/OTY731sbOnJcfmAY2kWGAclGcC2zgDFyvLp rUtOVfAMc2XMkCSxOBnaMk8vJGo2AaVOVMP0Ev8WggG2oTuu06IY7lDp7NDwLq3JUK+i 7emeWZRhzDSdsp/p0d98br7kUGQsZBEb35ZD/NKjaYo9iOJZm818KB7UvvgJ5iBfLlDP j2pw== X-Gm-Message-State: AGi0PuamtbRv2C+lO1LPvx2Y9+Puley+VEC7NExln3L+WHSiO6zdEjfD OxqE1sIgES12fFVq38TkyZFa9A== X-Received: by 2002:a17:902:23:: with SMTP id 32mr9150743pla.40.1588784733779; Wed, 06 May 2020 10:05:33 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id b16sm2312057pfp.89.2020.05.06.10.05.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2020 10:05:33 -0700 (PDT) Date: Wed, 6 May 2020 11:05:31 -0600 From: Mathieu Poirier To: Calvin Johnson Cc: Mike Leach , linux.cj@gmail.com, Alexander Shishkin , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] coresight: cti: remove incorrect NULL return check Message-ID: <20200506170531.GA29826@xps15> References: <20200505134020.11148-1-calvin.johnson@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200505134020.11148-1-calvin.johnson@oss.nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 05, 2020 at 07:10:20PM +0530, Calvin Johnson wrote: > fwnode_find_reference() doesn't return NULL and hence that check > should be avoided. > > Signed-off-by: Calvin Johnson > --- > > drivers/hwtracing/coresight/coresight-cti-platform.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers/hwtracing/coresight/coresight-cti-platform.c > index b44d83142b62..2fdaeec80ee5 100644 > --- a/drivers/hwtracing/coresight/coresight-cti-platform.c > +++ b/drivers/hwtracing/coresight/coresight-cti-platform.c > @@ -120,7 +120,7 @@ static int cti_plat_create_v8_etm_connection(struct device *dev, > > /* Can optionally have an etm node - return if not */ > cs_fwnode = fwnode_find_reference(root_fwnode, CTI_DT_CSDEV_ASSOC, 0); > - if (IS_ERR_OR_NULL(cs_fwnode)) > + if (IS_ERR(cs_fwnode)) > return 0; > > /* allocate memory */ > @@ -393,7 +393,7 @@ static int cti_plat_create_connection(struct device *dev, > /* associated device ? */ > cs_fwnode = fwnode_find_reference(fwnode, > CTI_DT_CSDEV_ASSOC, 0); > - if (!IS_ERR_OR_NULL(cs_fwnode)) { > + if (!IS_ERR(cs_fwnode)) { > assoc_name = cti_plat_get_csdev_or_node_name(cs_fwnode, > &csdev); You are correct. Reviewed-by: Mathieu Poirier Greg, can you pick this up as a fix for 5.7? Thanks, Mathieu > fwnode_handle_put(cs_fwnode); > -- > 2.17.1 >