mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
i915/gvt: remove hardcoded value on crc32_start calculation
struct gvt_firmware_header has a crc32 member in which all members that come after the that field are used to calculate it. The previous implementation added the value '4' (crc32's u32 size) to calculate the crc32_start offset which came across as a bit cryptic until you take a deeper look at the struct. This patch changes crc32_start offset to the 'version' member which is the first member of the struct gvt_firmware_header after crc32. It's worth mentioning that doing a build before/after this patch results in no binary output differences. Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20221030033628.GA279284@mail.google.com Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
This commit is contained in:
parent
df947eb63f
commit
a34985dcac
|
|
@ -104,7 +104,7 @@ static int expose_firmware_sysfs(struct intel_gvt *gvt)
|
|||
|
||||
memcpy(p, gvt->firmware.mmio, info->mmio_size);
|
||||
|
||||
crc32_start = offsetof(struct gvt_firmware_header, crc32) + 4;
|
||||
crc32_start = offsetof(struct gvt_firmware_header, version);
|
||||
h->crc32 = crc32_le(0, firmware + crc32_start, size - crc32_start);
|
||||
|
||||
firmware_attr.size = size;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user