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 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 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?

Linus

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