lkml.org 
[lkml]   [2022]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [GIT PULL] dmi update for v5.19
On Wed, Aug 24, 2022 at 8:41 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Mon, Aug 22, 2022 at 5:19 AM Jean Delvare <jdelvare@suse.de> wrote:
> >
> > Andy Shevchenko (1):
> > firmware: dmi: Use the proper accessor for the version field
>
> I pulled this, but I kind of question it.
>
> This replaces a single 32-bit memory access (and an optimized byte
> swap) and a mask operation with three load-byte-and-shift operations.
>
> It's not clear that the new code is better.

That concern was arisen during discussion, but my point here is that
when you read the SMBus specification and look at the offset 6 the
operation on it, even optimized, may confuse the reader. At least it
confused me. Hence the patch.

> That said, I can't imagine it matters - but because I looked at it, I
> note that the length check seems to be kind of iffy.
>
> The code checks that the length of the block is < 32 before doing the
> checksum on it, but shouldn't it also check for some minimum size?
> Otherwise the dmi checksum is kind of pointless, isn't it?
>
> It will access a minimum of 24 bytes for that dmi_base thing, so that
> would be the most obvious minimum value. But maybe there is some
> spec-defined size for that that only covers the header?

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2022-08-24 20:04    [W:0.057 / U:0.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site