Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1481241pxj; Fri, 4 Jun 2021 16:05:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8mC5yb+QKVYAiWiSMflchIZ2FkeIA8St2IShEZ/dCDFYYqPUkcuhZWdkpUeplfS/GpJHu X-Received: by 2002:a17:906:dfd1:: with SMTP id jt17mr6496107ejc.486.1622847934743; Fri, 04 Jun 2021 16:05:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622847934; cv=none; d=google.com; s=arc-20160816; b=P0BnzpWMmMtlqBdHCxjtH1tURL/EsfSTILdqeMvrbfjzphKIGSknMQssU9ZUMNeRok nTim0Avn6hBlKk5tXeAxR5lTowXA4C82rQT+wT9WktUajM6mwkAWshPQ1I2Xj0JLnnoh ccnrYyHM1jWfQUv0jq0BD5AiBD+ynr/xMocqVrJ4XCvDLoAOAwR7/BkX4uhDSiWbpG68 wqWYNtZBwJ+4bOuRZ+SPis+BdE2KhLTaB66YdheQrXrsY+Ua+0Xm54DwREvjju2OZh/s nV/ZTDB0wCh/bGVhIxGLPmi9Ti/GQ3YjNbqaStxYyIrV9hBDyfOI5m+G9+7rgnFysAOP UOWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XnHNL9lXkaLbHEM9f6N6hjdSr6gfj4Pqg+S2saBsR9A=; b=z71eR2vDMl4ri5N4SXtOvyPd657keexghM2uBrblapX403y8Ba28uY+4gGlLCmnwJi AHAvTKr5jP1BaIMWJSCKXwMrGZFbJVSR9tZ/0o1FAZL9I3mCleN1gb2R7B0Sp5rFZreU H4tEfy5dlssuuAW9soxQa7cO5d+jaWdfzpyM90jPs2L/bM91kkgsj6XrANVH0YQrJfcL EYEs2iUH9y4KNutzgZxh+bWBnbPgbpZQTrdh5IhZ1WDdXg2YXfM7xXMW6B4+o06j0kY3 VzshRjB6F9hcdK3rQ+ACk944hS/7bvMLCU/h5ETsyXlHzLSYaeumnr0D6K2wji9wDRtc AWfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="I3N7/Rcl"; 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 k2si5725899ejd.410.2021.06.04.16.05.11; Fri, 04 Jun 2021 16:05:34 -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=@lunn.ch header.s=20171124 header.b="I3N7/Rcl"; 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 S231778AbhFDXEY (ORCPT + 99 others); Fri, 4 Jun 2021 19:04:24 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:46322 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229853AbhFDXEW (ORCPT ); Fri, 4 Jun 2021 19:04:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=XnHNL9lXkaLbHEM9f6N6hjdSr6gfj4Pqg+S2saBsR9A=; b=I3N7/RclzjfqTaXqB+0wsQhxSX CI1GZtiPlJAkjBhoBeTlmWQQVBM3TdonWBHGE1ztKy3NgVJS/xKowfsYLgWEETUqM2/oY0GslNIYl hZMCt8bujzA0Thi8Sp2qhTQoC99R+PBs+3ycFwj/rZ/9ZfNYNKOsmNEXe3o89EaGk5lI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1lpIpZ-007sCc-AA; Sat, 05 Jun 2021 01:02:21 +0200 Date: Sat, 5 Jun 2021 01:02:21 +0200 From: Andrew Lunn To: Heiner Kallweit Cc: dingsenjie@163.com, richardcochran@gmail.com, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dingsenjie Subject: Re: [PATCH] net: phy: Simplify the return expression of dp83640_ack_interrupt Message-ID: References: <20210604032224.136268-1-dingsenjie@163.com> <91609670-c3a2-2281-514e-01dfe7907f11@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <91609670-c3a2-2281-514e-01dfe7907f11@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 04, 2021 at 09:49:17AM +0200, Heiner Kallweit wrote: > On 04.06.2021 05:22, dingsenjie@163.com wrote: > > From: dingsenjie > > > > Simplify the return expression. > > > > Signed-off-by: dingsenjie > > --- > > drivers/net/phy/dp83640.c | 7 +------ > > 1 file changed, 1 insertion(+), 6 deletions(-) > > > > diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c > > index 0d79f68..bcd14ec 100644 > > --- a/drivers/net/phy/dp83640.c > > +++ b/drivers/net/phy/dp83640.c > > @@ -1141,12 +1141,7 @@ static int dp83640_config_init(struct phy_device *phydev) > > > > static int dp83640_ack_interrupt(struct phy_device *phydev) > > { > > - int err = phy_read(phydev, MII_DP83640_MISR); > > - > > - if (err < 0) > > - return err; > > - > > - return 0; > > + return phy_read(phydev, MII_DP83640_MISR); > > } > > > > static int dp83640_config_intr(struct phy_device *phydev) > > > This would be a functional change. You'd return a positive value > instead of 0. And looking a bit further down in the code: static int dp83640_ack_interrupt(struct phy_device *phydev) { int err = phy_read(phydev, MII_DP83640_MISR); if (err < 0) return err; return 0; } static int dp83640_config_intr(struct phy_device *phydev) { int micr; int misr; int err; if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { err = dp83640_ack_interrupt(phydev); if (err) return err; So a positive value is going to break the driver. NACK Andrew