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 D9BC8C433F5 for ; Thu, 20 Jan 2022 07:17:01 +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 2C81C2037; Thu, 20 Jan 2022 08:16:10 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2C81C2037 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642663020; bh=GrIa/eIkS4G4kb2rO6T4E37qSkXPKSwhy4Oe6Ceo9GE=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=NzjgmGomXoXBJficS3N1zDMKSQHQ/kTyYia+Bcnz1ckAwzf1Un5XRcgREHHiXWfLK XNYVG9UDiMAvA6cfCNyefisUJi2nyJ7jtWHkfevIyUONOteCc6Y3Nf1YI9ybFFKpyV pXTrSyfWc7KTt6l1U+YwhpFvs4G4pU1Lb4x2FSlA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 64365F80618; Thu, 20 Jan 2022 08:04:07 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 483A3F80100; Wed, 19 Jan 2022 20:22:42 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 100C7F80100 for ; Wed, 19 Jan 2022 20:22:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 100C7F80100 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PCV1XLcY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642620160; x=1674156160; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=GrIa/eIkS4G4kb2rO6T4E37qSkXPKSwhy4Oe6Ceo9GE=; b=PCV1XLcYtwRiFL7UiWlizDHQdIYWeal9V3zswNCr1nPONtylFQHzwzgj Q/EnXvLSvQGUU7BXIY1Rx3EFDZ6Y9geSVL7kOEB7OtELDySNXaUBy2EQY 6qNe7ZTKEwctopltmMV+00NjnKGPCGoCOwx/YzqETDZLNVcKtNgtJPkpc fQhZLTMTe+3tHLn6AbUun+o1AerC460npv5PhJHBTpUCX7TqAwLmPnHGa KNtqerFL0Iby6qePKxZVB9WgrlcTHXoFFNN6FfyU871RMhcTLoRtzm8AC CWKJf5TklA8uhfxxzllAo/SKxGWRmoy+Q1I/26rgCzXfq23y7JiMGvAcb A==; X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="269559075" X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="269559075" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 11:01:51 -0800 X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="595498167" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 11:01:29 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nAG9n-00CEAT-Kb; Wed, 19 Jan 2022 20:58:07 +0200 Date: Wed, 19 Jan 2022 20:58:07 +0200 From: Andy Shevchenko To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [PATCH 1/2] platform: make platform_get_irq_optional() optional Message-ID: References: <20220112085009.dbasceh3obfok5dc@pengutronix.de> <20220112213121.5ruae5mxwj6t3qiy@pengutronix.de> <29f0c65d-77f2-e5b2-f6cc-422add8a707d@omp.ru> <20220114092557.jrkfx7ihg26ekzci@pengutronix.de> <61b80939-357d-14f5-df99-b8d102a4e1a1@omp.ru> <20220114202226.ugzklxv4wzr6egwj@pengutronix.de> <57af1851-9341-985e-7b28-d2ba86770ecb@omp.ru> <20220117084732.cdy2sash5hxp4lwo@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220117084732.cdy2sash5hxp4lwo@pengutronix.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Mailman-Approved-At: Thu, 20 Jan 2022 08:03:35 +0100 Cc: Andrew Lunn , Ulf Hansson , Vignesh Raghavendra , KVM list , "Rafael J. Wysocki" , linux-iio@vger.kernel.org, Linus Walleij , Amit Kucheria , ALSA Development Mailing List , Guenter Roeck , Thierry Reding , MTD Maling List , Linux I2C , Miquel Raynal , linux-phy@lists.infradead.org, Jiri Slaby , openipmi-developer@lists.sourceforge.net, Khuong Dinh , Florian Fainelli , Matthias Schiffer , Joakim Zhang , Kamal Dasu , Greg Kroah-Hartman , Lee Jones , Bartosz Golaszewski , Daniel Lezcano , Tony Luck , Kishon Vijay Abraham I , Geert Uytterhoeven , "open list:SERIAL DRIVERS" , bcm-kernel-feedback-list , Zhang Rui , Linux PWM List , Robert Richter , Saravanan Sekar , Corey Minyard , Linux PM list , Linux Kernel Mailing List , Mauro Carvalho Chehab , John Garry , Peter Korsgaard , William Breathitt Gray , Mark Gross , "open list:GPIO SUBSYSTEM" , Alex Williamson , Mark Brown , Borislav Petkov , Sebastian Reichel , Eric Auger , Jakub Kicinski , Matthias Brugger , Takashi Iwai , platform-driver-x86@vger.kernel.org, Benson Leung , Linux ARM , linux-edac@vger.kernel.org, Sergey Shtylyov , Mun Yew Tham , Hans de Goede , netdev@vger.kernel.org, Yoshihiro Shimoda , Cornelia Huck , Linux MMC List , Liam Girdwood , linux-spi , Linux-Renesas , Vinod Koul , James Morse , Zha Qipeng , Pengutronix Kernel Team , Richard Weinberger , Niklas =?iso-8859-1?Q?S=F6derlund?= , linux-mediatek@lists.infradead.org, Brian Norris , "David S. Miller" 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, Jan 17, 2022 at 09:47:32AM +0100, Uwe Kleine-König wrote: > On Sun, Jan 16, 2022 at 09:15:20PM +0300, Sergey Shtylyov wrote: ... > Because with your change we have: > > - < 0 -> error > - == 0 -> no irq > - > 0 -> irq > > For my part I'd say this doesn't justify the change, but at least I > could better life with the reasoning. If you start at: > > irq = platform_get_irq_optional(...) > if (irq < 0 && irq != -ENXIO) > return irq > else if (irq > 0) > setup_irq(irq); > else > setup_polling() > > I'd change that to > > irq = platform_get_irq_optional(...) > if (irq > 0) /* or >= 0 ? */ > setup_irq(irq) > else if (irq == -ENXIO) > setup_polling() > else > return irq > > This still has to mention -ENXIO, but this is ok and checking for 0 just > hardcodes a different return value. It's what we are against of. The idea is to have irq = platform_get_irq_optional(...) if (irq < 0) // we do not care about special cookies here return irq; if (irq) setup_irq(irq) else setup_polling() See the difference? Your code is convoluted. > Anyhow, I think if you still want to change platform_get_irq_optional > you should add a few patches converting some drivers which demonstrates > the improvement for the callers. -- 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 78BB4C433EF for ; Wed, 19 Jan 2022 19:20:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231955AbiASTUE (ORCPT ); Wed, 19 Jan 2022 14:20:04 -0500 Received: from mga09.intel.com ([134.134.136.24]:46925 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239752AbiASTTu (ORCPT ); Wed, 19 Jan 2022 14:19:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642619990; x=1674155990; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=GrIa/eIkS4G4kb2rO6T4E37qSkXPKSwhy4Oe6Ceo9GE=; b=Ks/3HUvVsWkTUYJa/4ZMdoPiTTOvIVu4N5vGSVNIgBMIpKUFJDpaVJsA EXWo/0GjwdvwnEOEFpVd0O7SeNs7lL5keSDSz+RPWqdhQ4ffsiZhh6Jy1 led0+7j6qXeab/lVKMGvzIQ2k/UrscgKtA2x4/Q2UOXxd6aeN/3kTzSyl u6Z+8vCeBIceyDcsgaBpKJsypR4p3mndFe41m5qcZLlLo9uwF8STJFdYn vhufn7waodXb4VESKPHGk/N5ux2Ot1WYL60mjawln0QZ9/bMPx4qlzY48 O8odoesT1i5jmSDbpjwZU3JimCWmbatGCREUwibyRrz2J+6xbeojmDQwS A==; X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="244961252" X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="244961252" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 11:01:51 -0800 X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="595498167" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 11:01:29 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nAG9n-00CEAT-Kb; Wed, 19 Jan 2022 20:58:07 +0200 Date: Wed, 19 Jan 2022 20:58:07 +0200 From: Andy Shevchenko To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Sergey Shtylyov , Andrew Lunn , Ulf Hansson , Vignesh Raghavendra , KVM list , "Rafael J. Wysocki" , linux-iio@vger.kernel.org, Linus Walleij , Amit Kucheria , ALSA Development Mailing List , Jaroslav Kysela , Guenter Roeck , Thierry Reding , MTD Maling List , Linux I2C , "open list:GPIO SUBSYSTEM" , Miquel Raynal , linux-phy@lists.infradead.org, netdev@vger.kernel.org, linux-spi , Jiri Slaby , Khuong Dinh , Florian Fainelli , Matthias Schiffer , Kamal Dasu , Lee Jones , Bartosz Golaszewski , Daniel Lezcano , Kishon Vijay Abraham I , Geert Uytterhoeven , "open list:SERIAL DRIVERS" , bcm-kernel-feedback-list , Zhang Rui , platform-driver-x86@vger.kernel.org, Linux PWM List , Robert Richter , Saravanan Sekar , Corey Minyard , Linux PM list , Liam Girdwood , Mauro Carvalho Chehab , John Garry , Takashi Iwai , Peter Korsgaard , William Breathitt Gray , Mark Gross , Hans de Goede , Alex Williamson , Mark Brown , Borislav Petkov , Jakub Kicinski , Matthias Brugger , openipmi-developer@lists.sourceforge.net, Benson Leung , Pengutronix Kernel Team , Linux ARM , linux-edac@vger.kernel.org, Tony Luck , Richard Weinberger , Mun Yew Tham , Eric Auger , Greg Kroah-Hartman , Yoshihiro Shimoda , Cornelia Huck , Linux MMC List , Joakim Zhang , Linux Kernel Mailing List , Linux-Renesas , Vinod Koul , James Morse , Zha Qipeng , Sebastian Reichel , Niklas =?iso-8859-1?Q?S=F6derlund?= , linux-mediatek@lists.infradead.org, Brian Norris , "David S. Miller" Subject: Re: [PATCH 1/2] platform: make platform_get_irq_optional() optional Message-ID: References: <20220112085009.dbasceh3obfok5dc@pengutronix.de> <20220112213121.5ruae5mxwj6t3qiy@pengutronix.de> <29f0c65d-77f2-e5b2-f6cc-422add8a707d@omp.ru> <20220114092557.jrkfx7ihg26ekzci@pengutronix.de> <61b80939-357d-14f5-df99-b8d102a4e1a1@omp.ru> <20220114202226.ugzklxv4wzr6egwj@pengutronix.de> <57af1851-9341-985e-7b28-d2ba86770ecb@omp.ru> <20220117084732.cdy2sash5hxp4lwo@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220117084732.cdy2sash5hxp4lwo@pengutronix.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org On Mon, Jan 17, 2022 at 09:47:32AM +0100, Uwe Kleine-König wrote: > On Sun, Jan 16, 2022 at 09:15:20PM +0300, Sergey Shtylyov wrote: ... > Because with your change we have: > > - < 0 -> error > - == 0 -> no irq > - > 0 -> irq > > For my part I'd say this doesn't justify the change, but at least I > could better life with the reasoning. If you start at: > > irq = platform_get_irq_optional(...) > if (irq < 0 && irq != -ENXIO) > return irq > else if (irq > 0) > setup_irq(irq); > else > setup_polling() > > I'd change that to > > irq = platform_get_irq_optional(...) > if (irq > 0) /* or >= 0 ? */ > setup_irq(irq) > else if (irq == -ENXIO) > setup_polling() > else > return irq > > This still has to mention -ENXIO, but this is ok and checking for 0 just > hardcodes a different return value. It's what we are against of. The idea is to have irq = platform_get_irq_optional(...) if (irq < 0) // we do not care about special cookies here return irq; if (irq) setup_irq(irq) else setup_polling() See the difference? Your code is convoluted. > Anyhow, I think if you still want to change platform_get_irq_optional > you should add a few patches converting some drivers which demonstrates > the improvement for the callers. -- 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 8AC12C433F5 for ; Wed, 19 Jan 2022 19:19:59 +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=7C0X2T6j/ASj7R1ASNYHBTQTXnoc+nqY94MXJbejcQE=; b=mJShBBuwu3oj4I UktI2qj0ETDQ4u+eU6o+2wqyOIJw56uzxDl0xHh2dfGQEXM+6X/4h01o+oRsxymSLHvyGB79TS3d7 hQdYO0jyoiHEDWuYCB0UVLLhP90iuVgJCWg1r2LzPQSHHrL+vlVlOeoKrYJzWPW5EvLhaxDo1M3B2 vovsfmIx9TL6vgGMZ1Mw3XSpv4c/LY55n0pdHEYoPEUxaDm2VKErQS2//i5+eO0gdKET07TAcvmp+ nlQkHyyxsZyHRDhvgl4sbMQ5AFhfbQaafgaRK6p8EVxqnvHS3OltA7jBQvqo3Mub/V2X5RkKNC13D k23+zmGMjeC2srtYbnbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAGUq-0070I9-Vw; Wed, 19 Jan 2022 19:19:53 +0000 Received: from mga09.intel.com ([134.134.136.24]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAGUm-0070GO-Qg; Wed, 19 Jan 2022 19:19:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642619988; x=1674155988; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=GrIa/eIkS4G4kb2rO6T4E37qSkXPKSwhy4Oe6Ceo9GE=; b=CEMyfjUcgEhejRO2jpNRifx/ruQ1Jjkuten77JL72jRZ4SXEiD237mCa VApQx6tK5KhnMRtvtfkje+zjBOYuWmSw6KQhEVKaTo/+yV13aMAY1+I8r YR/j1hc4F+3pmH8TylPzDIsTR7uXYu7h4LsEjHux/COts8mFEtT0l/f5i UQuNF7IPsGxwQYzMo4VY0qdHpLqTGlJlIwnavLCcOipObn4ZmywyVwpwu 2wzi1vHNcSW7zBORtN4MCfEZxPHWMhQKCkkYQYSyGy06/rIKsTgEwM+ZN 944rGzHi3OC9vRDvaxl7bS27azHVMAlWG++OxgblMNv/hWiT1QD+xRVci w==; X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="244961254" X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="244961254" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 11:01:51 -0800 X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="595498167" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 11:01:29 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nAG9n-00CEAT-Kb; Wed, 19 Jan 2022 20:58:07 +0200 Date: Wed, 19 Jan 2022 20:58:07 +0200 From: Andy Shevchenko To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Sergey Shtylyov , Andrew Lunn , Ulf Hansson , Vignesh Raghavendra , KVM list , "Rafael J. Wysocki" , linux-iio@vger.kernel.org, Linus Walleij , Amit Kucheria , ALSA Development Mailing List , Jaroslav Kysela , Guenter Roeck , Thierry Reding , MTD Maling List , Linux I2C , "open list:GPIO SUBSYSTEM" , Miquel Raynal , linux-phy@lists.infradead.org, netdev@vger.kernel.org, linux-spi , Jiri Slaby , Khuong Dinh , Florian Fainelli , Matthias Schiffer , Kamal Dasu , Lee Jones , Bartosz Golaszewski , Daniel Lezcano , Kishon Vijay Abraham I , Geert Uytterhoeven , "open list:SERIAL DRIVERS" , bcm-kernel-feedback-list , Zhang Rui , platform-driver-x86@vger.kernel.org, Linux PWM List , Robert Richter , Saravanan Sekar , Corey Minyard , Linux PM list , Liam Girdwood , Mauro Carvalho Chehab , John Garry , Takashi Iwai , Peter Korsgaard , William Breathitt Gray , Mark Gross , Hans de Goede , Alex Williamson , Mark Brown , Borislav Petkov , Jakub Kicinski , Matthias Brugger , openipmi-developer@lists.sourceforge.net, Benson Leung , Pengutronix Kernel Team , Linux ARM , linux-edac@vger.kernel.org, Tony Luck , Richard Weinberger , Mun Yew Tham , Eric Auger , Greg Kroah-Hartman , Yoshihiro Shimoda , Cornelia Huck , Linux MMC List , Joakim Zhang , Linux Kernel Mailing List , Linux-Renesas , Vinod Koul , James Morse , Zha Qipeng , Sebastian Reichel , Niklas =?iso-8859-1?Q?S=F6derlund?= , linux-mediatek@lists.infradead.org, Brian Norris , "David S. Miller" Subject: Re: [PATCH 1/2] platform: make platform_get_irq_optional() optional Message-ID: References: <20220112085009.dbasceh3obfok5dc@pengutronix.de> <20220112213121.5ruae5mxwj6t3qiy@pengutronix.de> <29f0c65d-77f2-e5b2-f6cc-422add8a707d@omp.ru> <20220114092557.jrkfx7ihg26ekzci@pengutronix.de> <61b80939-357d-14f5-df99-b8d102a4e1a1@omp.ru> <20220114202226.ugzklxv4wzr6egwj@pengutronix.de> <57af1851-9341-985e-7b28-d2ba86770ecb@omp.ru> <20220117084732.cdy2sash5hxp4lwo@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220117084732.cdy2sash5hxp4lwo@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-20220119_111948_965428_BA3FECEF X-CRM114-Status: GOOD ( 24.27 ) 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, Jan 17, 2022 at 09:47:32AM +0100, Uwe Kleine-K=F6nig wrote: > On Sun, Jan 16, 2022 at 09:15:20PM +0300, Sergey Shtylyov wrote: ... > Because with your change we have: > = > - < 0 -> error > - =3D=3D 0 -> no irq > - > 0 -> irq > = > For my part I'd say this doesn't justify the change, but at least I > could better life with the reasoning. If you start at: > = > irq =3D platform_get_irq_optional(...) > if (irq < 0 && irq !=3D -ENXIO) > return irq > else if (irq > 0) > setup_irq(irq); > else > setup_polling() > = > I'd change that to > = > irq =3D platform_get_irq_optional(...) > if (irq > 0) /* or >=3D 0 ? */ > setup_irq(irq) > else if (irq =3D=3D -ENXIO) > setup_polling() > else > return irq > = > This still has to mention -ENXIO, but this is ok and checking for 0 just > hardcodes a different return value. It's what we are against of. The idea is to have irq =3D platform_get_irq_optional(...) if (irq < 0) // we do not care about special cookies here return irq; if (irq) setup_irq(irq) else setup_polling() See the difference? Your code is convoluted. > Anyhow, I think if you still want to change platform_get_irq_optional > you should add a few patches converting some drivers which demonstrates > the improvement for the callers. -- = 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 B8F0DC433F5 for ; Wed, 19 Jan 2022 19:20:22 +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=YNQnKSHMlGgsseGjwx7vKyDlGpN51Xknq9FwsHtpg80=; b=AtQp1VI3xNPVPW ImE/emV/FQ576Z5i/QGnP1sXPO+fbIMJG05OIRTNahUsgOguTRsHzbGoPF8F0WwokE/bnzOq0wtV/ bF/Fkj9tP3mwaDWDXvE4qcdekBJypRWcnroI8CY1gZ9hFXZRmgVi5owfeWKodpwtrBK39YXktwjU8 nOYVUwOwF8EYA1hzFgbMIiYVW80u9j4DEXiYHRNit3yltbt59jR5CyCsN6pFS72t+kq2ExQloeEMe i60/8NE4/nvD8oQ0PHUDc5OGG3N/aqsQVJOYCG/DeMXWHk/HOfhNHWjr4QJk6x/8dqm00MutJoM0E 9tBlzHmV609kRvCzxmpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAGUu-0070JH-7w; Wed, 19 Jan 2022 19:19:56 +0000 Received: from mga09.intel.com ([134.134.136.24]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAGUm-0070GO-Qg; Wed, 19 Jan 2022 19:19:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642619988; x=1674155988; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=GrIa/eIkS4G4kb2rO6T4E37qSkXPKSwhy4Oe6Ceo9GE=; b=CEMyfjUcgEhejRO2jpNRifx/ruQ1Jjkuten77JL72jRZ4SXEiD237mCa VApQx6tK5KhnMRtvtfkje+zjBOYuWmSw6KQhEVKaTo/+yV13aMAY1+I8r YR/j1hc4F+3pmH8TylPzDIsTR7uXYu7h4LsEjHux/COts8mFEtT0l/f5i UQuNF7IPsGxwQYzMo4VY0qdHpLqTGlJlIwnavLCcOipObn4ZmywyVwpwu 2wzi1vHNcSW7zBORtN4MCfEZxPHWMhQKCkkYQYSyGy06/rIKsTgEwM+ZN 944rGzHi3OC9vRDvaxl7bS27azHVMAlWG++OxgblMNv/hWiT1QD+xRVci w==; X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="244961254" X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="244961254" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 11:01:51 -0800 X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="595498167" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 11:01:29 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nAG9n-00CEAT-Kb; Wed, 19 Jan 2022 20:58:07 +0200 Date: Wed, 19 Jan 2022 20:58:07 +0200 From: Andy Shevchenko To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Sergey Shtylyov , Andrew Lunn , Ulf Hansson , Vignesh Raghavendra , KVM list , "Rafael J. Wysocki" , linux-iio@vger.kernel.org, Linus Walleij , Amit Kucheria , ALSA Development Mailing List , Jaroslav Kysela , Guenter Roeck , Thierry Reding , MTD Maling List , Linux I2C , "open list:GPIO SUBSYSTEM" , Miquel Raynal , linux-phy@lists.infradead.org, netdev@vger.kernel.org, linux-spi , Jiri Slaby , Khuong Dinh , Florian Fainelli , Matthias Schiffer , Kamal Dasu , Lee Jones , Bartosz Golaszewski , Daniel Lezcano , Kishon Vijay Abraham I , Geert Uytterhoeven , "open list:SERIAL DRIVERS" , bcm-kernel-feedback-list , Zhang Rui , platform-driver-x86@vger.kernel.org, Linux PWM List , Robert Richter , Saravanan Sekar , Corey Minyard , Linux PM list , Liam Girdwood , Mauro Carvalho Chehab , John Garry , Takashi Iwai , Peter Korsgaard , William Breathitt Gray , Mark Gross , Hans de Goede , Alex Williamson , Mark Brown , Borislav Petkov , Jakub Kicinski , Matthias Brugger , openipmi-developer@lists.sourceforge.net, Benson Leung , Pengutronix Kernel Team , Linux ARM , linux-edac@vger.kernel.org, Tony Luck , Richard Weinberger , Mun Yew Tham , Eric Auger , Greg Kroah-Hartman , Yoshihiro Shimoda , Cornelia Huck , Linux MMC List , Joakim Zhang , Linux Kernel Mailing List , Linux-Renesas , Vinod Koul , James Morse , Zha Qipeng , Sebastian Reichel , Niklas =?iso-8859-1?Q?S=F6derlund?= , linux-mediatek@lists.infradead.org, Brian Norris , "David S. Miller" Subject: Re: [PATCH 1/2] platform: make platform_get_irq_optional() optional Message-ID: References: <20220112085009.dbasceh3obfok5dc@pengutronix.de> <20220112213121.5ruae5mxwj6t3qiy@pengutronix.de> <29f0c65d-77f2-e5b2-f6cc-422add8a707d@omp.ru> <20220114092557.jrkfx7ihg26ekzci@pengutronix.de> <61b80939-357d-14f5-df99-b8d102a4e1a1@omp.ru> <20220114202226.ugzklxv4wzr6egwj@pengutronix.de> <57af1851-9341-985e-7b28-d2ba86770ecb@omp.ru> <20220117084732.cdy2sash5hxp4lwo@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220117084732.cdy2sash5hxp4lwo@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-20220119_111948_965428_BA3FECEF X-CRM114-Status: GOOD ( 24.27 ) 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, Jan 17, 2022 at 09:47:32AM +0100, Uwe Kleine-K=F6nig wrote: > On Sun, Jan 16, 2022 at 09:15:20PM +0300, Sergey Shtylyov wrote: ... > Because with your change we have: > = > - < 0 -> error > - =3D=3D 0 -> no irq > - > 0 -> irq > = > For my part I'd say this doesn't justify the change, but at least I > could better life with the reasoning. If you start at: > = > irq =3D platform_get_irq_optional(...) > if (irq < 0 && irq !=3D -ENXIO) > return irq > else if (irq > 0) > setup_irq(irq); > else > setup_polling() > = > I'd change that to > = > irq =3D platform_get_irq_optional(...) > if (irq > 0) /* or >=3D 0 ? */ > setup_irq(irq) > else if (irq =3D=3D -ENXIO) > setup_polling() > else > return irq > = > This still has to mention -ENXIO, but this is ok and checking for 0 just > hardcodes a different return value. It's what we are against of. The idea is to have irq =3D platform_get_irq_optional(...) if (irq < 0) // we do not care about special cookies here return irq; if (irq) setup_irq(irq) else setup_polling() See the difference? Your code is convoluted. > Anyhow, I think if you still want to change platform_get_irq_optional > you should add a few patches converting some drivers which demonstrates > the improvement for the callers. -- = 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 5B573C433F5 for ; Wed, 19 Jan 2022 19:19:52 +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=tQj0njGIzGi6hRVyhYQ2hf5kRI3kcZfOoPbo1CEvTUM=; b=oVWOrfJiGXKazX Rp+SaZMwOEDsQEkqylcmQxJZanKg7T4dgoeENHZKX/8yru57sloxjUhrqBSlUeocHpHLMJmml8sno GrQ527kqRA1139cDCtw14oKWYnUe0BB2zVQyW2lEBWknUNT6EL1dT62ngWCRxn+R7wfxqVEnXpE9z az6cYKEjSBIyyHRmSo5RqdU7b67niQmz94p2YeMqcFnJVPY6YtqCCDE3HSN7H8TOFcHcwPdadGqlv b/mRsfZQ9ANevMhutfCzEgjP15eT4+ntlyF2oZughJs8u0WIxg79pBY21RgMMWbLfSYQX2hE3yJzm Ebb/G5zl2lNVsMJvYeVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAGUp-0070Hk-Kn; Wed, 19 Jan 2022 19:19:51 +0000 Received: from mga09.intel.com ([134.134.136.24]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAGUm-0070GO-Qg; Wed, 19 Jan 2022 19:19:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642619988; x=1674155988; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=GrIa/eIkS4G4kb2rO6T4E37qSkXPKSwhy4Oe6Ceo9GE=; b=CEMyfjUcgEhejRO2jpNRifx/ruQ1Jjkuten77JL72jRZ4SXEiD237mCa VApQx6tK5KhnMRtvtfkje+zjBOYuWmSw6KQhEVKaTo/+yV13aMAY1+I8r YR/j1hc4F+3pmH8TylPzDIsTR7uXYu7h4LsEjHux/COts8mFEtT0l/f5i UQuNF7IPsGxwQYzMo4VY0qdHpLqTGlJlIwnavLCcOipObn4ZmywyVwpwu 2wzi1vHNcSW7zBORtN4MCfEZxPHWMhQKCkkYQYSyGy06/rIKsTgEwM+ZN 944rGzHi3OC9vRDvaxl7bS27azHVMAlWG++OxgblMNv/hWiT1QD+xRVci w==; X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="244961254" X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="244961254" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 11:01:51 -0800 X-IronPort-AV: E=Sophos;i="5.88,300,1635231600"; d="scan'208";a="595498167" Received: from smile.fi.intel.com ([10.237.72.61]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 11:01:29 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nAG9n-00CEAT-Kb; Wed, 19 Jan 2022 20:58:07 +0200 Date: Wed, 19 Jan 2022 20:58:07 +0200 From: Andy Shevchenko To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Sergey Shtylyov , Andrew Lunn , Ulf Hansson , Vignesh Raghavendra , KVM list , "Rafael J. Wysocki" , linux-iio@vger.kernel.org, Linus Walleij , Amit Kucheria , ALSA Development Mailing List , Jaroslav Kysela , Guenter Roeck , Thierry Reding , MTD Maling List , Linux I2C , "open list:GPIO SUBSYSTEM" , Miquel Raynal , linux-phy@lists.infradead.org, netdev@vger.kernel.org, linux-spi , Jiri Slaby , Khuong Dinh , Florian Fainelli , Matthias Schiffer , Kamal Dasu , Lee Jones , Bartosz Golaszewski , Daniel Lezcano , Kishon Vijay Abraham I , Geert Uytterhoeven , "open list:SERIAL DRIVERS" , bcm-kernel-feedback-list , Zhang Rui , platform-driver-x86@vger.kernel.org, Linux PWM List , Robert Richter , Saravanan Sekar , Corey Minyard , Linux PM list , Liam Girdwood , Mauro Carvalho Chehab , John Garry , Takashi Iwai , Peter Korsgaard , William Breathitt Gray , Mark Gross , Hans de Goede , Alex Williamson , Mark Brown , Borislav Petkov , Jakub Kicinski , Matthias Brugger , openipmi-developer@lists.sourceforge.net, Benson Leung , Pengutronix Kernel Team , Linux ARM , linux-edac@vger.kernel.org, Tony Luck , Richard Weinberger , Mun Yew Tham , Eric Auger , Greg Kroah-Hartman , Yoshihiro Shimoda , Cornelia Huck , Linux MMC List , Joakim Zhang , Linux Kernel Mailing List , Linux-Renesas , Vinod Koul , James Morse , Zha Qipeng , Sebastian Reichel , Niklas =?iso-8859-1?Q?S=F6derlund?= , linux-mediatek@lists.infradead.org, Brian Norris , "David S. Miller" Subject: Re: [PATCH 1/2] platform: make platform_get_irq_optional() optional Message-ID: References: <20220112085009.dbasceh3obfok5dc@pengutronix.de> <20220112213121.5ruae5mxwj6t3qiy@pengutronix.de> <29f0c65d-77f2-e5b2-f6cc-422add8a707d@omp.ru> <20220114092557.jrkfx7ihg26ekzci@pengutronix.de> <61b80939-357d-14f5-df99-b8d102a4e1a1@omp.ru> <20220114202226.ugzklxv4wzr6egwj@pengutronix.de> <57af1851-9341-985e-7b28-d2ba86770ecb@omp.ru> <20220117084732.cdy2sash5hxp4lwo@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220117084732.cdy2sash5hxp4lwo@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-20220119_111948_965428_BA3FECEF X-CRM114-Status: GOOD ( 24.27 ) 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, Jan 17, 2022 at 09:47:32AM +0100, Uwe Kleine-K=F6nig wrote: > On Sun, Jan 16, 2022 at 09:15:20PM +0300, Sergey Shtylyov wrote: ... > Because with your change we have: > = > - < 0 -> error > - =3D=3D 0 -> no irq > - > 0 -> irq > = > For my part I'd say this doesn't justify the change, but at least I > could better life with the reasoning. If you start at: > = > irq =3D platform_get_irq_optional(...) > if (irq < 0 && irq !=3D -ENXIO) > return irq > else if (irq > 0) > setup_irq(irq); > else > setup_polling() > = > I'd change that to > = > irq =3D platform_get_irq_optional(...) > if (irq > 0) /* or >=3D 0 ? */ > setup_irq(irq) > else if (irq =3D=3D -ENXIO) > setup_polling() > else > return irq > = > This still has to mention -ENXIO, but this is ok and checking for 0 just > hardcodes a different return value. It's what we are against of. The idea is to have irq =3D platform_get_irq_optional(...) if (irq < 0) // we do not care about special cookies here return irq; if (irq) setup_irq(irq) else setup_polling() See the difference? Your code is convoluted. > Anyhow, I think if you still want to change platform_get_irq_optional > you should add a few patches converting some drivers which demonstrates > the improvement for the callers. -- = With Best Regards, Andy Shevchenko -- = linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy