Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3741151rdh; Fri, 29 Sep 2023 00:34:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTnjjeY2m/q3bYAkpVIq1C/0TyS/NtIt+4NlB+ayzVbg6dkUZGCQsybed00QJS7c5yf/ed X-Received: by 2002:a17:902:f7cf:b0:1c6:dcb:1e31 with SMTP id h15-20020a170902f7cf00b001c60dcb1e31mr2926727plw.4.1695972865381; Fri, 29 Sep 2023 00:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695972865; cv=none; d=google.com; s=arc-20160816; b=MpDOVdoI9vzA07Sc38GmgNVyjLN2gQKLBAoCT++BDjYcorcbkcKAPTo5xkt/yIK+Mi HNtXgGTk7JyGodo0cY/8IxxTqOCbat3p8+l4porvleXqG+Mf8gcOkk6rOmJOqQPoC6mb pADIR/KC3QFiY+fGTCNKIfZZhM3QVZUTudIrtkA7B9OfnWac9kyFDlSMmOtu9F1EXwz7 2ppF7HnJaFcpRyupSs01un07wcD+Q8Mp13WSF/pwG7Bk5+2tWAn7PuEOUzEDNoK+F7H9 cI2NXVsp7ZRb4sp7PWlzE60Y/ktxQP8mYi/PZnL0zgMuem7AW0kpaRUoWLr7aFyHawJt QH6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=Mxk9l/U073uStCFV2UzL0Jvqq/Vo4Ln1BTaY+q264Og=; fh=ugTZ5J8xDVzdTLeT3b9ERwsLW9d9uvTjM4mvNZgPBT8=; b=OoVQOxWCDkvpBdAP3GCdcjbuKziOonXRWtRVG1weu/mpJPeI0JufwCPftLCQr8ZSnu XjV35MlD0eu2OCK3oprfn7LWj7Ev+e/Iq6T0RXLGc/8343/XSQ7J5NW8WNOuQXWFd2Zq feuA6uNVGy6dmfXyjdBTkoMvPCRzMBctUaErzUr+oQVA8RA9DjACGwUvbwoH4/t2rYbQ ITm5JDXuCa/+xGx+oMMBTlmxr+zBzvuDq7tVvUfoUE7QjU23TfwrAaJ6kGK+bVZFL3ww eymOTH5WkSX91Sg6eY5kMSRSQvXtTuGNQt8nJqHk71ygnGiVLf6G4+iCM6vqiN+8ONMq kPDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=h4UfrgMc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id c1-20020a170902d48100b001b7eb771d5esi22878017plg.527.2023.09.29.00.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 00:34:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=h4UfrgMc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 4B95E8022B0F; Fri, 29 Sep 2023 00:34:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232790AbjI2HeF (ORCPT + 99 others); Fri, 29 Sep 2023 03:34:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232782AbjI2HeA (ORCPT ); Fri, 29 Sep 2023 03:34:00 -0400 Received: from mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92B211AA for ; Fri, 29 Sep 2023 00:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1695972824; bh=Mxk9l/U073uStCFV2UzL0Jvqq/Vo4Ln1BTaY+q264Og=; h=X-EA-Auth:Message-ID:Subject:From:To:Cc:Date:In-Reply-To: References:Content-Type:Content-Transfer-Encoding:MIME-Version; b=h4UfrgMc/GsgctxJuapIvK1n7NV2LISZyjM4eagWufGdxYn3a8T9eGQXeex2tADbM RuSfnz0Aa2M1r9OmxMjaANzArsx8eleoOeYnBkl5bAn7kmPTMU47MmBq66hAGYQnXS ffsVjkZKidUECmxdEiX+EkZhCkxEgQWxHEYbKBkg= Received: by b221-6.in.mailobj.net [192.168.90.26] with ESMTP via ip-20.mailobj.net [213.182.54.20] Fri, 29 Sep 2023 09:33:44 +0200 (CEST) X-EA-Auth: Kph+n6amj/OpMbnfaagrjIvIfM2f1llYlstIKcYMbu7B9oWx5SNQR1QBvj0B4fmVvei9+OhAtDxj3qPLNaYgUr/AVERwIYts Message-ID: Subject: Re: [PATCH] gfs2: Set error on error path From: drv To: Dan Carpenter Cc: Bob Peterson , Andreas Gruenbacher , gfs2@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Dan Carpenter Date: Fri, 29 Sep 2023 13:02:51 +0530 In-Reply-To: <72de9c2e-7c60-4930-acfb-556a1f0fa4c4@kadam.mountain> References: <72de9c2e-7c60-4930-acfb-556a1f0fa4c4@kadam.mountain> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 29 Sep 2023 00:34:18 -0700 (PDT) On Fri, 2023-09-29 at 10:14 +0300, Dan Carpenter wrote: > On Fri, Sep 29, 2023 at 11:44:40AM +0530, Deepak R Varma wrote: > > Set the error variable inside the error path on failure. Saves > > unnecessary variable assignment during normal execution. > >=20 > > Signed-off-by: Deepak R Varma > > --- > > =C2=A0fs/gfs2/bmap.c | 5 +++-- > > =C2=A01 file changed, 3 insertions(+), 2 deletions(-) > >=20 > > diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c > > index ef7017fb6951..93bd8ea34444 100644 > > --- a/fs/gfs2/bmap.c > > +++ b/fs/gfs2/bmap.c > > @@ -162,9 +162,10 @@ int gfs2_unstuff_dinode(struct gfs2_inode *ip) > > =C2=A0 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0down_write(&ip->i_rw_mu= tex); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0page =3D grab_cache_pag= e(inode->i_mapping, 0); > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0error =3D -ENOMEM; > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (!page) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (!page) { > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0error =3D -ENOMEM; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0goto out; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} >=20 > It used to be that the other way was faster?=C2=A0 I'm pretty sure the > compiler can figure it out these days.=C2=A0 Please don't randomly start > changing people's prefered style unless it's drivers/staging/ code. >=20 Hi Dan, Thank you for the feedback. I did not know about the compiler optimization resulting in original code being faster. I will let the maintainers comment on breaking the style. regards, deepak. > regards, > dan carpenter >=20