Linux CXL
 help / color / mirror / Atom feed
* [PATCH v2] cxl/mbox: Remove useless cast in cxl_mem_create_range_info()
@ 2023-08-15 17:20 alison.schofield
  2023-08-16  1:52 ` Dan Williams
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: alison.schofield @ 2023-08-15 17:20 UTC (permalink / raw)
  To: Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Ira Weiny, Dan Williams
  Cc: Andy Shevchenko, linux-cxl

From: Alison Schofield <alison.schofield@intel.com>

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

Fixes: 52c4d11f1dce ("resource: Convert DEFINE_RES_NAMED() to be compound literal")
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
---

Changes in v2:
- Update commit log (Andy)
- Add fixes tag (Jonathan)

 drivers/cxl/core/mbox.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
index d6d067fbee97..01de4b438b2a 100644
--- a/drivers/cxl/core/mbox.c
+++ b/drivers/cxl/core/mbox.c
@@ -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
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-08-23 16:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-15 17:20 [PATCH v2] cxl/mbox: Remove useless cast in cxl_mem_create_range_info() alison.schofield
2023-08-16  1:52 ` Dan Williams
2023-08-17 13:04 ` Andy Shevchenko
2023-08-17 15:10 ` Davidlohr Bueso
2023-08-23 16:56 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox