Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755456AbbLAHZn (ORCPT ); Tue, 1 Dec 2015 02:25:43 -0500 Received: from mail.karo-electronics.de ([81.173.242.67]:50756 "EHLO mail.karo-electronics.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754916AbbLAHZl convert rfc822-to-8bit (ORCPT ); Tue, 1 Dec 2015 02:25:41 -0500 Date: Tue, 1 Dec 2015 08:24:16 +0100 From: Lothar =?UTF-8?B?V2HDn21hbm4=?= To: Duan Andy Cc: Andrew Lunn , "David S. Miller" , Fabio Estevam , Greg Ungerer , Kevin Hao , Lucas Stach , Philippe Reynes , Richard Cochran , Russell King , Sascha Hauer , "Stefan Agner" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , Jeff Kirsher , "Uwe Kleine-K?nig" Subject: Re: [PATCH 1/3] net: fec: Remove redundant checks for NULL clk pointer Message-ID: <20151201082416.4ce7dd4c@ipc1.ka-ro> In-Reply-To: References: <1448883168-30742-1-git-send-email-LW@KARO-electronics.de> <1448883168-30742-2-git-send-email-LW@KARO-electronics.de> Organization: Ka-Ro electronics GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1913 Lines: 51 Hi, > From: Lothar Waßmann Sent: Monday, November 30, 2015 7:33 PM > > To: Andrew Lunn; David S. Miller; Estevam Fabio-R49496; Greg Ungerer; > > Kevin Hao; Lothar Waßmann; Lucas Stach; Duan Fugang-B38611; Philippe > > Reynes; Richard Cochran; Russell King; Sascha Hauer; Stefan Agner; linux- > > kernel@vger.kernel.org; netdev@vger.kernel.org; Jeff Kirsher; Uwe Kleine- > > König > > Subject: [PATCH 1/3] net: fec: Remove redundant checks for NULL clk > > pointer > > > > NULL is a valid argument to clk_enable()/clk_disable(). Remove redundant > > checks before calling those functions. > > > > Signed-off-by: Lothar Waßmann > > --- > > drivers/net/ethernet/freescale/fec_main.c | 23 +++++++++-------------- > > 1 file changed, 9 insertions(+), 14 deletions(-) > > > > diff --git a/drivers/net/ethernet/freescale/fec_main.c > > b/drivers/net/ethernet/freescale/fec_main.c > > index d2328fc..e17d74f 100644 > > --- a/drivers/net/ethernet/freescale/fec_main.c > > +++ b/drivers/net/ethernet/freescale/fec_main.c > > @@ -1873,35 +1873,30 @@ static int fec_enet_clk_enable(struct net_device > > *ndev, bool enable) > > } > > mutex_unlock(&fep->ptp_clk_mutex); > > } > > - if (fep->clk_ref) { > > - ret = clk_prepare_enable(fep->clk_ref); > > - if (ret) > > - goto failed_clk_ref; > > - } > > + > > + ret = clk_prepare_enable(fep->clk_ref); > > + if (ret) > > + goto failed_clk_ref; > > If you want to clean up the code, pls also remove "fep->clk_enet_out" check in this brace. > I would have to reintroduce it in the later patch to frame the call to fec_reset_phy(). Lothar Waßmann -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/