Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp284444pxk; Wed, 23 Sep 2020 03:12:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAgWgeH1czizEfJjCPz+tUqByp/fFkE65LuCRE+oyKbVJ/FlijH193pjJeWK3+8UKKIGfl X-Received: by 2002:a17:906:2655:: with SMTP id i21mr9122484ejc.511.1600855929523; Wed, 23 Sep 2020 03:12:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600855929; cv=none; d=google.com; s=arc-20160816; b=aKC9H8VOJVuWgAvEtd3y2ZTidCyscS1igByYFzPzRSTJ/piyIerSO6ypjQrAO8Cef3 41MGl7/x1/xkkGgJ4FpcXsks7bAuV+iKgXsWN8ON3BxkxS7Gn/9N+EWXPcw+OrxDLG5o dJxZgFBlioFOtgXmB7dO4oQ8D5YYiEzbPfImVRc7NScik6nVAM+FDVt3ZHOII55sTxKH tXMyHtkGNJcrzsr6QnBBMOhbL91Xjw+BcjpJiiHVSHZy1TYNuPb5mBvdfzXX9DWPMtv6 irUqfjsoQ8DUlq3Q13Uo337HfwgO8aZokDUz93PenZJ3lDShiCNjyNU0d4hkSimp+zuh GESA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Eo/wSw4VIaIgxNkRQAPfjQYoKWETuFA6eRrgAzJ/XHo=; b=dVC+mk11cNNAo+54yhE4ffg5LyTW3EZD1/QihpFu8VLXx+wdJv7VeKxbbuKPTFZY55 IlfGTUrq7KyML36w7DKKpK+/e0qNtGTzDI4g2FmgL/2VB+KP9brh0ia9hUrTeWCQzrOP w5YryprPnMeJNSmLlxe74p55MyQ6BY9yYwXvXM3bESbkz+tb0m+fGc4PReV1FI/0HzFv PmGija756kMAr+Y+KjAzJO+EXai4OPzxtYomGdcAVO4FeUb0SHLcts0qBoEjKf15G4gp /RWS6Q6JWHQ+CljrLueoxczHJZ2IJRAiu2tn+8SB1GqJWTHJvN9pdGqFH+lyoHzvq11r gYfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sojKp23C; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si12545591edr.363.2020.09.23.03.11.45; Wed, 23 Sep 2020 03:12:09 -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=@gmail.com header.s=20161025 header.b=sojKp23C; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726594AbgIWKKN (ORCPT + 99 others); Wed, 23 Sep 2020 06:10:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726485AbgIWKKN (ORCPT ); Wed, 23 Sep 2020 06:10:13 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5E18C0613CE; Wed, 23 Sep 2020 03:10:12 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id e23so26963796eja.3; Wed, 23 Sep 2020 03:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Eo/wSw4VIaIgxNkRQAPfjQYoKWETuFA6eRrgAzJ/XHo=; b=sojKp23CaX/x5UEyerSOlNDBFebtWUgmFC6eFuTcwwNJ7d7SJso1iRZrB7vS+w6C32 /G/PecH5ThYjOz59Zv5MTey5MBP5wS7oMWP8fXdc5CqesGf0HZEIUnr94RsSwxvqEI04 8EuBBgPSCKUwouPToc8fNMb4USiMc7LvI5HUEPRlHcaKXEAlBQuW79PLLOVkkEAApOLV tuHHPZT8CmqjGAYBUN/ovQbj66TVXhuczf5NFvkHGPiOrcOLRLrYHcbc+4yzZniv1/tg j6Pn3k6Cj7FUFCZpYd9CWb7G05Ms2EkQ8lU5tHUIbsB2NhbHyiNuKxaRSsIYfKIYFtZK B4yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Eo/wSw4VIaIgxNkRQAPfjQYoKWETuFA6eRrgAzJ/XHo=; b=A0dC5ttg79/UBx3u4fT8iv5zU3olEcLFNHlZnK6K/hfhvjApQz1ZD9D9QeuV4gqdro DhHe705x2Ldaqt9e+qf+hnfFJkUocUXm6Be4+iq5gcxqxVBYd7ooD7dL8vMWG+39vbSd Wx6zFLdwPcmXw2a+ePcsZMJUJSS8oqEoyJEqfvX0YqyrKCH/VW9u2gCha1bM1RmwxDqI 537znF+RAk0SQ8zc1yE5XoLRU3LfBWmx/mG3svUet/nFt1wujnYF2vjz2woGVvWnE6rY tTKZR/iSeLv4Fwa8RVQV5VbVjVWE8mrKBmkumFiAwcQkSUUlCD2N/q9MLqya6ETobEfQ INxA== X-Gm-Message-State: AOAM5325c8DqSEC19h+ykYzqGW5OQo/UcKj4X0/zSZEOKbNb1EpLiKU1 yBAe59ChwGqIzJPR1lva9aI= X-Received: by 2002:a17:906:9389:: with SMTP id l9mr9624357ejx.537.1600855811493; Wed, 23 Sep 2020 03:10:11 -0700 (PDT) Received: from ?IPv6:2003:ea:8f23:5700:c43a:de91:4527:c1ba? (p200300ea8f235700c43ade914527c1ba.dip0.t-ipconnect.de. [2003:ea:8f23:5700:c43a:de91:4527:c1ba]) by smtp.googlemail.com with ESMTPSA id r16sm14064588ejb.110.2020.09.23.03.10.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Sep 2020 03:10:11 -0700 (PDT) Subject: Re: [PATCH] net: mdio: Remove redundant parameter and check To: Tang Bin , davem@davemloft.net, andrew@lunn.ch, kuba@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Zhang Shengju References: <20200923100532.18452-1-tangbin@cmss.chinamobile.com> From: Heiner Kallweit Message-ID: <860585f8-65a7-3363-18cd-dc398772ba00@gmail.com> Date: Wed, 23 Sep 2020 12:10:06 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200923100532.18452-1-tangbin@cmss.chinamobile.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23.09.2020 12:05, Tang Bin wrote: > In the function ipq8064_mdio_probe(), of_mdiobus_register() might > returned zero, so the direct return can simplify code. Thus remove > redundant parameter and check. > > Signed-off-by: Zhang Shengju > Signed-off-by: Tang Bin > --- > drivers/net/mdio/mdio-ipq8064.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/mdio/mdio-ipq8064.c b/drivers/net/mdio/mdio-ipq8064.c > index 1bd1885..33cccce 100644 > --- a/drivers/net/mdio/mdio-ipq8064.c > +++ b/drivers/net/mdio/mdio-ipq8064.c > @@ -102,7 +102,6 @@ ipq8064_mdio_probe(struct platform_device *pdev) > struct device_node *np = pdev->dev.of_node; > struct ipq8064_mdio *priv; > struct mii_bus *bus; > - int ret; > > bus = devm_mdiobus_alloc_size(&pdev->dev, sizeof(*priv)); > if (!bus) > @@ -125,12 +124,9 @@ ipq8064_mdio_probe(struct platform_device *pdev) > return PTR_ERR(priv->base); > } > > - ret = of_mdiobus_register(bus, np); > - if (ret) > - return ret; > - > platform_set_drvdata(pdev, bus); Before your patch this is called only after of_mdiobus_register() returns successfully. Now it's called unconditionally before. Are you sure this can't have a side effect? > - return 0; > + > + return of_mdiobus_register(bus, np); > } > > static int >