mirror of
https://github.com/torvalds/linux.git
synced 2024-12-14 15:13:52 +00:00
drm/i915/gvt: Use offsetofend() rather than offsetof + sizeof
Compute the offset of the end of the crc32 field using offsetofend() rather than open-coding. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Zhenyu Wang <zhenyuw@linux.intel.com> Cc: Zhi Wang <zhi.a.wang@intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
This commit is contained in:
parent
1c6ccad8a4
commit
579e2f6d99
@ -162,7 +162,7 @@ static int verify_firmware(struct intel_gvt *gvt,
|
||||
|
||||
h = (struct gvt_firmware_header *)fw->data;
|
||||
|
||||
crc32_start = offsetof(struct gvt_firmware_header, crc32) + 4;
|
||||
crc32_start = offsetofend(struct gvt_firmware_header, crc32);
|
||||
mem = fw->data + crc32_start;
|
||||
|
||||
#define VERIFY(s, a, b) do { \
|
||||
|
Loading…
Reference in New Issue
Block a user