Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp3682665rwb; Sun, 30 Jul 2023 13:32:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlH+kB1VbhD4KTCLcLUQcBI1KiY0g/Obw83V+QewRHGCbh67+FBLSjviB4nrb+xvxe/N+Ui3 X-Received: by 2002:a05:6512:308e:b0:4fb:cabd:2a66 with SMTP id z14-20020a056512308e00b004fbcabd2a66mr4803577lfd.21.1690749154574; Sun, 30 Jul 2023 13:32:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690749154; cv=none; d=google.com; s=arc-20160816; b=cgSKpVOCujGvrh9aQG9veO0uudvBlCT9OW0rma64rv022FzGJ5bddOkYD4LpRmJT3t p4FWcB2UkbkfVzRijaX0bBxc92VOoJWyeGbLUIwCYUNmf2FKJO221exRYNqRvrDKHmNr J+mUW3hHwiBmuqhd6xhb3aP8PhJWS1+EWi2Uhf3WKkbkxjXEgSwizFXA71AIzTaXjOoL kK2m4IBBJKYDTj/g/44GBnFySdszJD3JLwQO3qlR7vR47QURrEHaQCMEWd7kaNq3WjKC ZNx/MhlcUs6ZUVQEc6p/XB0bUZMeKB8UkSSrGJerNgdtuTQGkY4SBeNAPj6C4PAta7/j DrTg== 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; bh=W5q8uSn+F2NtXW0xKlJQhad5N7nNcrQohDnCNzR/fYA=; fh=atYq31tiD1RNysCaSYGqkiMpfB2mOV3Zb//BNS9Lhxs=; b=RINfwDmMKU50bPHujSnw/9cC71lYHeJLCIcE37Kp2KXoU2lihbGIBlvzHRykCnoVgX bWH9z76CI2DA4R+HR43b3pPgCPsttq/3bZGwVdXkcEnj13D0f2X1Iej4cYgph8W2KWJj VVhGrTrs3KkqyRIU9vq6O3PRd9ndZ51R5892gM3sf8N/oa9FP1IkfWRJgfArc2cGryIA gaN1KQlLLUupRTy+LXtqF0P/DBYVpjo0+MWRYpG1ACR3EbrFXynntO7zDiJ5azY6kXzw 7lqMizSK47hHQgzjfYbno9RvFGPOk0V/hN9kU/k73XO/+yErN6db2t/claxJ2CwPMDzP BnCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g12-20020a50ee0c000000b00522595744f0si5322628eds.501.2023.07.30.13.32.10; Sun, 30 Jul 2023 13:32:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229892AbjG3UJf convert rfc822-to-8bit (ORCPT + 99 others); Sun, 30 Jul 2023 16:09:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229723AbjG3UJe (ORCPT ); Sun, 30 Jul 2023 16:09:34 -0400 Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CD5811C for ; Sun, 30 Jul 2023 13:09:33 -0700 (PDT) Received: from omf06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A6F0514092B; Sun, 30 Jul 2023 20:09:31 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf06.hostedemail.com (Postfix) with ESMTPA id E055420010; Sun, 30 Jul 2023 20:09:27 +0000 (UTC) Message-ID: <15913bee637e2cff63626dc64c0577abc1ad9c6c.camel@perches.com> Subject: Re: [PATCH v7 2/2] cxl/region: Remove else after return statement From: Joe Perches To: Alison Schofield , Raghu Halharvi Cc: linux-cxl@vger.kernel.org, ira.weiny@intel.com, bwidawsk@kernel.org, dan.j.williams@intel.com, vishal.l.verma@intel.com, linux-kernel@vger.kernel.org, Dave Jiang Date: Sun, 30 Jul 2023 13:09:26 -0700 In-Reply-To: References: <20230726073421.2452-1-raghuhack78@gmail.com> <20230726073421.2452-3-raghuhack78@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Stat-Signature: jf6edj6agmfhkqjuihobpbi8y3n3153w X-Rspamd-Server: rspamout07 X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Rspamd-Queue-Id: E055420010 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX18+cDEPJpffcih+mU6D8ESFeoFIhNVo0w4= X-HE-Tag: 1690747767-968619 X-HE-Meta: U2FsdGVkX1/Qj55gyDmRDC+wgo4dOuGUxV6Bw9W20Pj4+TsbuvdqlOTXqa44eS8qjtzC2qNAe9SH44uIC8IzIWlfxdhvqva4K/uqrfQeHct4SbnGOkEXiHf+qBknIy+9hVpTAMsJkfN/KcNDYR5OBrackmHk+RvPwkZKSmT+C0W7xZfoO9xgO2mfZrubWTJwexS+HLxz5MoWNfF4PjycgnGxnBE7RmuNjIQceowGfEKfkQNAcbpzJGYfrTucZTVBHuOn2kTmypmF7nJfh6KN+F8jkWJYDLYsxkyRuU6/X5MeJJs4zz0+htLeIpP37lTeA0zmug19PUJWac0HNghsWfIW1kvCXuzlMG7Fp7WV+dlxCsILcjRYlA== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2023-07-29 at 19:18 -0700, Alison Schofield wrote: > On Wed, Jul 26, 2023 at 07:34:21AM +0000, Raghu Halharvi wrote: > > Issue found with checkpatch > > > > The else section here is redundant after return statement, removing it. > > Sanity and correctness is not affected due to this fix. > > > > Signed-off-by: Raghu Halharvi > > Reviewed-by: Dave Jiang > > Reviewed-by: Vishal Verma > > Reviewed-by: Ira Weiny > > Reviewed-by: Alison Schofield > > > > > --- > > drivers/cxl/core/region.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c > > index e115ba382e04..bfd3b13dd2c1 100644 > > --- a/drivers/cxl/core/region.c > > +++ b/drivers/cxl/core/region.c > > @@ -133,11 +133,11 @@ static int cxl_region_invalidate_memregion(struct cxl_region *cxlr) > > &cxlr->dev, > > "Bypassing cpu_cache_invalidate_memregion() for testing!\n"); > > return 0; > > - } else { > > - dev_err(&cxlr->dev, > > - "Failed to synchronize CPU cache state\n"); > > - return -ENXIO; > > } > > + > > + dev_err(&cxlr->dev, > > + "Failed to synchronize CPU cache state\n"); > > + return -ENXIO; > > } > > > > cpu_cache_invalidate_memregion(IORES_DESC_CXL); > > -- > > 2.39.2 > > My preference would be for this function to be something like: --- static int cxl_region_invalidate_memregion(struct cxl_region *cxlr) { if (cpu_cache_has_invalidate_memregion()) { cpu_cache_invalidate_memregion(IORES_DESC_CXL); return 0; } if (IS_ENABLED(CONFIG_CXL_REGION_INVALIDATION_TEST)) { dev_warn_once(&cxlr->dev, "Bypassing cpu_cache_invalidate_memregion() for testing!\n"); return 0; } dev_err(&cxlr->dev, "Failed to synchronize CPU cache state\n"); return -ENXIO; }