Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp348407rdb; Thu, 5 Oct 2023 07:43:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGzQardm9+ndMJA9YND4Rj3ysQa85srOXSnN7h5+Dr9r3lg6CTcObnppa8vIqIFGfWcgB26 X-Received: by 2002:a05:6a21:3e14:b0:161:76a4:4f6e with SMTP id bk20-20020a056a213e1400b0016176a44f6emr5041302pzc.32.1696517033244; Thu, 05 Oct 2023 07:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696517033; cv=none; d=google.com; s=arc-20160816; b=E6Y7fh2hmHfJgjaecZQULlzdkx6TzNnLGYO+L4Al6MipH87Z8cF3B8Vw9CruQ6fcKb yFpP4hl6rGsHBHf38MPRkaNsihIC+A59UT7YOluvZ2V481OR1EacBtLZKVq0ZKsa8RLW AsO0jxphZZ7o9KUr8cU3VomQb68kNpAlzNlknpS2s4EBuXkpAjzw+0pGKcqipiSnaExd eRmh7Zp19zYgQNGi+H10YgunOs8wkaQXXcBI4ntXZhPxwuRA7f2hP0DQj76Yq2vf171T cuT6FvkFw4dQZCBFmsRPLmr4yflrmZ8r2R+McO5LLSsCoK/RYs5TWphF1a0uRN8JL0OY S8hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:in-reply-to :mime-version:message-id:subject:cc:to:from:date:dkim-signature :dkim-filter; bh=HCaPv8vnab2WsCcpJQSxA5m17wuV3wZsDl03fye1R40=; fh=eYk6bbGu9CBim3eGN4kFm8BcOERVCcwXz6cVCL6OtM4=; b=krWzuzzex7Hj5Bg5uYgoABnJDIo3A7/uyAr+430CDarcKTGcWyB9mrMZezR8/lZfuq rmR51Qf//VCIDGu4m1vWDOYP2V8jVvD7KIeOzLkaTvs350PzE5cUJTt8MtfaH9qaHYm1 ujPfmFxC8b9XE/SSYZK4kE4rbVxqv+IgYYK4V+EaRcyv5w9/IfxnC4zyPR313PK1wQcl Mvfea3agyVWZ0DFU/+tGifd6Whhusuu5Bl6YZ4TJu1sgey35bL+haryEkmmV5tJvJmsR I1sJAXSvRMwIOhsCact7Dglvwbo3s5AlcoNMdA/WJKHt+Wg6wMnwtB5x4GipfxR7jhlv VvgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=MoiTIS0T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id e15-20020a056a001a8f00b0069353ac3d43si1522354pfv.79.2023.10.05.07.43.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 07:43:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=MoiTIS0T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 70BEF8099CE6; Thu, 5 Oct 2023 07:43:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238703AbjJEOkz (ORCPT + 99 others); Thu, 5 Oct 2023 10:40:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236774AbjJEOhD (ORCPT ); Thu, 5 Oct 2023 10:37:03 -0400 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4050B47885 for ; Thu, 5 Oct 2023 07:02:59 -0700 (PDT) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20231005080537epoutp0115a6ec7f947925c9d59d0aff2715e846~LJ4Uz-YKu1379913799epoutp01D for ; Thu, 5 Oct 2023 08:05:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20231005080537epoutp0115a6ec7f947925c9d59d0aff2715e846~LJ4Uz-YKu1379913799epoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1696493137; bh=HCaPv8vnab2WsCcpJQSxA5m17wuV3wZsDl03fye1R40=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MoiTIS0TOdLbnn2uIxHNUc4WYZUHBgJVruHELMSjU7sq3W7BbzvAOpVMCdRfeUQCc BIr6/nZI8sJYd5geR/7ZLWDfsfC5glLqp91gVHx1fSpCq5420/b5ZWGG08pc0fQsoZ 2tw50lPPHXR+9OvQEbjIalEAz6DfWz+rv7+4OSG0= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20231005080536epcas2p17f0ad039a4013cc17f41c135694fda51~LJ4UGLCsf0805808058epcas2p1x; Thu, 5 Oct 2023 08:05:36 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.90]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4S1PJ02Khhz4x9Q7; Thu, 5 Oct 2023 08:05:36 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 57.42.09649.05E6E156; Thu, 5 Oct 2023 17:05:36 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20231005080535epcas2p277cd4296cc3ce911e4e413b684ed7acf~LJ4TEHo1D2605926059epcas2p2E; Thu, 5 Oct 2023 08:05:35 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231005080535epsmtrp2a1f570b342982271d9c16756d5ce29d6~LJ4TDK2KU2359823598epsmtrp2-; Thu, 5 Oct 2023 08:05:35 +0000 (GMT) X-AuditID: b6c32a46-b9ffa700000025b1-2b-651e6e50bf5d Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id E4.BA.08742.F4E6E156; Thu, 5 Oct 2023 17:05:35 +0900 (KST) Received: from jtpark-7920 (unknown [10.229.83.56]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231005080535epsmtip202bf93ccd5fb586e0f789e09d7b2d0af~LJ4SzgdHl2366523665epsmtip2A; Thu, 5 Oct 2023 08:05:35 +0000 (GMT) Date: Thu, 5 Oct 2023 17:08:34 +0900 From: Jeongtae Park To: Jonathan Cameron Cc: Dan Williams , Alison Schofield , Vishal Verma , Ben Widawsky , Dave Jiang , Davidlohr Bueso , Fan Ni , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Kyungsan Kim , Wonjae Lee , Hojin Nam , Junhyeok Im , Jehoon Park , Jeongtae Park Subject: Re: [PATCH v2 2/7] cxl/region: Fix a checkpatch warning Message-ID: MIME-Version: 1.0 In-Reply-To: <20230925110745.00001127@Huawei.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDJsWRmVeSWpSXmKPExsWy7bCmhW5AnlyqwdlDfBZ3H19gs2ievJjR YvrUC4wWJ242slmsvrmG0aJp9V1Wi+bF69ksPrz5x2Jx4HUD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XeTQrmaWfRrsLs5iGBVee1LP5Vjit97dzs+Ld O1IHbB+HTTrFMPfUFfXPy3N/Wz2+vvvnrwuHM6XqnJ+vkRR6pmK14RuL6YwMnXVTzKamxOkp NCxVYinOSDTUYi4qTgQA1EGPHSQDAAA= X-CMS-MailID: 20231005080535epcas2p277cd4296cc3ce911e4e413b684ed7acf X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----E9vxk1eHFJMo0Hi_Q_rTTD2vXp5VKj0nvvVRz8vbSgBSYVSL=_9a285_" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230922113233epcas2p2cd57df10dde36b0da3b2fc5a916132e8 References: <20230922113520.3298976-1-jtp.park@samsung.com> <20230925110745.00001127@Huawei.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 05 Oct 2023 07:43:33 -0700 (PDT) ------E9vxk1eHFJMo0Hi_Q_rTTD2vXp5VKj0nvvVRz8vbSgBSYVSL=_9a285_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Mon, Sep 25, 2023 at 11:07:45AM +0100, Jonathan Cameron wrote: > On Fri, 22 Sep 2023 20:35:20 +0900 > Jeongtae Park wrote: > > > WARNING: else is not generally useful after a break or return > > > > Signed-off-by: Jeongtae Park > > Reviewed-by: Dave Jiang > > This one is a little ugly. I'd prefer to see the error > condition remain out of line (vs the warning one) > > if (!IS_ENABLED(CONFIG_CXL_REGION_INVALIDATION_TEST)) { > dev_err(&cxlr->dev, > "Failed ..."); > return -ENOXIO > } > > dev_warn_once(... > > return 0; > > Or keep the else. I think I changed it too mechanically ignoring the meanings. Your comment made me think about it a bit more. If we don't really need the error message to be printed every calling, how about remove it and modify the condition statements like below. It would make more efficient or small codes when 'CONFIG_CXL_REGION_INVALIDATION_TEST' is not set. static int cxl_region_invalidate_memregion(struct cxl_region *cxlr) { if (IS_ENABLED(CONFIG_CXL_REGION_INVALIDATION_TEST) && cpu_cache_has_invalidate_memregion()) { dev_warn_once(&cxlr->dev, "Bypassing cpu_cache_invalidate_memregion() for testing!\n"); return 0; } return cpu_cache_invalidate_memregion(IORES_DESC_CXL); } > > Not that important though as code is small enough that less > than ideal in / out of line doesn't matter that much to readability. > > Jonathan > > > > --- > > drivers/cxl/core/region.c | 7 +++---- > > 1 file changed, 3 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c > > index e115ba382e04..1fc9d01c1ac0 100644 > > --- a/drivers/cxl/core/region.c > > +++ b/drivers/cxl/core/region.c > > @@ -133,11 +133,10 @@ 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); > ------E9vxk1eHFJMo0Hi_Q_rTTD2vXp5VKj0nvvVRz8vbSgBSYVSL=_9a285_ Content-Type: text/plain; charset="utf-8" ------E9vxk1eHFJMo0Hi_Q_rTTD2vXp5VKj0nvvVRz8vbSgBSYVSL=_9a285_--