Re: [PATCH v2 04/12] cxl: Unify debug messages when calling devm_cxl_add_dport()

From: Robert Richter
Date: Fri Oct 21 2022 - 05:00:28 EST


On 20.10.22 17:32:58, Dan Williams wrote:
> Robert Richter wrote:

> > diff --git a/tools/testing/cxl/test/cxl.c b/tools/testing/cxl/test/cxl.c
> > index a072b2d3e726..c610625e8261 100644
> > --- a/tools/testing/cxl/test/cxl.c
> > +++ b/tools/testing/cxl/test/cxl.c
> > @@ -582,14 +582,8 @@ static int mock_cxl_port_enumerate_dports(struct cxl_port *port)
> > dport = devm_cxl_add_dport(port, &pdev->dev, pdev->id,
> > CXL_RESOURCE_NONE);
> >
> > - if (IS_ERR(dport)) {
> > - dev_err(dev, "failed to add dport: %s (%ld)\n",
> > - dev_name(&pdev->dev), PTR_ERR(dport));
> > + if (IS_ERR(dport))
> > return PTR_ERR(dport);
> > - }
> > -
> > - dev_dbg(dev, "add dport%d: %s\n", pdev->id,
> > - dev_name(&pdev->dev));
>
> This hunk causes this new compile error:
>
> tools/testing/cxl/test/cxl.c: In function ‘mock_cxl_port_enumerate_dports’:
> tools/testing/cxl/test/cxl.c:559:24: error: unused variable ‘dev’ [-Werror=unused-variable]
> 559 | struct device *dev = &port->dev;
> | ^~~
> cc1: all warnings being treated as errors
>
> I fixed it up locally, but just double check that you are building
> cxl_test if you touch tools/testing/cxl/:
>
> make M=tools/testing/cxl

Right. Thanks for fixing. Will build test in the future.

-Robert