From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Jeongtae Park <jtp.park@samsung.com>
Cc: Dan Williams <dan.j.williams@intel.com>,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
"Ben Widawsky" <bwidawsk@kernel.org>,
Dave Jiang <dave.jiang@intel.com>,
Davidlohr Bueso <dave@stgolabs.net>, Fan Ni <fan.ni@samsung.com>,
<linux-cxl@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kyungsan Kim <ks0204.kim@samsung.com>,
"Wonjae Lee" <wj28.lee@samsung.com>,
Hojin Nam <hj96.nam@samsung.com>,
Junhyeok Im <junhyeok.im@samsung.com>,
Jehoon Park <jehoon.park@samsung.com>,
"Jeongtae Park" <jeongtae.park@gmail.com>
Subject: Re: [PATCH v2 2/7] cxl/region: Fix a checkpatch warning
Date: Mon, 25 Sep 2023 11:07:45 +0100 [thread overview]
Message-ID: <20230925110745.00001127@Huawei.com> (raw)
In-Reply-To: <20230922113520.3298976-1-jtp.park@samsung.com>
On Fri, 22 Sep 2023 20:35:20 +0900
Jeongtae Park <jtp.park@samsung.com> wrote:
> WARNING: else is not generally useful after a break or return
>
> Signed-off-by: Jeongtae Park <jtp.park@samsung.com>
> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
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.
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);
next prev parent reply other threads:[~2023-09-25 10:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230922113233epcas2p2cd57df10dde36b0da3b2fc5a916132e8@epcas2p2.samsung.com>
2023-09-22 11:35 ` [PATCH v2 2/7] cxl/region: Fix a checkpatch warning Jeongtae Park
2023-09-25 10:07 ` Jonathan Cameron [this message]
2023-10-05 8:08 ` Jeongtae Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230925110745.00001127@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=alison.schofield@intel.com \
--cc=bwidawsk@kernel.org \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=fan.ni@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=hj96.nam@samsung.com \
--cc=jehoon.park@samsung.com \
--cc=jeongtae.park@gmail.com \
--cc=jtp.park@samsung.com \
--cc=junhyeok.im@samsung.com \
--cc=ks0204.kim@samsung.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vishal.l.verma@intel.com \
--cc=wj28.lee@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox