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 64D28C0015E for ; Tue, 1 Aug 2023 23:52:53 +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=8Oh/69Zl5eUtavAkwr5Zcpg+NdgVsigyQKtAel0hb2E=; b=OuhKpwI1jgzry+ z0cuuyY/yoX3hwA1LZrxNjCU+GBJ6dQINg7FPwxfk0mhHtHXr/mb1e+Nk+IWKjcoONAzOQLYjwHEQ 3F8hirkl26YsEAPjourSdZAqhRsMXgO7PR1LiQPMGAPyyV9Snr9QqHqJjaOQouTtr54fG3MaRsYEs FzOTMaP+MAjxrc3hIeZukl5rgg7bp1uX37zCin9pvrmzmGc8DCJ7JI30QHkaH5eaGL9fahgEelJuZ dxZZrxqxrgqRhFR9dYhnHC4ACcmbmK/MnEOnyNc5zu0heqZGJ3z9dpHIiil31WTdRQJFWorcYGJ1B u/XMkHGBF8dT9faF89DQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQzAH-003YeB-1g; Tue, 01 Aug 2023 23:52:33 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQzAF-003Ydn-24 for linux-arm-kernel@lists.infradead.org; Tue, 01 Aug 2023 23:52:32 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 247C76172C; Tue, 1 Aug 2023 23:52:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14966C433C7; Tue, 1 Aug 2023 23:52:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690933950; bh=FbBie7f8Ak5baPz3jl5nqWc3Zkl5vg8At/LcSILAFWk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TQXyTbrvh3WcrlIVevcmc8pihTxluE0YJcl9wlEvUdQgSHCs8S2KDYK+HlJo9HIUt 5w5ZQ5hU675bvb5TjATKzJP8V76jkN3rUXr6r1oMF8cVePvXWUUDJxLmUEyHr99Vdb Izfpjujh15z8TtrArB0r4Qao/nLeTY9SnVLb4C25nRq3dIXdJMZQQdxX5nhI3GAW3c 7OwmJnaTs/42CfUINDkQ4S73XSLxFBUCjnyDqn2w4wezuF94m8ZPz/pRcYJthAXPOd OXUEPN1ipUnBd2NyzZQZWqcsGBQlbNi9Q2s41DUbSP0ljWI/5yGj/R8UMPrkCgS/Ua dZBMZCUK05LKw== Date: Wed, 2 Aug 2023 01:52:27 +0200 From: Andi Shyti To: Ruan Jinjie Cc: pierre-yves.mordret@foss.st.com, alain.volmat@foss.st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org Subject: Re: [PATCH -next] i2c: stm32: fix the return value handle for platform_get_irq() Message-ID: <20230801235227.swouzgtcro4p4itv@intel.intel> References: <20230731112755.1943630-1-ruanjinjie@huawei.com> <20230801233603.iztyd2wqhcogr72r@intel.intel> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230801233603.iztyd2wqhcogr72r@intel.intel> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_165231_746213_B740F8EA X-CRM114-Status: GOOD ( 23.43 ) X-BeenThere: linux-arm-kernel@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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Ruan, Just a nitpick here that does not affect my r-b... > On Mon, Jul 31, 2023 at 07:27:55PM +0800, Ruan Jinjie wrote: > > There is no possible for platform_get_irq() to return 0, > > and the return value of platform_get_irq() is more sensible > > to show the error reason. can we rephrase the whole commit to: i2c: stm32: Do not check for 0 return after calling platform_get_irq() It is not possible for platform_get_irq() to return 0. Use the return value from platform_get_irq(). Two notes on the commit log: - Use capital letter after "i2c: stm32: Fix..." - This is not a fix, so that we shouldn't use the word "fix" in the title. just little notes for future patches :) Thanks, Andi > > Signed-off-by: Ruan Jinjie > > --- > > drivers/i2c/busses/i2c-stm32f7.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c > > index e897d9101434..579b30581725 100644 > > --- a/drivers/i2c/busses/i2c-stm32f7.c > > +++ b/drivers/i2c/busses/i2c-stm32f7.c > > @@ -2121,12 +2121,12 @@ static int stm32f7_i2c_probe(struct platform_device *pdev) > > phy_addr = (dma_addr_t)res->start; > > > > irq_event = platform_get_irq(pdev, 0); > > - if (irq_event <= 0) > > - return irq_event ? : -ENOENT; > > + if (irq_event < 0) > > + return irq_event; > > > > irq_error = platform_get_irq(pdev, 1); > > - if (irq_error <= 0) > > - return irq_error ? : -ENOENT; > > + if (irq_error < 0) > > + return irq_error; > > Correct, from patch ce753ad1549cbe ("platform: finally disallow > IRQ0 in platform_get_irq() and its ilk") this check is already > done inside platform_get_irq(); > > Reviewed-by: Andi Shyti > > Andi > > > > > i2c_dev->wakeup_src = of_property_read_bool(pdev->dev.of_node, > > "wakeup-source"); > > -- > > 2.34.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel