Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754284AbdG3QTZ (ORCPT ); Sun, 30 Jul 2017 12:19:25 -0400 Received: from mail-io0-f175.google.com ([209.85.223.175]:36158 "EHLO mail-io0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754170AbdG3QTX (ORCPT ); Sun, 30 Jul 2017 12:19:23 -0400 MIME-Version: 1.0 X-Originating-IP: [82.81.71.2] In-Reply-To: <20170727194829.symnl663plxd23uo@mwanda> References: <1501165654-30601-1-git-send-email-gilad@benyossef.com> <1501165654-30601-2-git-send-email-gilad@benyossef.com> <20170727194829.symnl663plxd23uo@mwanda> From: Gilad Ben-Yossef Date: Sun, 30 Jul 2017 19:19:22 +0300 Message-ID: Subject: Re: [PATCH 2/3] staging: ccree: Convert to devm_ioremap_resource for map, unmap To: Dan Carpenter Cc: Greg Kroah-Hartman , linux-crypto@vger.kernel.org, driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, Linux kernel mailing list , Suniel Mahesh , 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 Content-Length: 1212 Lines: 35 On Thu, Jul 27, 2017 at 10:48 PM, Dan Carpenter wrote: > On Thu, Jul 27, 2017 at 05:27:33PM +0300, Gilad Ben-Yossef wrote: >> + new_drvdata->cc_base = devm_ioremap_resource(&plat_dev->dev, >> + req_mem_cc_regs); >> + if (IS_ERR(new_drvdata->cc_base)) { >> + rc = PTR_ERR(new_drvdata->cc_base); >> goto init_cc_res_err; > ^^^^^^^^^^^^^^^^^^^^ > (This code was in the original and not introduced by the patch.) > > Ideally, the goto name should say what the goto does. In this case it > does everything. Unfortunately trying to do everything is very > complicated so obviously the error handling is going to be full of bugs. Thank you. This review is most helpful. I've added a patch to address the specific issues you've raised. I also see some additional places that can get similar treatment to both what you suggested as well as what Suneil has done. I'll address those in follow up patches. 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