Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1102799ybz; Thu, 16 Apr 2020 02:58:33 -0700 (PDT) X-Google-Smtp-Source: APiQypKltVr3kEolhi2PlhdCox0rmIcEjs/TMRT9oE5ILrKK5hbVnBmn1X2J8jwQQ+bjYym7j9Mk X-Received: by 2002:a17:906:35d0:: with SMTP id p16mr8750435ejb.77.1587031113180; Thu, 16 Apr 2020 02:58:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587031113; cv=none; d=google.com; s=arc-20160816; b=PLxVyQAfxSLSBJL0PpZInmG+Aj4KbgpVLMoERQnJDqYBzx2fFIABSvjwEBfSUpcMD1 oPSWCtGoDFb4YzI4BVr6TNB8j8jXFtqJzkovVWoViN8Ktznr109qWN5TpT1LobqjZOBu LwNAeEUO6DHV4rRFrBCK/SFNWH+3S7T8ZY2nOGG7MpZv5xSu5pAXKEK4/6XfAPPv98k/ T5AsjRblRD+TyHH19iMW2a1KFQwRJKLLwhaFPHo6I2OL+iZI/UkIdAcvfNuWfSt3gYW+ 6bUFtoC4rppuAMSGQ09+8Hev5HtuVmURPHpKQJbjOAfS/beUl9rH5Su/wm2A4p7Z44Ne PeZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ZBn9TyXrNdIkWlh3Rq1Ydg3uO3KI6ch1m4ptSLPADk0=; b=0uKnhNkHMYDtT1hlpfcXKWjErzfxZOASLD88QeDzjeYhZmd17Gga1KrfgTTzUdhJsT 7a3k8YvCiuQ7AhV2vjHNXLSHEoolJAx/09BP6pEtU6X89pGkyoYBqQtWPyRvqLPP/mb8 b1AuGxVorKMc7G1HWkBH5CSVIIMLyjKwCYLY9B4lz1EpdwNstJMXqRCRy9KhT1J43hk/ KygeF8SLNYH2qs8dQbiJh+U1ad9rFdSGxq8hvOl598Iz8nPUgYWkUSNaE7FpQNPxHdMw KfhYjBZHZPA20pLryb8iYZxMqcLrwa6Y18NJ+ow3VxgnyqxTaaXxzaI/yJW7s5Q9uAxY XM2Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch19si10954569ejb.240.2020.04.16.02.58.09; Thu, 16 Apr 2020 02:58:33 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504377AbgDPJ5G (ORCPT + 99 others); Thu, 16 Apr 2020 05:57:06 -0400 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:47500 "EHLO cmccmta2.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504285AbgDPJ5F (ORCPT ); Thu, 16 Apr 2020 05:57:05 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.19]) by rmmx-syy-dmz-app06-12006 (RichMail) with SMTP id 2ee65e982ba37b9-8383c; Thu, 16 Apr 2020 17:55:48 +0800 (CST) X-RM-TRANSID: 2ee65e982ba37b9-8383c X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from [172.20.145.111] (unknown[112.25.154.146]) by rmsmtp-syy-appsvr10-12010 (RichMail) with SMTP id 2eea5e982ba3927-444bb; Thu, 16 Apr 2020 17:55:47 +0800 (CST) X-RM-TRANSID: 2eea5e982ba3927-444bb Subject: Re: [PATCH] mfd:asic3:Delete redundant variable definition To: Lee Jones Cc: linux-kernel@vger.kernel.org References: <20200403042020.17452-1-tangbin@cmss.chinamobile.com> <20200416070802.GQ2167633@dell> From: Tang Bin Message-ID: <211e7521-639d-804c-f332-bfed0cf315df@cmss.chinamobile.com> Date: Thu, 16 Apr 2020 17:57:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200416070802.GQ2167633@dell> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Lee: On 2020/4/16 15:08, Lee Jones wrote: > On Fri, 03 Apr 2020, Tang Bin wrote: > >> In this function, 'ret' is always assigned, even if 'pdata->leds' >> don't carry out,it has already been assigned a value in the above >> code, including '0',so it's redundant. > Which line initialises/assigns 'ret' before this one?     I think it maybe my fault before, because I treat get resource and irq succeed. But now I have two questions  to ask you:     Q1: About asic3_mfd_probe()?           In the function asic3_mfd_probe(), if get resource or irq failed, the value returned just detected and dev_dbg() error message, but there were no error return. What I think the modify should be as follows:     mem_sdio = platform_get_resource(pdev, IORESOURCE_MEM, 1);     if (!mem_sdio) {         dev_dbg(asic->dev, "no SDIO MEM resource\n");         ret = -EINVAL;         goto out;     }     irq = platform_get_irq(pdev, 1);     if (irq < 0) {         dev_dbg(asic->dev, "no SDIO IRQ resource\n");         ret = irq;         goto out;     }     If the function do like this, the 'ret = 0' in line 993 maybe redundant.    Q2: About asic3_probe()?           In the line 995, if the function asic3_irq_probe() failed, it will print error message by the internally called function platform_get_irq(), so the dev_err() in the line 997 is redundant, should be delete.     I'll wait actively, and submit the corresponding patch according to your reply. Thanks, Tang Bin