From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: <alison.schofield@intel.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
Dave Jiang <dave.jiang@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
<linux-cxl@vger.kernel.org>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH] cxl/mbox: Remove useless cast in cxl_mem_create_range_info()
Date: Mon, 7 Aug 2023 14:33:34 +0100 [thread overview]
Message-ID: <20230807143334.00005448@Huawei.com> (raw)
In-Reply-To: <20230804190309.1665132-1-alison.schofield@intel.com>
On Fri, 4 Aug 2023 12:03:09 -0700
alison.schofield@intel.com wrote:
> From: Alison Schofield <alison.schofield@intel.com>
>
> DEFINE_RES_MEM() returns a struct resource so the cast is not needed.
> Remove it.
>
> Found using sparse:
> drivers/cxl/core/mbox.c:1184:18: warning: cast to non-scalar
> drivers/cxl/core/mbox.c:1184:18: warning: cast from non-scalar
>
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Good to call out this is a result of Andy's cleanup
42c4211f1 ("resource: Convert DEFINE_RES_NAMED() to be a compound literal")
I thought we'd long caught all of these (IIRC there were a few at the time).
Ah well.
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
next prev parent reply other threads:[~2023-08-07 13:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-04 19:03 [PATCH] cxl/mbox: Remove useless cast in cxl_mem_create_range_info() alison.schofield
2023-08-07 13:33 ` Jonathan Cameron [this message]
2023-08-07 14:28 ` Andy Shevchenko
2023-08-15 16:46 ` Alison Schofield
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230807143334.00005448@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=alison.schofield@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.