WARNING: else is not generally useful after a break or return
Signed-off-by: Jeongtae Park <[email protected]>
---
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);
--
2.34.1
On 9/20/23 19:51, Jeongtae Park wrote:
> WARNING: else is not generally useful after a break or return
>
> Signed-off-by: Jeongtae Park <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
> ---
> 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);