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 3D32BEB64DD for ; Wed, 2 Aug 2023 01:29:14 +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:From:References:CC:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ME9VXdBIvUqlgYzL42o992m41110binf1GKD/tf4NPg=; b=4bzv+8g9a16c+H ZggTCW735LPUBhCZG7W95TuP6nzYAAocqN6dkoldRyMqiNHTq4POeEsj/xCyWrtm1SJKWBm6ihClN OuARblZJ59Cj17t5+8vQVvCs6rGzJ1RuPI7zj9UfpsG7y0Pir0MDFjCFfyAGJWcxZE/UmBA4ZwJKF 8qjUbFYYLGji9v8GiKykj6+7q87k8ysZBgv8rnx5tX2ly1KnFKOZmI0NSe8M4hucjOpSzkmk0oD1s 43MT0Y4dWGQ4jqKlDSMqbqJk891HEHKHa9oYPCRoK+V79czxZjt78ya8CtRbBoTW/BEtrAViQvsaK DctzKp7cH4M0n0W6N5EA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qR0fS-003gkG-1g; Wed, 02 Aug 2023 01:28:50 +0000 Received: from szxga08-in.huawei.com ([45.249.212.255]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qR0fP-003gi9-1O for linux-arm-kernel@lists.infradead.org; Wed, 02 Aug 2023 01:28:49 +0000 Received: from kwepemi500008.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4RFvVG0kJnz1GDP2; Wed, 2 Aug 2023 09:27:34 +0800 (CST) Received: from [10.67.109.254] (10.67.109.254) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 2 Aug 2023 09:28:35 +0800 Message-ID: <65f1d686-815c-b0c7-4e08-b97b764be0ca@huawei.com> Date: Wed, 2 Aug 2023 09:28:34 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH -next] i2c: stm32: fix the return value handle for platform_get_irq() Content-Language: en-US To: Andi Shyti CC: , , , , , , References: <20230731112755.1943630-1-ruanjinjie@huawei.com> <20230801233603.iztyd2wqhcogr72r@intel.intel> <20230801235227.swouzgtcro4p4itv@intel.intel> From: Ruan Jinjie In-Reply-To: <20230801235227.swouzgtcro4p4itv@intel.intel> X-Originating-IP: [10.67.109.254] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500008.china.huawei.com (7.221.188.139) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230801_182847_641399_13522A2D X-CRM114-Status: GOOD ( 18.34 ) 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 On 2023/8/2 7:52, Andi Shyti wrote: > 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 :) Thank you for your valuable advice! I will keep an eye out for these in 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