From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E453C433F5 for ; Wed, 16 Feb 2022 09:28:18 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C0A8C1917; Wed, 16 Feb 2022 10:27:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C0A8C1917 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1645003696; bh=iMfir8Hys8PoRkg7XbbXRj39pNMes8hLErnltaIltH8=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=a13xKvF6hoSFgyRQs30cRuwiECAD6yqKHPkawa0eEi1qI4Ubq2DfNDE2e+aDBqw2f 5ZwXulJvSI9MbjczurE7BYPmqatHrB0pm20Jm7Li+zJ40zfrrEi9dfCg2MgPg909Hd YuJSNlzryNFJ21rfdtYT9rArWWOMrK+WmC8ewCXw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5CC3DF80529; Wed, 16 Feb 2022 10:25:50 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 136EDF800D8; Mon, 14 Feb 2022 11:16:43 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 84B11F800D8 for ; Mon, 14 Feb 2022 11:16:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 84B11F800D8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Wa8LyAHA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644833797; x=1676369797; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=iMfir8Hys8PoRkg7XbbXRj39pNMes8hLErnltaIltH8=; b=Wa8LyAHAgrA1h2k/KMPw8SgsmfCETNO676PCx1G6fa/DLWIxin2Bvm/H j/4JAQ0YGS+oV1PJGx5VdymEnoH8omv688M+r1mvEPiPigqBRXCqNgKen zzrTiUFs1ImDTty8A/4cgPBjUKJXmmPdaDudRMjqRdz//nsxqGw41wuA0 bfPXZaQTwpU1rnzsE7pV9sYqO0VeekQtaH5wpxElNcmXARdgAt9GFNadX yC87IHx2rAgOB2ba1HmtRtO1wuunfes7Hvgs7wh6fWhrNsh5dOI16myxx GMKdfxhLRl/3vV0dA0hRgcd0Qgntkz5Ko5jwsHWok/qywTBbB3xIQD9Oy g==; X-IronPort-AV: E=McAfee;i="6200,9189,10257"; a="247654288" X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="247654288" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 02:16:32 -0800 X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="603187011" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 02:16:17 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nJYLy-004PC8-6n; Mon, 14 Feb 2022 12:13:06 +0200 Date: Mon, 14 Feb 2022 12:13:01 +0200 From: Andy Shevchenko To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [PATCH v2 1/2] platform: make platform_get_irq_optional() optional Message-ID: References: <20220212201631.12648-1-s.shtylyov@omp.ru> <20220212201631.12648-2-s.shtylyov@omp.ru> <20220214071351.pcvstrzkwqyrg536@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220214071351.pcvstrzkwqyrg536@pengutronix.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Mailman-Approved-At: Wed, 16 Feb 2022 10:25:43 +0100 Cc: Andrew Lunn , Ulf Hansson , Vignesh Raghavendra , kvm@vger.kernel.org, "Rafael J. Wysocki" , linux-iio@vger.kernel.org, Linus Walleij , Amit Kucheria , alsa-devel@alsa-project.org, Liam Girdwood , Guenter Roeck , Thierry Reding , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, Miquel Raynal , linux-phy@lists.infradead.org, Oleksij Rempel , Lee Jones , "David S. Miller" , Peter Korsgaard , Florian Fainelli , Matthias Schiffer , Joakim Zhang , Kamal Dasu , Jiri Slaby , Bartosz Golaszewski , Daniel Lezcano , Kishon Vijay Abraham I , bcm-kernel-feedback-list@broadcom.com, linux-serial@vger.kernel.org, Jakub Kicinski , Zhang Rui , platform-driver-x86@vger.kernel.org, linux-pwm@vger.kernel.org, Pengutronix Kernel Team , Corey Minyard , linux-pm@vger.kernel.org, John Garry , William Breathitt Gray , Mark Gross , linux-gpio@vger.kernel.org, Alex Williamson , Mark Brown , linux-mediatek@lists.infradead.org, Eric Auger , Takashi Iwai , Matthias Brugger , openipmi-developer@lists.sourceforge.net, Benson Leung , linux-arm-kernel@lists.infradead.org, Sergey Shtylyov , Mun Yew Tham , Hans de Goede , Greg Kroah-Hartman , Yoshihiro Shimoda , Cornelia Huck , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Vinod Koul , Zha Qipeng , Richard Weinberger , Niklas =?iso-8859-1?Q?S=F6derlund?= , Brian Norris , netdev@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Mon, Feb 14, 2022 at 08:13:51AM +0100, Uwe Kleine-König wrote: > On Sat, Feb 12, 2022 at 11:16:30PM +0300, Sergey Shtylyov wrote: > > This patch is based on the former Andy Shevchenko's patch: > > > > https://lore.kernel.org/lkml/20210331144526.19439-1-andriy.shevchenko@linux.intel.com/ > > > > Currently platform_get_irq_optional() returns an error code even if IRQ > > resource simply has not been found. It prevents the callers from being > > error code agnostic in their error handling: > > > > ret = platform_get_irq_optional(...); > > if (ret < 0 && ret != -ENXIO) > > return ret; // respect deferred probe > > if (ret > 0) > > ...we get an IRQ... > > > > All other *_optional() APIs seem to return 0 or NULL in case an optional > > resource is not available. Let's follow this good example, so that the > > callers would look like: > > > > ret = platform_get_irq_optional(...); > > if (ret < 0) > > return ret; > > if (ret > 0) > > ...we get an IRQ... > > > > Reported-by: Matthias Schiffer > > Signed-off-by: Sergey Shtylyov > > While this patch is better than v1, I still don't like it for the > reasons discussed for v1. (i.e. 0 isn't usable as a dummy value which I > consider the real advantage for the other _get_optional() functions.) I think you haven't reacted anyhow to my point that you mixing apples and bananas together when comparing this 0 to the others _optional APIs. > Apart from that, I think the subject is badly chosen. With "Make > somefunc() optional" I would expect that you introduce a Kconfig symbol > that results in the function not being available when disabled. -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00B65C433FE for ; Mon, 14 Feb 2022 10:52:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349364AbiBNKwh (ORCPT ); Mon, 14 Feb 2022 05:52:37 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349391AbiBNKvz (ORCPT ); Mon, 14 Feb 2022 05:51:55 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B93469CD8; Mon, 14 Feb 2022 02:16:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644833793; x=1676369793; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=iMfir8Hys8PoRkg7XbbXRj39pNMes8hLErnltaIltH8=; b=H0pRtYXVokRBX+RGOdsauOP2aIBK1vtMoRGVk+VDUjA0gjIToKp08alR Tm18cVC3x44oAcrbuiqx/MzOE8OK4CduA2tcM/A1XkQRsBI7PovauGPJd 0kz34pErXmws8kirxEiFlrcm3UmngipUs6aMo6zPHQmDtF9jNxNgty5Eu x+fAcade60DLDG7Rwc6dU+y5s++sSBiaXXsF0yEQzBwK49KC3bxrLe4wT TpB1A+VMBkcYrK8YoNp/BJt8twTNALUNIl+xHo6DUgdP8dwR9lZ7s8WuF dPG9EmE0KsElsnrAyZkL2fICumUH0C3VBRwIxaCvdCGRHPC478tlmkk2s g==; X-IronPort-AV: E=McAfee;i="6200,9189,10257"; a="230023834" X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="230023834" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 02:16:32 -0800 X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="603187011" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 02:16:17 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nJYLy-004PC8-6n; Mon, 14 Feb 2022 12:13:06 +0200 Date: Mon, 14 Feb 2022 12:13:01 +0200 From: Andy Shevchenko To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Sergey Shtylyov , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Andrew Lunn , Ulf Hansson , Vignesh Raghavendra , Jiri Slaby , linux-iio@vger.kernel.org, Linus Walleij , Amit Kucheria , alsa-devel@alsa-project.org, Liam Girdwood , linux-phy@lists.infradead.org, Thierry Reding , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org, Miquel Raynal , Guenter Roeck , linux-spi@vger.kernel.org, Lee Jones , openipmi-developer@lists.sourceforge.net, Peter Korsgaard , Florian Fainelli , Matthias Schiffer , kvm@vger.kernel.org, Kamal Dasu , Richard Weinberger , Bartosz Golaszewski , Daniel Lezcano , Kishon Vijay Abraham I , bcm-kernel-feedback-list@broadcom.com, linux-serial@vger.kernel.org, Jakub Kicinski , Zhang Rui , Jaroslav Kysela , platform-driver-x86@vger.kernel.org, linux-pwm@vger.kernel.org, Zha Qipeng , Corey Minyard , linux-pm@vger.kernel.org, John Garry , William Breathitt Gray , Mark Gross , Hans de Goede , Alex Williamson , Mark Brown , linux-mediatek@lists.infradead.org, Matthias Brugger , Takashi Iwai , Benson Leung , linux-arm-kernel@lists.infradead.org, Mun Yew Tham , Eric Auger , netdev@vger.kernel.org, Yoshihiro Shimoda , Cornelia Huck , linux-mmc@vger.kernel.org, Joakim Zhang , Oleksij Rempel , linux-renesas-soc@vger.kernel.org, Vinod Koul , Pengutronix Kernel Team , Niklas =?iso-8859-1?Q?S=F6derlund?= , Brian Norris , "David S. Miller" Subject: Re: [PATCH v2 1/2] platform: make platform_get_irq_optional() optional Message-ID: References: <20220212201631.12648-1-s.shtylyov@omp.ru> <20220212201631.12648-2-s.shtylyov@omp.ru> <20220214071351.pcvstrzkwqyrg536@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220214071351.pcvstrzkwqyrg536@pengutronix.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Mon, Feb 14, 2022 at 08:13:51AM +0100, Uwe Kleine-König wrote: > On Sat, Feb 12, 2022 at 11:16:30PM +0300, Sergey Shtylyov wrote: > > This patch is based on the former Andy Shevchenko's patch: > > > > https://lore.kernel.org/lkml/20210331144526.19439-1-andriy.shevchenko@linux.intel.com/ > > > > Currently platform_get_irq_optional() returns an error code even if IRQ > > resource simply has not been found. It prevents the callers from being > > error code agnostic in their error handling: > > > > ret = platform_get_irq_optional(...); > > if (ret < 0 && ret != -ENXIO) > > return ret; // respect deferred probe > > if (ret > 0) > > ...we get an IRQ... > > > > All other *_optional() APIs seem to return 0 or NULL in case an optional > > resource is not available. Let's follow this good example, so that the > > callers would look like: > > > > ret = platform_get_irq_optional(...); > > if (ret < 0) > > return ret; > > if (ret > 0) > > ...we get an IRQ... > > > > Reported-by: Matthias Schiffer > > Signed-off-by: Sergey Shtylyov > > While this patch is better than v1, I still don't like it for the > reasons discussed for v1. (i.e. 0 isn't usable as a dummy value which I > consider the real advantage for the other _get_optional() functions.) I think you haven't reacted anyhow to my point that you mixing apples and bananas together when comparing this 0 to the others _optional APIs. > Apart from that, I think the subject is badly chosen. With "Make > somefunc() optional" I would expect that you introduce a Kconfig symbol > that results in the function not being available when disabled. -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48CECC433F5 for ; Mon, 14 Feb 2022 11:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JFYIwZdP0cttvFeshX+hrWREd8nlKpsEuP38Ki+64Uw=; b=g5q4pOzGNeSlfC cwR6UlfYTHdWVr2Mn62pLu52j3YuwlTtHjmvYwJt4K9nCpYYRwxkLw+45Ny43yetJeX08J/S8Ey8p iZFHPGLGksyWwBV4a1ZObtHP0HXUmb4LHOpY4NRJKjwo2UNmn1zl8FDPhyi51vPecvOERCs9M/PSD VPC3LM7gw45ALjmYjCWQMJflclLo/YMLVYCB9gx4Y/7o6yE1ZindE6GRSQzugKbOAovKRH6DsV2Pj fTIE8KJHJFidQhHahcNm08JhCFVT2FW3FyBJ1vwV5ShWw9M81CHB3ixBjDmo+M/AHcKILKWInIJWN 7zNPn81uK05Q1Yl1BM8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJZfb-00Es9F-BL; Mon, 14 Feb 2022 11:37:27 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJYPJ-00ESMH-Pl; Mon, 14 Feb 2022 10:16:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644833793; x=1676369793; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=iMfir8Hys8PoRkg7XbbXRj39pNMes8hLErnltaIltH8=; b=H0pRtYXVokRBX+RGOdsauOP2aIBK1vtMoRGVk+VDUjA0gjIToKp08alR Tm18cVC3x44oAcrbuiqx/MzOE8OK4CduA2tcM/A1XkQRsBI7PovauGPJd 0kz34pErXmws8kirxEiFlrcm3UmngipUs6aMo6zPHQmDtF9jNxNgty5Eu x+fAcade60DLDG7Rwc6dU+y5s++sSBiaXXsF0yEQzBwK49KC3bxrLe4wT TpB1A+VMBkcYrK8YoNp/BJt8twTNALUNIl+xHo6DUgdP8dwR9lZ7s8WuF dPG9EmE0KsElsnrAyZkL2fICumUH0C3VBRwIxaCvdCGRHPC478tlmkk2s g==; X-IronPort-AV: E=McAfee;i="6200,9189,10257"; a="274630826" X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="274630826" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 02:16:32 -0800 X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="603187011" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 02:16:17 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nJYLy-004PC8-6n; Mon, 14 Feb 2022 12:13:06 +0200 Date: Mon, 14 Feb 2022 12:13:01 +0200 From: Andy Shevchenko To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Sergey Shtylyov , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Andrew Lunn , Ulf Hansson , Vignesh Raghavendra , Jiri Slaby , linux-iio@vger.kernel.org, Linus Walleij , Amit Kucheria , alsa-devel@alsa-project.org, Liam Girdwood , linux-phy@lists.infradead.org, Thierry Reding , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org, Miquel Raynal , Guenter Roeck , linux-spi@vger.kernel.org, Lee Jones , openipmi-developer@lists.sourceforge.net, Peter Korsgaard , Florian Fainelli , Matthias Schiffer , kvm@vger.kernel.org, Kamal Dasu , Richard Weinberger , Bartosz Golaszewski , Daniel Lezcano , Kishon Vijay Abraham I , bcm-kernel-feedback-list@broadcom.com, linux-serial@vger.kernel.org, Jakub Kicinski , Zhang Rui , Jaroslav Kysela , platform-driver-x86@vger.kernel.org, linux-pwm@vger.kernel.org, Zha Qipeng , Corey Minyard , linux-pm@vger.kernel.org, John Garry , William Breathitt Gray , Mark Gross , Hans de Goede , Alex Williamson , Mark Brown , linux-mediatek@lists.infradead.org, Matthias Brugger , Takashi Iwai , Benson Leung , linux-arm-kernel@lists.infradead.org, Mun Yew Tham , Eric Auger , netdev@vger.kernel.org, Yoshihiro Shimoda , Cornelia Huck , linux-mmc@vger.kernel.org, Joakim Zhang , Oleksij Rempel , linux-renesas-soc@vger.kernel.org, Vinod Koul , Pengutronix Kernel Team , Niklas =?iso-8859-1?Q?S=F6derlund?= , Brian Norris , "David S. Miller" Subject: Re: [PATCH v2 1/2] platform: make platform_get_irq_optional() optional Message-ID: References: <20220212201631.12648-1-s.shtylyov@omp.ru> <20220212201631.12648-2-s.shtylyov@omp.ru> <20220214071351.pcvstrzkwqyrg536@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220214071351.pcvstrzkwqyrg536@pengutronix.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220214_021633_909796_0B61305A X-CRM114-Status: GOOD ( 25.15 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Mon, Feb 14, 2022 at 08:13:51AM +0100, Uwe Kleine-K=F6nig wrote: > On Sat, Feb 12, 2022 at 11:16:30PM +0300, Sergey Shtylyov wrote: > > This patch is based on the former Andy Shevchenko's patch: > > = > > https://lore.kernel.org/lkml/20210331144526.19439-1-andriy.shevchenko@l= inux.intel.com/ > > = > > Currently platform_get_irq_optional() returns an error code even if IRQ > > resource simply has not been found. It prevents the callers from being > > error code agnostic in their error handling: > > = > > ret =3D platform_get_irq_optional(...); > > if (ret < 0 && ret !=3D -ENXIO) > > return ret; // respect deferred probe > > if (ret > 0) > > ...we get an IRQ... > > = > > All other *_optional() APIs seem to return 0 or NULL in case an optional > > resource is not available. Let's follow this good example, so that the > > callers would look like: > > = > > ret =3D platform_get_irq_optional(...); > > if (ret < 0) > > return ret; > > if (ret > 0) > > ...we get an IRQ... > > = > > Reported-by: Matthias Schiffer > > Signed-off-by: Sergey Shtylyov > = > While this patch is better than v1, I still don't like it for the > reasons discussed for v1. (i.e. 0 isn't usable as a dummy value which I > consider the real advantage for the other _get_optional() functions.) I think you haven't reacted anyhow to my point that you mixing apples and bananas together when comparing this 0 to the others _optional APIs. > Apart from that, I think the subject is badly chosen. With "Make > somefunc() optional" I would expect that you introduce a Kconfig symbol > that results in the function not being available when disabled. -- = With Best Regards, Andy Shevchenko _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A2F35C433F5 for ; Mon, 14 Feb 2022 11:38:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hEM9BjxgHzST3BIEjNnoBD/SsekDo1e3IHTBqQ6hWN4=; b=MfnV5uiGdgw5Ke J/xRbitLMK+kPLWahTQdVhplA2Ttgs8C6/u0EEOfeLhU3WZUxW63oAyUXRmlWQ1LJWYQJd7dm5+fO KLwF/XdqlakcM2vaZQhpX+slenBSN9yR9YFnfYaX+qIxdaeSmY9/1e6HzytMcDBkYL49z3DjDdir3 29ZOvNQgtNmG31pEvxSuOJKrIVQebj+tIUdI/fu3/3A+Qa4d+pMkL0OTgQdnIuZZaCxSGn1Kf1cDd vNSFBRS46czayqEeKhPaMXnmriZrdjj/m7enbLam9gocUaAJxHFKq6KS1ZwBVBj3Po4x0n7xtyods 8tmWi3+dYsZi0/9VkCtw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJZfl-00EsD6-4G; Mon, 14 Feb 2022 11:37:37 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJYPJ-00ESMH-Pl; Mon, 14 Feb 2022 10:16:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644833793; x=1676369793; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=iMfir8Hys8PoRkg7XbbXRj39pNMes8hLErnltaIltH8=; b=H0pRtYXVokRBX+RGOdsauOP2aIBK1vtMoRGVk+VDUjA0gjIToKp08alR Tm18cVC3x44oAcrbuiqx/MzOE8OK4CduA2tcM/A1XkQRsBI7PovauGPJd 0kz34pErXmws8kirxEiFlrcm3UmngipUs6aMo6zPHQmDtF9jNxNgty5Eu x+fAcade60DLDG7Rwc6dU+y5s++sSBiaXXsF0yEQzBwK49KC3bxrLe4wT TpB1A+VMBkcYrK8YoNp/BJt8twTNALUNIl+xHo6DUgdP8dwR9lZ7s8WuF dPG9EmE0KsElsnrAyZkL2fICumUH0C3VBRwIxaCvdCGRHPC478tlmkk2s g==; X-IronPort-AV: E=McAfee;i="6200,9189,10257"; a="274630826" X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="274630826" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 02:16:32 -0800 X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="603187011" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 02:16:17 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nJYLy-004PC8-6n; Mon, 14 Feb 2022 12:13:06 +0200 Date: Mon, 14 Feb 2022 12:13:01 +0200 From: Andy Shevchenko To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Sergey Shtylyov , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Andrew Lunn , Ulf Hansson , Vignesh Raghavendra , Jiri Slaby , linux-iio@vger.kernel.org, Linus Walleij , Amit Kucheria , alsa-devel@alsa-project.org, Liam Girdwood , linux-phy@lists.infradead.org, Thierry Reding , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org, Miquel Raynal , Guenter Roeck , linux-spi@vger.kernel.org, Lee Jones , openipmi-developer@lists.sourceforge.net, Peter Korsgaard , Florian Fainelli , Matthias Schiffer , kvm@vger.kernel.org, Kamal Dasu , Richard Weinberger , Bartosz Golaszewski , Daniel Lezcano , Kishon Vijay Abraham I , bcm-kernel-feedback-list@broadcom.com, linux-serial@vger.kernel.org, Jakub Kicinski , Zhang Rui , Jaroslav Kysela , platform-driver-x86@vger.kernel.org, linux-pwm@vger.kernel.org, Zha Qipeng , Corey Minyard , linux-pm@vger.kernel.org, John Garry , William Breathitt Gray , Mark Gross , Hans de Goede , Alex Williamson , Mark Brown , linux-mediatek@lists.infradead.org, Matthias Brugger , Takashi Iwai , Benson Leung , linux-arm-kernel@lists.infradead.org, Mun Yew Tham , Eric Auger , netdev@vger.kernel.org, Yoshihiro Shimoda , Cornelia Huck , linux-mmc@vger.kernel.org, Joakim Zhang , Oleksij Rempel , linux-renesas-soc@vger.kernel.org, Vinod Koul , Pengutronix Kernel Team , Niklas =?iso-8859-1?Q?S=F6derlund?= , Brian Norris , "David S. Miller" Subject: Re: [PATCH v2 1/2] platform: make platform_get_irq_optional() optional Message-ID: References: <20220212201631.12648-1-s.shtylyov@omp.ru> <20220212201631.12648-2-s.shtylyov@omp.ru> <20220214071351.pcvstrzkwqyrg536@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220214071351.pcvstrzkwqyrg536@pengutronix.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220214_021633_909796_0B61305A X-CRM114-Status: GOOD ( 25.15 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Mon, Feb 14, 2022 at 08:13:51AM +0100, Uwe Kleine-K=F6nig wrote: > On Sat, Feb 12, 2022 at 11:16:30PM +0300, Sergey Shtylyov wrote: > > This patch is based on the former Andy Shevchenko's patch: > > = > > https://lore.kernel.org/lkml/20210331144526.19439-1-andriy.shevchenko@l= inux.intel.com/ > > = > > Currently platform_get_irq_optional() returns an error code even if IRQ > > resource simply has not been found. It prevents the callers from being > > error code agnostic in their error handling: > > = > > ret =3D platform_get_irq_optional(...); > > if (ret < 0 && ret !=3D -ENXIO) > > return ret; // respect deferred probe > > if (ret > 0) > > ...we get an IRQ... > > = > > All other *_optional() APIs seem to return 0 or NULL in case an optional > > resource is not available. Let's follow this good example, so that the > > callers would look like: > > = > > ret =3D platform_get_irq_optional(...); > > if (ret < 0) > > return ret; > > if (ret > 0) > > ...we get an IRQ... > > = > > Reported-by: Matthias Schiffer > > Signed-off-by: Sergey Shtylyov > = > While this patch is better than v1, I still don't like it for the > reasons discussed for v1. (i.e. 0 isn't usable as a dummy value which I > consider the real advantage for the other _get_optional() functions.) I think you haven't reacted anyhow to my point that you mixing apples and bananas together when comparing this 0 to the others _optional APIs. > Apart from that, I think the subject is badly chosen. With "Make > somefunc() optional" I would expect that you introduce a Kconfig symbol > that results in the function not being available when disabled. -- = With Best Regards, Andy Shevchenko ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5996C433F5 for ; Mon, 14 Feb 2022 11:37:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IFYxEvrWyYvyAeKm5zkAakMIv+UjovoPdAcmkjXCSsc=; b=QYf0c9bbOAkCBg HlDFWeREgFE03CqHEN3tmAzFOQNeBNwrVZ01rqH2jN3Bi67t76rkcYWQ9gfoupy7gGk7V2Sn6YTyT Y0oYU9iQ3ZAH9b+VBvlqoSdvp2dn3RBStY20sYT72/u4NvMPbirDg3Jru9SsetyfY9b1G/arxuFu8 0HQtm7QbSYzmKRcifP0qGb8l+oMCEsSsXDVM10BcPsDuC6GEizvWmOgRwGwusbmp7IxWTTPv3AZ2v pCRVyJmpxnYubfniGf/mLBACYrFGQfvF8KD7GulosAmGlXjB5V7g/8EONdHId+rKC02OKXdcmpUWd 2AeYsM2sYIDfuRYyb85g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJZfb-00Es9A-11; Mon, 14 Feb 2022 11:37:27 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJYPJ-00ESMH-Pl; Mon, 14 Feb 2022 10:16:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644833793; x=1676369793; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=iMfir8Hys8PoRkg7XbbXRj39pNMes8hLErnltaIltH8=; b=H0pRtYXVokRBX+RGOdsauOP2aIBK1vtMoRGVk+VDUjA0gjIToKp08alR Tm18cVC3x44oAcrbuiqx/MzOE8OK4CduA2tcM/A1XkQRsBI7PovauGPJd 0kz34pErXmws8kirxEiFlrcm3UmngipUs6aMo6zPHQmDtF9jNxNgty5Eu x+fAcade60DLDG7Rwc6dU+y5s++sSBiaXXsF0yEQzBwK49KC3bxrLe4wT TpB1A+VMBkcYrK8YoNp/BJt8twTNALUNIl+xHo6DUgdP8dwR9lZ7s8WuF dPG9EmE0KsElsnrAyZkL2fICumUH0C3VBRwIxaCvdCGRHPC478tlmkk2s g==; X-IronPort-AV: E=McAfee;i="6200,9189,10257"; a="274630826" X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="274630826" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 02:16:32 -0800 X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="603187011" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2022 02:16:17 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nJYLy-004PC8-6n; Mon, 14 Feb 2022 12:13:06 +0200 Date: Mon, 14 Feb 2022 12:13:01 +0200 From: Andy Shevchenko To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Sergey Shtylyov , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Andrew Lunn , Ulf Hansson , Vignesh Raghavendra , Jiri Slaby , linux-iio@vger.kernel.org, Linus Walleij , Amit Kucheria , alsa-devel@alsa-project.org, Liam Girdwood , linux-phy@lists.infradead.org, Thierry Reding , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org, Miquel Raynal , Guenter Roeck , linux-spi@vger.kernel.org, Lee Jones , openipmi-developer@lists.sourceforge.net, Peter Korsgaard , Florian Fainelli , Matthias Schiffer , kvm@vger.kernel.org, Kamal Dasu , Richard Weinberger , Bartosz Golaszewski , Daniel Lezcano , Kishon Vijay Abraham I , bcm-kernel-feedback-list@broadcom.com, linux-serial@vger.kernel.org, Jakub Kicinski , Zhang Rui , Jaroslav Kysela , platform-driver-x86@vger.kernel.org, linux-pwm@vger.kernel.org, Zha Qipeng , Corey Minyard , linux-pm@vger.kernel.org, John Garry , William Breathitt Gray , Mark Gross , Hans de Goede , Alex Williamson , Mark Brown , linux-mediatek@lists.infradead.org, Matthias Brugger , Takashi Iwai , Benson Leung , linux-arm-kernel@lists.infradead.org, Mun Yew Tham , Eric Auger , netdev@vger.kernel.org, Yoshihiro Shimoda , Cornelia Huck , linux-mmc@vger.kernel.org, Joakim Zhang , Oleksij Rempel , linux-renesas-soc@vger.kernel.org, Vinod Koul , Pengutronix Kernel Team , Niklas =?iso-8859-1?Q?S=F6derlund?= , Brian Norris , "David S. Miller" Subject: Re: [PATCH v2 1/2] platform: make platform_get_irq_optional() optional Message-ID: References: <20220212201631.12648-1-s.shtylyov@omp.ru> <20220212201631.12648-2-s.shtylyov@omp.ru> <20220214071351.pcvstrzkwqyrg536@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220214071351.pcvstrzkwqyrg536@pengutronix.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220214_021633_909796_0B61305A X-CRM114-Status: GOOD ( 25.15 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On Mon, Feb 14, 2022 at 08:13:51AM +0100, Uwe Kleine-K=F6nig wrote: > On Sat, Feb 12, 2022 at 11:16:30PM +0300, Sergey Shtylyov wrote: > > This patch is based on the former Andy Shevchenko's patch: > > = > > https://lore.kernel.org/lkml/20210331144526.19439-1-andriy.shevchenko@l= inux.intel.com/ > > = > > Currently platform_get_irq_optional() returns an error code even if IRQ > > resource simply has not been found. It prevents the callers from being > > error code agnostic in their error handling: > > = > > ret =3D platform_get_irq_optional(...); > > if (ret < 0 && ret !=3D -ENXIO) > > return ret; // respect deferred probe > > if (ret > 0) > > ...we get an IRQ... > > = > > All other *_optional() APIs seem to return 0 or NULL in case an optional > > resource is not available. Let's follow this good example, so that the > > callers would look like: > > = > > ret =3D platform_get_irq_optional(...); > > if (ret < 0) > > return ret; > > if (ret > 0) > > ...we get an IRQ... > > = > > Reported-by: Matthias Schiffer > > Signed-off-by: Sergey Shtylyov > = > While this patch is better than v1, I still don't like it for the > reasons discussed for v1. (i.e. 0 isn't usable as a dummy value which I > consider the real advantage for the other _get_optional() functions.) I think you haven't reacted anyhow to my point that you mixing apples and bananas together when comparing this 0 to the others _optional APIs. > Apart from that, I think the subject is badly chosen. With "Make > somefunc() optional" I would expect that you introduce a Kconfig symbol > that results in the function not being available when disabled. -- = With Best Regards, Andy Shevchenko -- = linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy