Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp361013ybz; Fri, 17 Apr 2020 02:29:46 -0700 (PDT) X-Google-Smtp-Source: APiQypKj0h52cDT6z/AXuIfhzc5GkmNdTmhQ57oaHEvMsroVjcB9Vs/J6N5swDN+IT5raIXHadYt X-Received: by 2002:a17:906:78c:: with SMTP id l12mr1983812ejc.189.1587115786179; Fri, 17 Apr 2020 02:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587115786; cv=none; d=google.com; s=arc-20160816; b=VO0v2ZXqPZPi/qnWhR2EJQTM0xX1ZCBUUB6/qYBa2LAeEp4aXSYwUIqgR9oBqETxq0 /1BK2la3ACKWjG7nd51fHoxjr8Tlc7J8eT760Ve4kAXz/y4Cc5ZsHFUmifGUKDLO7Yqx WXeBG/kUREQ3japXKlN06bO3hWmRkm5WDwzIqmFWOnNbQUccTRRxC8NRGAdAg2PnznS5 BVe3Zt5IxzyNbBBVwN8pdAVe1XNwzNH5rvHAIu5OGY2iEt9c5zhS7RzTQt+5j8a6fEJ+ RPdEAKy7T8iTfn3VBt9b8Opo97vNUDxI3Nc1il0kQLnZcu/mCnMiO4R9kMPmmm/6qCKS G9Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=XlGUZqw+jrAS6ieTYoAuxs9RQKcypT6nzhcddAJ3oBs=; b=lxvKD/7qgvjC/n+oaldkjmheXoZuZ8YYXcDjRl3Rk7WriIEzqOgefcSSM67byinu2T bL713Fs8aTT2TiVkKOHw3om+zXU1AZQSR22BBPja0Th9gBnml8cRvUdKtRtDutNV9yd2 FykRejNHX3SHHxRAWXmt7XzCSs4+lTUVxEMItkIA+Qvz7svc8fVz9/gtf/fqgJGBMQ1c TiLruQ4GDIR9ohZA3AvuMIo/lBWvwGmeECsJ0FmIwMG+DFdR3txZK52MBkefzOgcZkUE GXFzzGVxAMDA7K0osjLBklyuZU1lKRns6CmHEG4UcxVwgxg7tAXalIAoj7xaJxuCTEZJ CjVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="y/Ywt9ad"; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cm14si7182296edb.546.2020.04.17.02.29.22; Fri, 17 Apr 2020 02:29:46 -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; dkim=pass header.i=@linaro.org header.s=google header.b="y/Ywt9ad"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730232AbgDQJ0J (ORCPT + 99 others); Fri, 17 Apr 2020 05:26:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729987AbgDQJ0I (ORCPT ); Fri, 17 Apr 2020 05:26:08 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3066DC061A0C for ; Fri, 17 Apr 2020 02:26:08 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id d17so2206091wrg.11 for ; Fri, 17 Apr 2020 02:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=XlGUZqw+jrAS6ieTYoAuxs9RQKcypT6nzhcddAJ3oBs=; b=y/Ywt9ad2jWK04NVwdvXe99a6lul3V9rTx0HxhP56trpnnzty2YutCuV7V3HEQD78A epYHZqmNexqv6IkOEFvC4Yzu5A2dQUABHZ+6jme5CCysIZqmR0U+fqeyEixt6xF7nfXw Wr8IhEpagZWXPVPqysZwaQliHsHyMVn/Y4C+I2UC6UAn545+hDWFoQ4HKYOs0KpkpFB7 orR7GBGjPbo3fD9WoH8bjPYrS6AZg+K1+Xk5wSNrbmeZXMX6jVJ0s93VLpuBb6IWBswH MTVaQSa5C/puzLPZWlG4ey1jcwPLo5A/pi6kQz+UG4za8+huqWy9Qs91XdIKunephl9s HQzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=XlGUZqw+jrAS6ieTYoAuxs9RQKcypT6nzhcddAJ3oBs=; b=dddIhZHJVeTAU1p51mlP5KmFUYe+qEjJmF/orBOKYOVij+kP7q4Mr42ZkSqd2aft5m 3zQipHMf72YffKincJgksPmx5KgaqEgke/5M+POcojUnjHFwY6hnnlGq0j45A7yGBuhm 13zhh+QsSRGkQhQ6+ftluu2M+aiOqpC2zYWMhJmJmbtl3Nc8z3dY7LKyRh9jl2RP/nmT rn4dGzJjfgA38CT079Ir/iKhEo84JadstPjaF9H210JvJMjvKSWDl8gTX9LkBqMhkb9Q dlWPF8o+XOV36RePzfSZxvvwBygZpNXpEA6lUnh5B3S+bZqrgxDhTcZ9/x+0SRc9GJrx xpKQ== X-Gm-Message-State: AGi0PubtmC7jjISTULv4bAcuMdnNjzjTiRdQqrvJquACaN7RWN+ymYm9 +aKYK5wDO7em4p3fA7wu+gLewlv7C6g= X-Received: by 2002:a5d:69c9:: with SMTP id s9mr2846343wrw.307.1587115566938; Fri, 17 Apr 2020 02:26:06 -0700 (PDT) Received: from dell ([95.149.164.124]) by smtp.gmail.com with ESMTPSA id h5sm12635867wrp.97.2020.04.17.02.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2020 02:26:06 -0700 (PDT) Date: Fri, 17 Apr 2020 10:27:05 +0100 From: Lee Jones To: Tang Bin Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] mfd:asic3:Delete redundant variable definition Message-ID: <20200417092705.GG2167633@dell> References: <20200403042020.17452-1-tangbin@cmss.chinamobile.com> <20200416070802.GQ2167633@dell> <211e7521-639d-804c-f332-bfed0cf315df@cmss.chinamobile.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <211e7521-639d-804c-f332-bfed0cf315df@cmss.chinamobile.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 16 Apr 2020, Tang Bin wrote: > 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. Just submit the patch and we can discuss it there. These kind of messages always require a lot of extra faff to process. -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog