Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp513542lqd; Wed, 24 Apr 2024 08:53:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXhz9PHhrLtkXvCb77I4wx1vn0tLBWVngLus3MA4Oby8k6RNyaErPOGIMImpQFc1Ysi7Ax9XVNcm9eCqHYrAIQW7715VHgNqQwmgGYruQ== X-Google-Smtp-Source: AGHT+IGIDgmoztpYMhTaMv/hWHbL33reI7vwA7h9ANCQy/rGkCvBjwlZwUGr/BzQ49aPC50LEPoY X-Received: by 2002:a05:6214:18ee:b0:69b:6c70:320d with SMTP id ep14-20020a05621418ee00b0069b6c70320dmr2993122qvb.29.1713974006700; Wed, 24 Apr 2024 08:53:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713974006; cv=pass; d=google.com; s=arc-20160816; b=NM46n4EIYVabjl0VtYkDNUfZBtWOw3br5xuOvMsfdiHAIrA0dGXadTXAa/V1iZJAwm v8JOi1bNxdg7J8CAIOp4J2h55rEPaWw/gZP5O7WvzZ7JfSMGqVO9B13NTVkCkbmPx6Op dZSVWKY8lyvXbuQ4S172/X8n0vPIUtLN83UgDaMfLb5QgfrbmQV5fawjS4V5dpLFXmUy hsS0oIHbIyhLupCbeQlvs4JoXjmahmracsyhCCCdaei0iyYelklbcl8ZtstnCWGV3sUQ d7TIwMzB7ejYAiGAGHeGVSN03eHOmOt4f4+xI4ASXs0OKlX02UZ8gmDDIFZmdZzZtbAs otXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=ftXnsPSZLyxzBX6y9zrQI2b1BQnFkKGEUUZovNgivag=; fh=0HwL9iuwwkcI1hMxndPlwS5ny56RE2RPnC+1tMszjmU=; b=tJqoLAFfOxZmF//hIJf13/G7jp5Q71T/ZUoY8PbTd4NQE1X9/y7wEN2KzqlsUo0Tz2 BEHDKGXftajsgA3m8AFGNOU1ZRF4EaTbtj44sIlxkIjK4XSJvYxDPmL4QvawnOcQCTsy dtjXBrTUhctILWQ/LRZLDMakFpe6rDO+4aWkh7lsaV3S0d0lPg2NS/cjWKzGQ+8ABObW hmtiQ1GG6It7i+idSWX9LySMSp6EhfH3c9GxQAxXCPL9M+RqStXPUy+SA9ZcnuPANW6Y Cd5mGhDO/4glDbGxCvf/GLej+pMf8lJrHsbbxoErqFw9ul98JV8asRfRLsd5y0lv4vji 5Rlw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-157252-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157252-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e11-20020ad442ab000000b006a07edd8e83si7048876qvr.111.2024.04.24.08.53.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 08:53:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157252-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-157252-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157252-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6D4891C21732 for ; Wed, 24 Apr 2024 15:53:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E30E16130D; Wed, 24 Apr 2024 15:53:14 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4FF6313DBB2; Wed, 24 Apr 2024 15:53:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713973993; cv=none; b=shpI6HKoTwnRdA6pb+NgWa5CMjFvGGAlswLqbYKTOXvdhPTxr+yA7r7cdqCDCvyU+DZpGPYb7p7nyjRAMfJhI07GmAgku2SwyQt1lQTENQ8MAUV6iHgp0fs/brEsMR++2JC4MsfWYhsV18BIp7cBMTfbg+UcW9lbJ5MVJpjksRI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713973993; c=relaxed/simple; bh=cqQlTJYlnxpdMp1tQKkUwfXxp9N7FIOvRmzCX75X7js=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LlpxOscILPTWY2s9vNkcCHF2ImJbJMwV48J7ju6t8kJESXBhfdhguXx3I6xh4lSxbKJz7BkE2ongSAM0PAjrB481lfuY7FuCw9PSXT2fdm8eiV+PrU4lFLA0INuV17u7MCBc4k4tln+kX5WogFfh5eGHRI9nEXrXIJRwPh2Y8Gc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 709531063; Wed, 24 Apr 2024 08:53:39 -0700 (PDT) Received: from donnerap.manchester.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1D0143F73F; Wed, 24 Apr 2024 08:53:10 -0700 (PDT) Date: Wed, 24 Apr 2024 16:53:07 +0100 From: Andre Przywara To: Dan Carpenter Cc: Yangtao Li , "Rafael J. Wysocki" , Viresh Kumar , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] cpufreq: sun50i: fix error returns in dt_has_supported_hw() Message-ID: <20240424165307.16f45b21@donnerap.manchester.arm.com> In-Reply-To: <9bfe5703-b39b-4d98-9995-f6a7d0ea558d@moroto.mountain> References: <9bfe5703-b39b-4d98-9995-f6a7d0ea558d@moroto.mountain> Organization: ARM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 24 Apr 2024 14:40:11 +0300 Dan Carpenter wrote: Hi Dan, thanks for having a look! > The dt_has_supported_hw() function returns type bool. That means these > negative error codes are cast to true but the function should return > false instead. Ouch, of course! I refactored the function during development, but missed that part. > Fixes: fa5aec9561cf ("cpufreq: sun50i: Add support for opp_supported_hw") > Signed-off-by: Dan Carpenter Reviewed-by: Andre Przywara Thanks, Andre > --- > drivers/cpufreq/sun50i-cpufreq-nvmem.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c > index cd50cea16a87..0b882765cd66 100644 > --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c > +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c > @@ -136,11 +136,11 @@ static bool dt_has_supported_hw(void) > > cpu_dev = get_cpu_device(0); > if (!cpu_dev) > - return -ENODEV; > + return false; > > np = dev_pm_opp_of_get_opp_desc_node(cpu_dev); > if (!np) > - return -ENOENT; > + return false; > > for_each_child_of_node(np, opp) { > if (of_find_property(opp, "opp-supported-hw", NULL)) {