Commit 579e2f6d authored by Chris Wilson's avatar Chris Wilson Committed by Zhenyu Wang

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: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Zhi Wang <zhi.a.wang@intel.com>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
parent 1c6ccad8
...@@ -162,7 +162,7 @@ static int verify_firmware(struct intel_gvt *gvt, ...@@ -162,7 +162,7 @@ static int verify_firmware(struct intel_gvt *gvt,
h = (struct gvt_firmware_header *)fw->data; 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; mem = fw->data + crc32_start;
#define VERIFY(s, a, b) do { \ #define VERIFY(s, a, b) do { \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment