Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1991672rwd; Thu, 18 May 2023 22:22:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5D8Z0u+eTF5k1ta0U3GMnEjJz4L2TtpLD9CGIt4s9fVNEduKCNrAdFOXT+H8wcU9YiWUYj X-Received: by 2002:a05:6a00:114c:b0:64c:a2f6:88e0 with SMTP id b12-20020a056a00114c00b0064ca2f688e0mr1602778pfm.28.1684473761889; Thu, 18 May 2023 22:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684473761; cv=none; d=google.com; s=arc-20160816; b=mLZsRyEmKJcvnWITY45t7F4P/3btHeE2ir5KTMQrjN2oBNRzNyxHlSTMPGE+hAbPXR Te0H9KcPwtv/ezChMdPz1nEzmXj1q7ZNf4bhbMqWe1sCCEfZELg4WfnKQvLFa20nCDpj A+SnaHnZyI06Zmw0Cy/oENNjKbKRvY8XTmG8FemR2VBPa4PiXyOpP/rnBh+c9SwXAm8v zQbmHHkqkkERghklAo+DpmhFJrM9IdlL0JpCVDU6cRzjVSRpO+CKw+InBp6k4EbpzwIX oABXiEAJVUt6HoIDgmiFA0HniS/hgPvYnVugm2aMpRkO+2hf6cDyE1P2o99xL+8I0tKY RvLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=JfbxFVUmc/KzvVhEC8vdQgF5kFe1WFt3rzR4UINE0fo=; b=no+IBXmVsVX4603Deb/wwfMgu0T9YotTcjw0InoOOb50lXJxBcv2jlqz52UdxgSDRz VfXgqFO0ijNEnI5BbeNZnuF3SC0Shct9o3MkUw8rxb0IAET0lN8UjuZAVdC/XCNzvfC2 QQKpy+9YHcNsSLX/MrwA9/lelxxaMxIC1j57oGUCb80yU8Tq1AqzB5vb2fnNq68KUKm3 arF1Oy4J6S6u+AmTuT9UND2f/30pnREE/iDQyXdHAruMFwqgF7ui8HP8omnMplaYYwiN d/RUCWleIj78NE2y25sakr8GktogzVNvqGMlcMcnzUl5azAKXwxwoSTRrMbD0WR9E7vw dXaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=BFi0u5sI; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r22-20020aa79636000000b006293f8330fcsi3244508pfg.322.2023.05.18.22.22.27; Thu, 18 May 2023 22:22:41 -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=@gmail.com header.s=20221208 header.b=BFi0u5sI; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230274AbjESFBB (ORCPT + 99 others); Fri, 19 May 2023 01:01:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230233AbjESFAx (ORCPT ); Fri, 19 May 2023 01:00:53 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A08B5198A; Thu, 18 May 2023 22:00:32 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4eff4ea8e39so3149341e87.1; Thu, 18 May 2023 22:00:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684472430; x=1687064430; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=JfbxFVUmc/KzvVhEC8vdQgF5kFe1WFt3rzR4UINE0fo=; b=BFi0u5sIoEnnX4okI+aOE7hqReySKr/IeZj7zzxVZhgribIxFlafyHNvVilTaGLzmN knIms4YLm7U1y/I5CNlsVXcBP9x8QeZROW5X41r24p2hhc7Ht3Y4EDGjq93s+4l3lDsJ Pk/DbGLMigKfroPs0SUi9ijtAABZtaIECKrtHjRAj4DFK6yRhSltBg58NMpe4kky+Z5O VR84UsYsFePdUZ8Ndp3YYDRJmnp1CZ6RWZ5xZ1xMg3MBPh2F2h1/Q+8YX8HR0dCfZZNo ZwiEpoF6NMGYC9Ro0HSPdvsk7wNlp2nw4vOoWzS/zWeG4WYgrDi7X3Gbvss9CZVlDv8q oVAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684472430; x=1687064430; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JfbxFVUmc/KzvVhEC8vdQgF5kFe1WFt3rzR4UINE0fo=; b=jBCIvaJXkIPkyRLULvJYXewhUmpnIy6ICOms4Bv3nLFzAr+oZAa0dpwrninDcM0sn/ AJl4fvps5X6mM92KD/xA1DSJJON+5yNlkc2lO3xA2tI+4DtuhhbR3uaur5WPOUWQHHMz EutDu0ikgvlDV3id+xsf84RjpkUF/ECVdHLM4UasLYeIwo2pisytu061WAa1KBCU4DLm /Mb5qWvmsC0saOaOKY9qf5g2QWBtb/nnldUD+8LABnIox2F7s5WBo4cLeHZpflmuJhIi FxyYYJNbInQF0smtKG7RCFMY52S++rCJJuAmSW5npCYyTEZOsp2MzbEG4GMYDG/2Vx9/ EPZg== X-Gm-Message-State: AC+VfDzREo2Jr5BHxuamUlnoSxeoqwMEEKoLSEJg937rhPXos4LGR16O voFUb78BLtxLLAdrnpdwOAk= X-Received: by 2002:ac2:5e81:0:b0:4f3:872d:10ff with SMTP id b1-20020ac25e81000000b004f3872d10ffmr313027lfq.64.1684472429409; Thu, 18 May 2023 22:00:29 -0700 (PDT) Received: from [192.168.1.126] (62-78-225-252.bb.dnainternet.fi. [62.78.225.252]) by smtp.gmail.com with ESMTPSA id w4-20020a05651204c400b004db3900da02sm467200lfq.73.2023.05.18.22.00.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 May 2023 22:00:28 -0700 (PDT) Message-ID: <1a3a84d4-1955-f0ee-5c6d-ab36fddc5e15@gmail.com> Date: Fri, 19 May 2023 08:00:27 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v4 2/7] iio: mb1232: relax return value check for IRQ get Content-Language: en-US, en-GB To: Andy Shevchenko Cc: Matti Vaittinen , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Andreas Klinger , Marcin Wojtas , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?UTF-8?Q?Jonathan_Neusch=c3=a4fer?= , Linus Walleij , Paul Cercueil , Wolfram Sang , Akhil R , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, netdev@vger.kernel.org, openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org, linux-mips@vger.kernel.org References: <429804dac3b1ea55dd233d1e2fdf94240e2f2b93.1684220962.git.mazziesaccount@gmail.com> From: Matti Vaittinen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 5/17/23 19:47, Andy Shevchenko wrote: > On Tue, May 16, 2023 at 10:12:41AM +0300, Matti Vaittinen wrote: >> fwnode_irq_get() was changed to not return 0 anymore. >> >> Drop check for return value 0. > > ... > >> - if (data->irqnr <= 0) { >> + if (data->irqnr < 0) { >> /* usage of interrupt is optional */ >> data->irqnr = -1; >> } else { > > > After this change I'm not sure we need this branch at all, I mean that -errn is > equal to -1 in the code (but needs to be checked for silly checks like == -1). > > Hence > > Entire excerpt can be replaced with > > if (data->irqnr > 0) { > I agree. Furthermore, at a quick glance it seems the whole irqnr could be dropped from the private data, and the private data struct could probably be static. I'd send them as separate clean-ups though as those changes are not really related to this return-value series. Yours, -- Matti -- Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~