Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8013544rwi; Tue, 25 Oct 2022 01:00:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6wciVTn24nbaUnUTJoFSEAta4xeYoujj93kHqEFg3KgIrZ89sXn0/0zqLCgu9rSzi4+bte X-Received: by 2002:a17:902:7297:b0:17f:93b5:5ecc with SMTP id d23-20020a170902729700b0017f93b55eccmr37068425pll.93.1666684828549; Tue, 25 Oct 2022 01:00:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666684828; cv=none; d=google.com; s=arc-20160816; b=QH5Jz4ac9RwAHs3WaclOUhZveIyfmQXqlTVJu0kQKtTJ0fccbtAcFwuxPqk8qtyeqA iWwckte0eWO4bvBmjOe8QKgrYipyOEilm6XrqJVLT3AZH8RPUXFceOomRaZfQ5mVBygZ 15QAnbdAncxRVdxL7zoxcSCu8Q4OT56JLn2AwCoLEYTWHzkQKePVnBsSC95siNb4CRfm nZRP8+po2E5FZ9qG66vF5hqOs8mG3SjI0zxRWdez+VfFoKT6OvLCBtQFBG5krV6MWsxs Y7uHEkQLZQqKM0uoo7h9031APUjpU7boGkbIKn050v1TZd2FCIbupmKgdH3AisTum5SA bV3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DmDitG+f043jiqfYTkgVY+6vxeryJ4J7YVMBi15obUU=; b=CcCI4drDTslJ1hNq0ZFULsiwz4I1OACcoea9vJROObLA0BIQiGh21p6mcGNE+a4yFa 4TNIXV+m9zJMcqaB/wj7BBoZJaPTQI0XbaSkosnGPvFCOPqZOUbba2iFoZLCskvCWEEY l8X3fypkMODclHVrqMnOrcDNFnO5mdDb31myJI017ZSPtbzp0FaMZ35SnbZF/gzESjeD WeaW/hZHErLp0d0a2WuLV+kweq6bunRYOZWKpAZxcNtw+JGxK/sNxEFUGG9vMskaYAhG sRg6eyObt9e5O1aMtIvaqLw9mu+zpoPDpowIKC1juAKxqk2xNhCyE3MVKYPn/4afyDfQ +FbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="eXx/kyVD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k2-20020a637b42000000b0046ec76d7a09si2006001pgn.665.2022.10.25.01.00.15; Tue, 25 Oct 2022 01:00:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="eXx/kyVD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229728AbiJYHmZ (ORCPT + 99 others); Tue, 25 Oct 2022 03:42:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229904AbiJYHmX (ORCPT ); Tue, 25 Oct 2022 03:42:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FA25125006; Tue, 25 Oct 2022 00:42:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E4B41617AE; Tue, 25 Oct 2022 07:42:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9D72C433C1; Tue, 25 Oct 2022 07:42:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666683739; bh=zxG5HvFqvSy/jj2wpG+6bL8WmIEHT5MAz/zH7+6erTw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eXx/kyVDR12odMvbC16zp2HK7cndAMplDsjGUTK7pW3MMfI1vNOqSMg5L9AG1bvjK /15cQrJHaBpniMZoBaSLWq5pXv6GwozpZaxcJjfF9mQxYIOKaoiD8dOP7h0kHA7Kjo Ylvma8OiLqgLAgnRz9b+0WHtnLLfdbWnahnyB/QM= Date: Tue, 25 Oct 2022 09:43:11 +0200 From: Greg Kroah-Hartman To: Matti Vaittinen Cc: Sakari Ailus , Matti Vaittinen , Andy Shevchenko , Daniel Scally , Heikki Krogerus , "Rafael J. Wysocki" , Wolfram Sang , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers: fwnode: fix fwnode_irq_get_byname() kerneldoc Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 25, 2022 at 10:17:21AM +0300, Matti Vaittinen wrote: > ti 25. lokak. 2022 klo 10.06 Matti Vaittinen > (mazziesaccount@gmail.com) kirjoitti: > > > > Hi Sakari, > > > > On 10/25/22 09:48, Sakari Ailus wrote: > > > Moi, > > > > > > On Tue, Oct 25, 2022 at 08:24:24AM +0300, Matti Vaittinen wrote: > > >> The fwnode_irq_get_byname() may return zero on device-tree mapping > > >> error. Fix documentation to reflect this as current documentation > > >> suggests check: > > >> > > >> if (ret < 0) > > >> is enough to detect the errors. This is not the case. > > >> > > >> Add zero as a return value indicating error. > > >> > > >> Fixes: ca0acb511c21 ("device property: Add fwnode_irq_get_byname") > > >> Suggested-by: Andy Shevchenko > > >> Signed-off-by: Matti Vaittinen > > >> --- > > >> drivers/base/property.c | 2 +- > > >> 1 file changed, 1 insertion(+), 1 deletion(-) > > >> > > >> diff --git a/drivers/base/property.c b/drivers/base/property.c > > >> index 4d6278a84868..df437d10aa08 100644 > > >> --- a/drivers/base/property.c > > >> +++ b/drivers/base/property.c > > >> @@ -960,7 +960,7 @@ EXPORT_SYMBOL(fwnode_irq_get); > > >> * string. > > >> * > > >> * Return: > > >> - * Linux IRQ number on success, or negative errno otherwise. > > >> + * Linux IRQ number on success, zero or negative errno otherwise. > > > > > > I wonder if it would be possible instead to always return a negative error > > > code on error. Returning zero on error is really unconventional and can be > > > expected to be a source of bugs. > > > > Agree, and I did also consider just adding: > > > > if (!ret) > > return -EINVAL; (or another feasible errno) > > > > return ret; > > > > at the end of the fwnode_irq_get_byname(). > > > > However, such a functional change would require auditing the existing > > callers which I have no time right now. > > Oh. I just did grep the callers. It seems to me that there are only a > handful of callers in 6.1-rc2. Auditing those does not seem like a big > task after all. So I guess I can check them if changing the return > value is preferred. Yes, please do so. thanks, greg k-h