Re: [PATCH 2/3] misc: enclosure, ses: simplify some get callbacks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mariusz Tkaczyk wrote:
> On Thu, 4 May 2023 16:58:35 -0700
> Dan Williams <dan.j.williams@xxxxxxxxx> wrote:
> 
> > Mariusz Tkaczyk wrote:
> > > Remove active, status, fault and locate variables from
> > > enclosure_component struct. Return then directly.
> > > No functional changes intended.  
> > 
> > This looks ok although it's not a clear win on the diffstat. Does this
> > make the NPEM implementation easier to remove the indirection through
> > "struct enclosure_component" for reading fresh values? That would help
> > make the case.
> 
> I did that to familiarize better with this API. I determined that those values
> can be just returned. They are refreshed every time on read in get_*led*(). I
> believed that it makes implementation simpler for reader.
> 
> It could save me from some questions, "why not to reuse existing active,
> fault, status variables" but it is no clear benefit.
> It saves some memory because those variable probably won't be used in
> NPEM/_DSM implementation (at least draft I left doesn't not use them).
> 
> If you don't see this valuable let me know, I can drop it.

I think the problem with it is that it now requires a get_active()
implementation where one was not needed before, see my comment on
patch3. The attributes to cache the values allows a 'get' method to be
skipped when 'set'+caching is sufficient.



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux