Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2799632pxk; Tue, 15 Sep 2020 02:40:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqV/emZdcUSGyO6AMlCAetT1JgtwSy/GIQuyEeX4k82ZjtRj4HNCwBCE3Hz9WGyck0oTLz X-Received: by 2002:a05:6402:292:: with SMTP id l18mr22014370edv.6.1600162833677; Tue, 15 Sep 2020 02:40:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600162833; cv=none; d=google.com; s=arc-20160816; b=l0ZM+nl4hRUE2ar78CkV4VACM9u7JWmxea3zBDQ4xE9VqpQlkw8QgZXYlBWodP77vM LpgS8FzAFO1GuoK3ye0tjLNj2y2AXI7oQ8gOxlYM72H5eP2o4UNZVRwTlPoobpeAw9ae VAuh6rEnO66YQ1EB0oGhxbAfcWH2Z3xxiUObG1Gf44L39JIa1HDI2JoskRNKSgfXCeZW 0ZjVSJ4nI9BaYbC0DaQtpw8SfzzJErAhxcu1A2K4MIWuv4HRtTrHLhYljKNXedyciBtq Ax9hRi1FKv76VUTnEZuOC0ifdyfFhpOypBJKM1xUGAConVQmVH3E2WtXLvNzp063H2wo +hIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=gsQS95Uk+X6C1ro4IWpVaBNknqSF3qG+Ftqq7mGtuJM=; b=A81Wh0heXjmFuA33zwvDYyzvs7vprbD3siHwcX0j5fh1DJs30yilSfWYto8cOrxOXn 4Jv3S2o4xs9QyW0pJ0+VnlNW+h318xe0HuSUxap0ZuaxAZJLJlm3lWX+nkTg0P7J+Ecd UXv0d+B0oEOckaaKcoOmhkMG9fa1psclCGeQxP4K0q/00iQJQnbEut+/KktLj6MynZw4 eJwnN06zBq0FYcp7PNgb3i9VNxJT2sLPX2TyTURCgnOZ1vffOS8v/indMaqT3IPMbqDk rNaHPyi9vQWQ4vt5HSiu8CKQ/DXX0uwR0/+vZ5HJiHbut465Fgr9c2fveWyAgQosDKlU 9Glw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z6si960145edr.566.2020.09.15.02.40.10; Tue, 15 Sep 2020 02:40:33 -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; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726340AbgIOJje (ORCPT + 99 others); Tue, 15 Sep 2020 05:39:34 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:36830 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726243AbgIOJjd (ORCPT ); Tue, 15 Sep 2020 05:39:33 -0400 Received: by mail-lj1-f195.google.com with SMTP id r24so2226625ljm.3 for ; Tue, 15 Sep 2020 02:39:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gsQS95Uk+X6C1ro4IWpVaBNknqSF3qG+Ftqq7mGtuJM=; b=LdOK0FXiKcgOY5Y2YL19E0tIR6Ql1ZIVcv1oHhdUnvKHw1eSeefKN7Ll8SGRbbJ7fv sgO9BKldcSwcxwNavCdMzvUkf0o9CgFZuQzYlXAGlAVVhoYKTcXA23N18VOjkXk3Zf3Q Vx31VcJLa4SbXWBssnP87qp0guVulgwrzP/kL1Dn8gscjHXPz+NL40QbQTBk3cREaNNr sk1aB2wXedE6ZJ8t8e7l5W+QFFyJTst+D+i1vH+rXsdf5EaGA5tjlFtLGAp/VRcVquc6 tRpRomWlqo5kt39vTUG+flzEcHsHrfXtLVZYDiShs+KskjKzPLB3gyyxl2SvuZu6a+1W WMaQ== X-Gm-Message-State: AOAM533vtm0v7p2d/cHtUsq34/AxA5pnLnXmp0RG33T0MKPdow2Vyaxr 9Za4/X758EQ8b7EXdBy8M4cVcLdkU2M= X-Received: by 2002:a05:651c:1073:: with SMTP id y19mr6961972ljm.57.1600162771665; Tue, 15 Sep 2020 02:39:31 -0700 (PDT) Received: from xi.terra (c-beaee455.07-184-6d6c6d4.bbcust.telenor.se. [85.228.174.190]) by smtp.gmail.com with ESMTPSA id 80sm4228874lff.61.2020.09.15.02.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 02:39:30 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.93.0.4) (envelope-from ) id 1kI7Qv-00058k-Pa; Tue, 15 Sep 2020 11:39:29 +0200 Date: Tue, 15 Sep 2020 11:39:29 +0200 From: Johan Hovold To: Liu Shixin Cc: Greg Kroah-Hartman , Johan Hovold , Alex Elder , greybus-dev@lists.linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] staging: greybus: simplify the return expression of gb_svc_add() Message-ID: <20200915093929.GM24441@localhost> References: <20200915032630.1772621-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200915032630.1772621-1-liushixin2@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 15, 2020 at 11:26:30AM +0800, Liu Shixin wrote: > Simplify the return expression. > > Signed-off-by: Liu Shixin > --- > drivers/greybus/svc.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/drivers/greybus/svc.c b/drivers/greybus/svc.c > index ce7740ef449b..dca251172cd2 100644 > --- a/drivers/greybus/svc.c > +++ b/drivers/greybus/svc.c > @@ -1345,18 +1345,12 @@ struct gb_svc *gb_svc_create(struct gb_host_device *hd) > > int gb_svc_add(struct gb_svc *svc) > { > - int ret; > - > /* > * The SVC protocol is currently driven by the SVC, so the SVC device > * is added from the connection request handler when enough > * information has been received. > */ > - ret = gb_connection_enable(svc->connection); > - if (ret) > - return ret; > - > - return 0; > + return gb_connection_enable(svc->connection); There no need for this change. This code was written with an explicit success path on purpose. Also, this driver doesn't live in staging anymore as your patch prefix suggests. > } > > static void gb_svc_remove_modules(struct gb_svc *svc) Johan