Skip to contentSkip to conversation

cxl/mbox: Drop extra (struct resource)

PATCH New Jonathan Cameron 1 participant 1 message Mar 1, 2023 CXL

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 cxl/mbox: Drop extra (struct resource)

DEFINE_RES_MEM() is a wrapper around the DEFINE_RES_NAMED() macro which already has the (struct resource) for the compound literal.

Fixes warnings with W=1 C=1
CC [M] drivers/cxl/core/mbox.o
CHECK drivers/cxl/core/mbox.c
drivers/cxl/core/mbox.c:1064:18: warning: cast to non-scalar drivers/cxl/core/mbox.c:1064:18: warning: cast from non-scalar

Fixes 52c4d11f1dce ("resource: Convert DEFINE_RES_NAMED() to be compound literal")
---
 drivers/cxl/core/mbox.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/cxl/core/mbox.c +1 -2
index f2addb457172..dce16088ceee 100644
@@ -1052,8 +1052,7 @@ int cxl_mem_create_range_info(struct cxl_dev_state *cxlds)
 	struct device *dev = cxlds->dev;
 	int rc;
 
-	cxlds->dpa_res =
-		(struct resource)DEFINE_RES_MEM(0, cxlds->total_bytes);
+	cxlds->dpa_res = DEFINE_RES_MEM(0, cxlds->total_bytes);
 
 	if (cxlds->partition_align_bytes == 0) {
 		rc = add_dpa_res(dev, &cxlds->dpa_res, &cxlds->ram_res, 0,
Signature · 1 line
2.37.2