lkml.org 
[lkml]   [2024]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 06/26] cxl/port: Add Dynamic Capacity mode support to endpoint decoders
Dan Williams wrote:
> 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"?

Once we open up DC partitions to support multiple regions, no.

How about we remove the check in dc_mode_to_region_index() but keep the
function? That makes it clear that we are converting from an enum to int
index?

Ira

\
 
 \ /
  Last update: 2024-05-27 18:23    [W:0.272 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site