Re: [PATCH 06/26] cxl/port: Add Dynamic Capacity mode support to endpoint decoders

From: Dan Williams
Date: Mon May 06 2024 - 12:22:35 EST


Ira Weiny wrote:
[..]
> > > + case CXL_DECODER_DC0 ... CXL_DECODER_DC7:
> > > + rc = dc_mode_to_region_index(mode);
> > > + if (rc < 0)
> > > + return rc;
> >
> > Can't fail, so you could not bother checking.. Seems very unlikely
> > that function will gain other error cases in the future.
>
> Sure, done.

Can dc_mode_to_region_index() be dropped altogether? Is there any
scenario where dc_mode_to_region_index() is really handling an anonymous
@mode argument? I.e. just replace all dc_mode_to_region_index() with
"mode - CXL_DECODER_DC0"?