On Fri, 5 Nov 2021 16:50:56 -0700 <ira.weiny@xxxxxxxxx> wrote: > From: Ira Weiny <ira.weiny@xxxxxxxxx> > > Parse and cache the DSMAS data from the CDAT table. Store this data in > Unmarshaled data structures for use later. > > Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx> > > +static bool cdat_hdr_valid(struct cxl_memdev *cxlmd) > +{ > + u32 *data = cxlmd->cdat_table; > + u8 *data8 = (u8 *)data; > + u32 length, seq; > + u8 rev, cs; > + u8 check; > + int i; > + > + length = FIELD_GET(CDAT_HEADER_DW0_LENGTH, data[0]); > + if (length < CDAT_HEADER_LENGTH_BYTES) > + return false; > + > + rev = FIELD_GET(CDAT_HEADER_DW1_REVISION, data[1]); > + cs = FIELD_GET(CDAT_HEADER_DW1_CHECKSUM, data[1]); rev and cs both parsed out but not used... W=1 is complaining at me, hence I noticed whilst rebasing this series. Jonathan > + seq = FIELD_GET(CDAT_HEADER_DW3_SEQUENCE, data[3]); > + > + /* Store the sequence for now. */ > + cxlmd->cdat_seq = seq; > + > + for (check = 0, i = 0; i < length; i++) > + check += data8[i]; > + > + return check == 0; > +}