Re: [PATCH] drm/i915/gvt: Use offsetofend() rather than offsetof + sizeof

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2018.05.16 17:38:30 +0100, Chris Wilson wrote:
> Quoting Mika Kuoppala (2017-03-16 09:37:44)
> > Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> writes:
> > 
> > > Compute the offset of the end of the crc32 field using offsetofend()
> > > rather than open-coding.
> > >
> > > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > > Cc: Zhenyu Wang <zhenyuw@xxxxxxxxxxxxxxx>
> > > Cc: Zhi Wang <zhi.a.wang@xxxxxxxxx>
> > 
> > Reviewed-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxx>
> 
> This still applies...
>

Sorry for missed this one! Will pick it up for sure.

> > > ---
> > >  drivers/gpu/drm/i915/gvt/firmware.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/gvt/firmware.c b/drivers/gpu/drm/i915/gvt/firmware.c
> > > index 933a7c211a1c..3a5a81fcb406 100644
> > > --- a/drivers/gpu/drm/i915/gvt/firmware.c
> > > +++ b/drivers/gpu/drm/i915/gvt/firmware.c
> > > @@ -159,7 +159,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 { \
> > > -- 
> > > 2.11.0
> > >
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > 
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux