Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1194275pxb; Fri, 21 Jan 2022 11:59:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDcteocAjQTSocyB0WpcaOc4sznq3coj+xMZ690g0c+/MsSaT7txyV0EUsEqietCc/LQF4 X-Received: by 2002:a63:b50d:: with SMTP id y13mr3980664pge.286.1642795150699; Fri, 21 Jan 2022 11:59:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642795150; cv=none; d=google.com; s=arc-20160816; b=tevaIdAghEJglxQjhrFhqXwvnThttoBiZc86+DNa3V8ILmSGGYY534Dbb1vqd8F87q OhvrxkhCXpDGthcR7b6yKJX2Tz6Hw3zQjgKXQLWpjSL4s2yfcQWXp6BBF8ouqr4MGnUp VEWcEOSgeQMWHJ4zTkYIgBCt8FfitJGZ3d2qh1BEcfqodzO4d8zTe9fJJ8/RlnPWcPHk 3wEy9Sjh1256fWLVLYdH2o7L2gaSYsjvjJWzpJbGy/nZGee640epaVu6wwMTDikRBk1w nu0eT+ywt9/bH2OUYfFEMCXUL0DwCNXCi8t3KFOFg8sA4uxJiqknLBDLK18rlWdj1ruv +eDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UADm4z46yZ+cH51wpsF/WZjv8Tpcr0UsGCdXYSR9kiU=; b=DpecdeBqQNPVNckFx76YjIQVzeaIPxqxVHN3HlVSmHo0LmptgQbwdZLfDIAvMEodjx J1iu8w+D6cnEE/3bR/kfGmOwEq12Ak73rgMTfl+WkA/6X3pHnFq6mhtGhHMJx7BEaWeU Yidc31w0RyjhzqAbj5Il3ekrjgmeLizEpduuN20m5SaAzgXC8n7ORbuGIuv9AJ8Tapvv VXglvIA+OKuGx6eZC+X2SD8Xol2PATfwZv1QY3a7AfmhJ/jv+dARJZUSi57FzgT5bF0z 4ANLoeFEYWo+qxNhqKAuV5k5NuBwwu7ZscwxgGC4FbJftMleAUKchJCQw7dW/LEwaivh Rjaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Ks/3HUvV"; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u5si6689356plz.74.2022.01.21.11.58.58; Fri, 21 Jan 2022 11:59:10 -0800 (PST) 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=@intel.com header.s=Intel header.b="Ks/3HUvV"; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239633AbiASTUG (ORCPT + 99 others); Wed, 19 Jan 2022 14:20:06 -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-kernel@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