From: Alison Schofield <alison.schofield@intel.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Dave Jiang <dave.jiang@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
linux-cxl@vger.kernel.org
Subject: Re: [PATCH v2] cxl/region: Add dev_dbg() detail on failure to allocate HPA space
Date: Tue, 12 Dec 2023 13:18:16 -0800 [thread overview]
Message-ID: <ZXjOGHLEYhvjoS+x@aschofie-mobl2> (raw)
In-Reply-To: <656e80f2bb9f7_45e0129484@dwillia2-xfh.jf.intel.com.notmuch>
On Mon, Dec 04, 2023 at 05:46:26PM -0800, Dan Williams wrote:
> alison.schofield@ wrote:
> > From: Alison Schofield <alison.schofield@intel.com>
snip
> >
> >
> > Changes in v2:
> > - Improve the message text (Vishal)
> > - Add reviewed by tags (DaveJ, Vishal)
> > - Link to v1:
> > https://lore.kernel.org/linux-cxl/20231114040147.1124696-1-alison.schofield@intel.com/
> >
> >
> > drivers/cxl/core/region.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> > index 56e575c79bb4..ec792af873c4 100644
> > --- a/drivers/cxl/core/region.c
> > +++ b/drivers/cxl/core/region.c
> > @@ -552,8 +552,9 @@ static int alloc_hpa(struct cxl_region *cxlr, resource_size_t size)
> > res = alloc_free_mem_region(cxlrd->res, size, SZ_256M,
> > dev_name(&cxlr->dev));
> > if (IS_ERR(res)) {
> > - dev_dbg(&cxlr->dev, "failed to allocate HPA: %ld\n",
> > - PTR_ERR(res));
> > + dev_dbg(&cxlr->dev,
> > + "HPA allocation error:%ld for size:%#llx in %s %pr\n",
> > + PTR_ERR(res), size, cxlrd->res->name, cxlrd->res);
>
> I notice that this did not pick up Vishal's suggested "error (%d) ..."
> style for conveying the error code.
>
> "HPA allocation error (%d) for size: %llx in %s ..."
>
> I prefer that style as well.
I should have said something in the changelog. I rejected the
parentheses based on this:
"Printing numbers in parentheses (%d) adds no value and should be
avoided." in Documentation/process/coding-style.rst
Since it's a dev_dbg() msg I'll go ahead and add those parens.
(But this is not a precedent for parens all over ;))
Alison
prev parent reply other threads:[~2023-12-12 21:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 0:39 [PATCH v2] cxl/region: Add dev_dbg() detail on failure to allocate HPA space alison.schofield
2023-12-05 1:46 ` Dan Williams
2023-12-12 21:18 ` Alison Schofield [this message]
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=ZXjOGHLEYhvjoS+x@aschofie-mobl2 \
--to=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox