cxl/mbox: Remove useless cast in cxl_mem_create_range_info()
[email protected]
maintainerPATCH v2 1/1 cxl/mbox: Remove useless cast in cxl_mem_create_range_info()
From: Alison Schofield <[email protected]>
DEFINE_RES_MEM() is a wrapper around the DEFINE_RES_NAMED() macro which already has the (struct resource) for the compound literal. The user of the macro should not repeat the cast.
Cleans up these sparse warnings:drivers/cxl/core/mbox.c:1184:18: warning: cast to non-scalar drivers/cxl/core/mbox.c:1184:18: warning: cast from non-scalar
---
Changes in v2:
- Update commit log (Andy)
- Add fixes tag (Jonathan)
drivers/cxl/core/mbox.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/cxl/core/mbox.c +1 -2
@@ -1180,8 +1180,7 @@ int cxl_mem_create_range_info(struct cxl_memdev_state *mds)return 0 ; } - cxlds->dpa_res = - (struct resource )DEFINE_RES_MEM (0 , mds->total_bytes); + cxlds->dpa_res =DEFINE_RES_MEM (0 , mds->total_bytes);if (mds->partition_align_bytes ==0 ) { rc = add_dpa_res(dev, &cxlds->dpa_res, &cxlds->ram_res, 0,
base-commit: fe77cc2e5a6a7c85f5c6ef8a39d7694ffc7f41c9
Signature · 1 line
2.37.3
Quoted 6 lines · alison.schofield@ wrote:
From: Alison Schofield <[email protected]>
DEFINE_RES_MEM()is a wrapper around theDEFINE_RES_NAMED()macro which already has the (struct resource) for the compound literal. The user of the macro should not repeat the cast.
Quoted 6 lines
Cleans up these sparse warnings:
drivers/cxl/core/mbox.c:1184:18: warning: cast to non-scalardrivers/cxl/core/mbox.c:1184:18: warning: cast from non-scalarFixes 52c4d11f1dce ("resource: Convert DEFINE_RES_NAMED() to be compound literal")Signed-off-by Alison Schofield <[email protected]>
Looks good to me.
Quoted 5 lines · On Tue, Aug 15, 2023 at 10:20:52AM -0700, [email protected] wrote:
From: Alison Schofield <[email protected]>
DEFINE_RES_MEM()is a wrapper around theDEFINE_RES_NAMED()macro which already has the (struct resource) for the compound literal. The user of the macro should not repeat the cast.
s/repeat/use/
Quoted 3 lines
Cleans up these sparse warnings:
drivers/cxl/core/mbox.c:1184:18: warning: cast to non-scalardrivers/cxl/core/mbox.c:1184:18: warning: cast from non-scalar
With the above fixed,
Thank you!
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 6 lines · On Tue, 15 Aug 2023, [email protected] wrote:
From: Alison Schofield <[email protected]>
DEFINE_RES_MEM()is a wrapper around theDEFINE_RES_NAMED()macro which already has the (struct resource) for the compound literal. The user of the macro should not repeat the cast.
Quoted 6 lines
Cleans up these sparse warnings:
drivers/cxl/core/mbox.c:1184:18: warning: cast to non-scalardrivers/cxl/core/mbox.c:1184:18: warning: cast from non-scalarFixes 52c4d11f1dce ("resource: Convert DEFINE_RES_NAMED() to be compound literal")Signed-off-by Alison Schofield <[email protected]>
Quoted 6 lines · On Tue, 15 Aug 2023 10:20:52 -0700 [email protected] wrote:
From: Alison Schofield <[email protected]>
DEFINE_RES_MEM()is a wrapper around theDEFINE_RES_NAMED()macro which already has the (struct resource) for the compound literal. The user of the macro should not repeat the cast.
Quoted 6 lines
Cleans up these sparse warnings:
drivers/cxl/core/mbox.c:1184:18: warning: cast to non-scalardrivers/cxl/core/mbox.c:1184:18: warning: cast from non-scalarFixes 52c4d11f1dce ("resource: Convert DEFINE_RES_NAMED() to be compound literal")Signed-off-by Alison Schofield <[email protected]>
Quoted 25 lines
---
Changes in v2:
- Update commit log (Andy)
- Add fixes tag (Jonathan)drivers/cxl/core/mbox.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/cxl/core/mbox.c +1
-2@@ -1180,8 +1180,7 @@ int cxl_mem_create_range_info(struct cxl_memdev_state *mds)return 0 ; } - cxlds->dpa_res = - (struct resource )DEFINE_RES_MEM (0 , mds->total_bytes); + cxlds->dpa_res =DEFINE_RES_MEM (0 , mds->total_bytes);if (mds->partition_align_bytes ==0 ) { rc = add_dpa_res(dev, &cxlds->dpa_res, &cxlds->ram_res, 0,base-commit:
fe77cc2e5a6a7c85f5c6ef8a39d7694ffc7f41c9