cxl/mbox: Drop extra struct resource cast
PATCH 1/1 cxl/mbox: Drop extra struct resource cast
DEFINE_RES_MEM() is a wrapper around the DEFINE_RES_NAMED() macro which already has the (struct resource) cast.
Fixes warnings with W=1 C=1
CC [M] drivers/cxl/core/mbox.o
CHECK drivers/cxl/core/mbox.cdrivers/cxl/core/mbox.c:1064:18: warning: cast to non-scalar drivers/cxl/core/mbox.c:1064:18: warning: cast from non-scalar
---
I'm seeing a couple of other instances of thisdrivers/acpi/arm64/gtdt.carch/arm/mach-shmobile/pm-rcar-gen2.c
Might get around to fixing them but more than happy if someone beats me to it.
drivers/cxl/core/mbox.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/cxl/core/mbox.c +1 -2
@@ -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
Quoted 9 lines · Jonathan Cameron
DEFINE_RES_MEM()is a wrapper around theDEFINE_RES_NAMED()macro which already has the (struct resource) cast.Fixes warnings with W=1 C=1
CC [M]drivers/cxl/core/mbox.o
CHECKdrivers/cxl/core/mbox.cdrivers/cxl/core/mbox.c:1064:18: warning: cast to non-scalardrivers/cxl/core/mbox.c:1064:18: warning: cast from non-scalar
Quoted 3 lines
Fixes 52c4d11f1dce ("resource: Convert DEFINE_RES_NAMED() to be compound literal")Signed-off-by Jonathan Cameron <[email protected]>Cc Andy Shevchenko <[email protected]>
Quoted 25 lines
---
I'm seeing a couple of other instances of this
drivers/acpi/arm64/gtdt.carch/arm/mach-shmobile/pm-rcar-gen2.cMight get around to fixing them but more than happy if someone beats me to it.
drivers/cxl/core/mbox.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/cxl/core/mbox.c +1
-2@@ -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,
Quoted 2 lines · Jonathan Cameron
DEFINE_RES_MEM()is a wrapper around theDEFINE_RES_NAMED()macro which already has the (struct resource) cast.
It's not a cast. As commit message that brought it says: "Converting it to be a compound literal..."
Quoted 5 lines
Fixes warnings with W=1 C=1
CC [M]drivers/cxl/core/mbox.o
CHECKdrivers/cxl/core/mbox.cdrivers/cxl/core/mbox.c:1064:18: warning: cast to non-scalardrivers/cxl/core/mbox.c:1064:18: warning: cast from non-scalar
Otherwise it's a correct fix, thank you!
For the corrected version:
Quoted 31 lines
Fixes 52c4d11f1dce ("resource: Convert DEFINE_RES_NAMED() to be compound literal")Signed-off-by Jonathan Cameron <[email protected]>Cc Andy Shevchenko <[email protected]>---
I'm seeing a couple of other instances of this
drivers/acpi/arm64/gtdt.carch/arm/mach-shmobile/pm-rcar-gen2.cMight get around to fixing them but more than happy if someone beats me to it.
drivers/cxl/core/mbox.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/cxl/core/mbox.c +1
-2@@ -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
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 6 lines · Andy Shevchenko
Quoted 2 lines · Jonathan Cameron
DEFINE_RES_MEM()is a wrapper around theDEFINE_RES_NAMED()macro which already has the (struct resource) cast.It's not a cast. As commit message that brought it says: "Converting it to be a compound literal..."
...
Quoted 2 lines
drivers/cxl/core/mbox.c int cxl_mem_create_range_info(struct cxl_dev_state *cxlds) · line 1056
Quoted 2 lines
drivers/cxl/core/mbox.c +0
-2- cxlds->dpa_res = - (struct resource )DEFINE_RES_MEM (0 , cxlds->total_bytes);
FWIW, here it's also not a cast.
Signature · 2 lines
With Best Regards, Andy Shevchenko