Skip to content

Commit 9214c9d

Browse files
AlisonSchofielddjbw
authored andcommitted
cxl/mbox: Remove useless cast in cxl_mem_create_range_info()
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: 52c4d11 ("resource: Convert DEFINE_RES_NAMED() to be compound literal") Signed-off-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Davidlohr Bueso <dave@stgolabs.net> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230815172052.22514-1-alison.schofield@intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 1b27978 commit 9214c9d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/cxl/core/mbox.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,8 +1224,7 @@ int cxl_mem_create_range_info(struct cxl_memdev_state *mds)
12241224
return 0;
12251225
}
12261226

1227-
cxlds->dpa_res =
1228-
(struct resource)DEFINE_RES_MEM(0, mds->total_bytes);
1227+
cxlds->dpa_res = DEFINE_RES_MEM(0, mds->total_bytes);
12291228

12301229
if (mds->partition_align_bytes == 0) {
12311230
rc = add_dpa_res(dev, &cxlds->dpa_res, &cxlds->ram_res, 0,

0 commit comments

Comments
 (0)