From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753268AbdFVN3E (ORCPT ); Thu, 22 Jun 2017 09:29:04 -0400 Received: from mail-yw0-f172.google.com ([209.85.161.172]:32987 "EHLO mail-yw0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753194AbdFVN3C (ORCPT ); Thu, 22 Jun 2017 09:29:02 -0400 MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] In-Reply-To: <20170622085815.xaw6dn56t2yjrdm4@mwanda> References: <1498115276-1601-1-git-send-email-gilad@benyossef.com> <1498115276-1601-6-git-send-email-gilad@benyossef.com> <20170622085815.xaw6dn56t2yjrdm4@mwanda> From: Gilad Ben-Yossef Date: Thu, 22 Jun 2017 16:29:01 +0300 Message-ID: Subject: Re: [PATCH 5/7] staging: ccree: add clock management support To: Dan Carpenter Cc: Greg Kroah-Hartman , Linux kernel mailing list , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, Ofir Drang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 22, 2017 at 11:58 AM, Dan Carpenter wrote: > On Thu, Jun 22, 2017 at 10:07:51AM +0300, Gilad Ben-Yossef wrote: >> +int cc_clk_on(struct ssi_drvdata *drvdata) >> +{ >> + int rc = 0; >> + struct clk *clk = drvdata->clk; >> + >> + if (IS_ERR(clk)) >> + /* No all devices have a clock associated with CCREE */ >> + goto out; > > Ugh... I hate this. The "goto out;" here is a waste of time > do-nothing-goto that returns diretly. It's equivalent to "return 0;". > Is that intended? Even with the comment, it's not clear... > > People think do nothing gotos are a great idea but from reviewing tons > and tons of real life errors, I can assure you that in real life (as > opposed to theory) they don't prevent any future bugs and only introduce > "forgot to set the error code" bugs. I see your point and the code is indeed clearer this way. Will fix. Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?" -- Jean-Baptiste Queru