Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2364239imm; Mon, 16 Jul 2018 06:54:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd6C5Ld7EnplekXHIeYmlpyAFUgKvrorBMSHw7+68chGWRBa/NNPIWdt3W2GU0WjKQG+HeW X-Received: by 2002:a63:d5b:: with SMTP id 27-v6mr15383222pgn.107.1531749284522; Mon, 16 Jul 2018 06:54:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531749284; cv=none; d=google.com; s=arc-20160816; b=EkaoWLx+vrKZyaWjJ8tPkvMXH/MCrM5Bx+WSGoFtjCmOzwsPoSjB70eQU2MMd54bAr 8jbrssJsPAuZ6sE32TDukSxV/rE/WzLFYzkL9Hwb8+7ANIvGph+akBNU3eN/xg+it92t E0rTPFNkDa+hRto+G4XEFvMTyfeQBtkXL4NeGi/gFJtMVWGYboC8p5KnlV2lsWsCPJZo VB7dQP5jqVhvhYqTu52VohxVbhVQ9j0ocUjUqrQlgoqk3Dg1Xfr90Xfxffi69MTtKYM7 P0kZPKrbJFGCA7scBJCk3Vn96eVnbN8XB86PeeOjudP3DTBnGRKpsiYfqf3Sw3LW/1Sh 7Xcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=t5/ssnBYIU8tMrWhPhcHagIpnZ/5LhkoetL7rRHqv1g=; b=Exnl8th9ahs2g27jmSbj5qwdpOTJbjpC7HawyXuIBLd9aWakZ3tFlHpFZQ98TeF7+O Ppj8aYNbk/jUIpvuYEjiROxRzPcOxabaa7wvamjMhMV/TNYwl+W74gjHLYSuwp38NZJH 8+A7+gzLQbs3IZZGctq455+FtrIMxXXRuo7n8nFxFlzIGxs191dPfnfHFwiwHt1JMOVU VL3PUiD6gQKpouReuQMeLVew5ioBPe5rSQwL6Mbtnyk9YE/YyLtLdGyHTp7+q/UI0HwY f2FWg8oWWHgCxJGmVC3We1HLDmCiTUH2+NDsiW3cJeFtv8G4G+NM7jLjuU/+eK0LLb8U +M2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=QKTh1ZMI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1-v6si16421712plp.166.2018.07.16.06.54.29; Mon, 16 Jul 2018 06:54:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=QKTh1ZMI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727957AbeGPOV1 (ORCPT + 99 others); Mon, 16 Jul 2018 10:21:27 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:56444 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbeGPOV0 (ORCPT ); Mon, 16 Jul 2018 10:21:26 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6GDmvag171832; Mon, 16 Jul 2018 13:53:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=t5/ssnBYIU8tMrWhPhcHagIpnZ/5LhkoetL7rRHqv1g=; b=QKTh1ZMI+fdfNvRQFaFjw7EC4xGcop9+rFb1gjPIIhFQUzWHrJSHtp4tok3ylmpzWu/z e8GrhmK9ihBUl2UnlK1ycyRdyFaCjlyp/83gD41PLrwVbHQEyyz2qp/6pUmtNN1WKacd SsyxEr0k1antf/HewYXK1WUKEMs3kMfDJI0IgyA2N91eocw6DXupNCYU/v0Y/ZpHLZZA 5LPQ4+1FeAE7xsTvAlkerB6XKyXcsl2ZF0a8Je2gGi2dzVu5IkCAHSIChIAcwpZWRwQX 0dfUh9DtbOSSfxMIbFz618TKcJYUKSkzQJQs/60S4f0564UDkIemvUZsttj+w7BcC5WR rg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2k7a3jmh83-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Jul 2018 13:53:47 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w6GDrk8H030746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Jul 2018 13:53:46 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w6GDrjaJ010306; Mon, 16 Jul 2018 13:53:45 GMT Received: from mwanda (/105.166.134.228) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 16 Jul 2018 06:53:45 -0700 Date: Mon, 16 Jul 2018 16:53:36 +0300 From: Dan Carpenter To: Todd Poynor Cc: Rob Springer , John Joseph , Ben Chan , Greg Kroah-Hartman , devel@driverdev.osuosl.org, Zhongze Hu , linux-kernel@vger.kernel.org, Simon Que , Guenter Roeck , Todd Poynor , Dmitry Torokhov Subject: Re: [PATCH 04/18] staging: gasket: device registration error and unregister fixups Message-ID: <20180716135335.hnvj5kqvsrrwzp3b@mwanda> References: <20180714055816.223754-1-toddpoynor@gmail.com> <20180714055816.223754-5-toddpoynor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180714055816.223754-5-toddpoynor@gmail.com> User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8955 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=793 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807160162 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 13, 2018 at 10:58:02PM -0700, Todd Poynor wrote: > @@ -376,7 +377,10 @@ int gasket_register_device(const struct gasket_driver_desc *driver_desc) > fail1: > class_destroy(internal->class); > > +fail0: GW-BASIC sytle label names are an anti-pattern. It's better to name the labels after what they do, just like function names describes what the function does. Here it would be "goto clear_desc;" or something. It doesn't have to be perfect but so long as you *try* to name it something useful that's better than not trying. > + mutex_lock(&g_mutex); > g_descs[desc_idx].driver_desc = NULL; > + mutex_unlock(&g_mutex); > return ret; > } regards, dan carpenter